diff --git a/__tests__/post-build/__snapshots__/exampleShortHeaders.json.spec.js.snap b/__tests__/post-build/__snapshots__/exampleShortHeaders.json.spec.js.snap index c0e293c3e..377d2b3fb 100644 --- a/__tests__/post-build/__snapshots__/exampleShortHeaders.json.spec.js.snap +++ b/__tests__/post-build/__snapshots__/exampleShortHeaders.json.spec.js.snap @@ -28,10 +28,9 @@ Object { "Event functions", "Sounds and music", "Layers and cameras", - "Conversion", "Events and control flow", + "External layouts", "Mathematical tools", - "Mouse and touch", "Objects", "Scene", "Timers and time", @@ -52,7 +51,6 @@ Object { "Text capability", "Text object", "Tiled Sprite Object", - "Top-down movement", "Tweening", "Parallax for Tiled Sprite", "Panel sprite button", @@ -64,6 +62,7 @@ Object { "Multitouch joystick and buttons (sprite)", "Shake object", "Volume Falloff", + "Screen Orientation Checker", ], } `; diff --git "a/examples/360\302\260-platformer/360\302\260-platformer.json" "b/examples/360\302\260-platformer/360\302\260-platformer.json" index 71598be95..cb93421a7 100644 --- "a/examples/360\302\260-platformer/360\302\260-platformer.json" +++ "b/examples/360\302\260-platformer/360\302\260-platformer.json" @@ -1,9 +1,9 @@ { "firstLayout": "", "gdVersion": { - "build": 216, + "build": 221, "major": 5, - "minor": 4, + "minor": 5, "revision": 0 }, "properties": { @@ -18,7 +18,6 @@ "scaleMode": "linear", "sizeOnStartupMode": "adaptWidth", "templateSlug": "", - "useExternalSourceFiles": false, "version": "1.0.0", "name": "Hedgehog platformer", "description": "LShift to jump\nArrows to move\nLShift + Down to do a spindash", @@ -73,7 +72,6 @@ "resources": { "resources": [ { - "alwaysLoaded": false, "file": "assets/Blue player_stand.png", "kind": "image", "metadata": "", @@ -86,7 +84,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Blue player_walk_1.png", "kind": "image", "metadata": "", @@ -99,7 +96,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Blue player_walk_2.png", "kind": "image", "metadata": "", @@ -112,7 +108,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Blue player_walk_3.png", "kind": "image", "metadata": "", @@ -125,7 +120,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Blue player_walk_4.png", "kind": "image", "metadata": "", @@ -138,7 +132,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Blue player_up_1.png", "kind": "image", "metadata": "", @@ -151,7 +144,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Blue player_up_2.png", "kind": "image", "metadata": "", @@ -164,7 +156,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Blue player_roll.png", "kind": "image", "metadata": "", @@ -177,7 +168,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Blue player_crouch.png", "kind": "image", "metadata": "", @@ -186,7 +176,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/NewSprite.png", "kind": "image", "metadata": "{\"extension\":\".png\"}", @@ -195,7 +184,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/LayerToggleMarker.png", "kind": "image", "metadata": "{\"extension\":\".png\",\"localFilePath\":\"assets/LayerToggleMarker.png\"}", @@ -204,7 +192,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/LayerToggleMarker2.png", "kind": "image", "metadata": "{\"localFilePath\":\"assets/LayerToggleMarker2.png\",\"extension\":\".png\"}", @@ -213,7 +200,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/GroundLayerToggleMarker.png", "kind": "image", "metadata": "{\"extension\":\".png\",\"localFilePath\":\"assets/GroundLayerToggleMarker.png\"}", @@ -230,7 +216,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/HedgehogAtlas.png", "kind": "image", "metadata": "", @@ -247,7 +232,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/tiled_Background Blue Grass.png", "kind": "image", "metadata": "", @@ -260,7 +244,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/MovingPlatform.png", "kind": "image", "metadata": "", @@ -269,7 +252,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Star Gold.png", "kind": "image", "metadata": "", @@ -282,7 +264,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Spring.png", "kind": "image", "metadata": "", @@ -291,7 +272,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Spring_Compressed.png", "kind": "image", "metadata": "", @@ -300,7 +280,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Spring_Extended.png", "kind": "image", "metadata": "", @@ -309,7 +288,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Top arrow button.png", "kind": "image", "metadata": "", @@ -322,7 +300,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Flat dark joystick border.png", "kind": "image", "metadata": "", @@ -335,7 +312,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Flat dark joystick thumb.png", "kind": "image", "metadata": "", @@ -346,6 +322,18 @@ "identifier": "https://asset-resources.gdevelop.io/public-resources/Multitouch joysticks/10167ade22c4a6b48324e6c1d1bd6dc74179d7bed0775890903f418b4a05c8a1_Flat dark joystick thumb.png", "name": "Flat dark joystick thumb.png" } + }, + { + "file": "assets/rotate-screen-icon.png", + "kind": "image", + "metadata": "", + "name": "rotate-screen-icon.png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Mobile Layouts/assets/6a8102ce3340bf9f62300ee1a81ef0b2327b2c6e8d62d7dda68d547f5e2b5969_rotate-screen-icon.png", + "name": "rotate-screen-icon.png" + } } ], "resourceFolders": [] @@ -3256,12 +3244,22 @@ { "adaptCollisionMaskAutomatically": true, "assetStoreId": "9c727020616afdd6ba786b8af206a90481f07db0ca175ed6a4cc5b7e01c66d06", - "name": "TopArrowButton", + "name": "JumpButton", "type": "Sprite", "updateIfNotVisible": false, "variables": [], "effects": [], "behaviors": [ + { + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 0, + "name": "Anchor", + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "type": "AnchorBehavior::AnchorBehavior", + "useLegacyBottomAndRightAnchors": false + }, { "name": "MultitouchButton", "type": "SpriteMultitouchJoystick::MultitouchButton", @@ -3269,7 +3267,8 @@ "ButtonIdentifier": "A", "TouchId": 0, "TouchIndex": 2.0247e-320, - "IsReleased": false + "IsReleased": false, + "Radius": 200 } ], "animations": [ @@ -3325,7 +3324,7 @@ }, { "assetStoreId": "e71bd69f896d6c7531b48c65ceb5da25071d4fbdeb518aeceecba8d21f34ed8d", - "name": "FlatDarkJoystick", + "name": "WalkJoystick", "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "variables": [], "effects": [], @@ -3403,11 +3402,160 @@ ] } } + }, + { + "assetStoreId": "e5919fb86a559b00001678c710efe55f4e9f2e032a9ff9610087370f998d57de", + "name": "ScreenOrientationChecker", + "type": "ScreenOrientationChecker::ScreenOrientationChecker", + "variables": [], + "effects": [], + "behaviors": [ + { + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "name": "Anchor", + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "type": "AnchorBehavior::AnchorBehavior", + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "IsForceShown": false, + "BackgroundColor": "24;24;24", + "CornerRadius": 8, + "Padding": 5 + }, + "childrenContent": { + "BackgroundPainter": { + "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 + } + }, + "Icon": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "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 + } + ] + ] + } + ] + } + ] + } + ] + }, + "Text": { + "bold": true, + "italic": false, + "smoothed": true, + "underlined": false, + "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, + "color": "255;255;255" + } + } + } } ], "objectsFolderStructure": { "folderName": "__ROOT", "children": [ + { + "folderName": "UI", + "children": [ + { + "objectName": "JumpButton" + }, + { + "objectName": "WalkJoystick" + }, + { + "objectName": "ScreenOrientationChecker" + } + ] + }, { "objectName": "Player" }, @@ -3464,12 +3612,6 @@ }, { "objectName": "Spring" - }, - { - "objectName": "TopArrowButton" - }, - { - "objectName": "FlatDarkJoystick" } ] }, @@ -3505,27 +3647,6 @@ "\"Collision\"" ] } - ], - "events": [ - { - "disabled": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "DebuggerTools::EnableDebugDraw" - }, - "parameters": [ - "", - "", - "yes", - "no", - "no" - ] - } - ] - } ] }, { @@ -3570,6 +3691,59 @@ "" ] } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "WalkJoystick" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "WalkJoystick", + "", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "WalkJoystick", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "WalkJoystick", + "CursorX(\"UI\")" + ] + } ] }, { @@ -3583,11 +3757,11 @@ "subInstructions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "Left" + "\"Left\"" ] }, { @@ -3652,11 +3826,11 @@ "subInstructions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "Right" + "\"Right\"" ] }, { @@ -3721,11 +3895,11 @@ "subInstructions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "Down" + "\"Down\"" ] }, { @@ -3790,20 +3964,20 @@ "subInstructions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "Space" + "\"Space\"" ] }, { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "LShift" + "\"LShift\"" ] }, { @@ -3855,11 +4029,11 @@ "subInstructions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "LControl" + "\"LControl\"" ] }, { @@ -4947,7 +5121,7 @@ "name": "SpriteMultitouchJoystick", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Videogames/Videogames_controller_joystick_arrows_direction.svg", "shortDescription": "Joysticks or buttons for touchscreens.", - "version": "1.3.0", + "version": "1.6.1", "description": [ "Multitouch joysticks can be used the same way as physical gamepads:", "- 4 or 8 directions", @@ -4982,59 +5156,509 @@ ], "dependencies": [], "globalVariables": [], - "sceneVariables": [], + "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 a button is pressed on a gamepad.", - "fullName": "Multitouch controller button pressed", - "functionType": "Condition", - "name": "IsButtonPressed", - "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is pressed", + "fullName": "Accelerated speed", + "functionType": "Expression", + "name": "AcceleratedSpeed", + "private": true, + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "VarSceneTxt" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "AcceleratedSpeed", "=", - "\"Pressed\"" + "CurrentSpeed" ] } ], - "actions": [ + "events": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"TargetedSpeed\"", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(0, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", + "description": "Current speed", + "name": "CurrentSpeed", "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" + "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 is released on a gamepad.", - "fullName": "Multitouch controller button released", + "description": "Check if a button is pressed on a gamepad.", + "fullName": "Multitouch controller button pressed", + "functionType": "Condition", + "name": "IsButtonPressed", + "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Buttons[Button].State", + "=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Button name", + "name": "Button", + "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a button is released on a gamepad.", + "fullName": "Multitouch controller button released", "functionType": "Condition", "name": "IsButtonReleased", "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is released", @@ -5044,10 +5668,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Released\"" ] @@ -5094,10 +5718,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Buttons[Button].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "ButtonState" ] @@ -5139,10 +5763,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", "=", "DeadZoneRadius" ] @@ -5187,7 +5811,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone" ] } ] @@ -5227,7 +5851,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 4 / 360), 4)" + "mod(round(Angle * 4 / 360), 4)" ] } ] @@ -5262,7 +5886,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 8 / 360), 8)" + "mod(round(Angle * 8 / 360), 8)" ] } ] @@ -5296,7 +5920,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -5309,7 +5933,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5333,7 +5957,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -5346,7 +5970,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5370,7 +5994,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -5383,7 +6007,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5407,7 +6031,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -5420,7 +6044,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5468,7 +6092,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -5481,7 +6105,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5505,7 +6129,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownRight\"" ] @@ -5518,7 +6142,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5542,7 +6166,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -5555,7 +6179,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5579,7 +6203,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownLeft\"" ] @@ -5592,7 +6216,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5616,7 +6240,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -5629,7 +6253,7 @@ "", "=", "4", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5653,7 +6277,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpLeft\"" ] @@ -5666,7 +6290,7 @@ "", "=", "5", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5690,7 +6314,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -5703,7 +6327,7 @@ "", "=", "6", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5727,7 +6351,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpRight\"" ] @@ -5740,7 +6364,7 @@ "", "=", "7", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5969,6 +6593,11 @@ "name": "JoystickIdentifier", "supplementaryInformation": "[\"Primary\",\"Secondary\"]", "type": "stringWithSelector" + }, + { + "description": "", + "name": "Coucou", + "type": "expression" } ], "objectGroups": [] @@ -5989,7 +6618,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0, Variable(__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force) - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier)) / (1 - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier))" + "max(0, Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier)) / (1 - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -6027,10 +6656,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", "=", "Value" ] @@ -6074,7 +6703,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -6114,7 +6743,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle" ] } ] @@ -6152,12 +6781,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6198,7 +6827,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::JoystickForce(ControllerIdentifier, JoystickIdentifier) * cos(ToRad(SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)))" + "XFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -6238,7 +6867,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::JoystickForce(ControllerIdentifier, JoystickIdentifier) * sin(ToRad(SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)))" + "YFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -6261,6 +6890,123 @@ } ], "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": "CompareArgumentAsString" + }, + "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": "CompareArgumentAsString" + }, + "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": [ @@ -6287,9 +7033,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyDeadZoneRadius()", + "ControllerIdentifier", + "JoystickIdentifier", + "DeadZoneRadius", "" ] }, @@ -6451,8 +7197,8 @@ }, "parameters": [ "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)" + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)" ] } ], @@ -6465,7 +7211,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] } ] @@ -6512,7 +7258,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -6564,8 +7310,8 @@ "parameters": [ "Object", "Behavior", - "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))", - "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))" + "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))" ] }, { @@ -6576,7 +7322,7 @@ "Object", "Behavior", "=", - "clamp(2 * DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)) / Object.Width(), 0, 1)", + "clamp(2 * DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(TouchId, Object.Layer(), 0), TouchY(TouchId, Object.Layer(), 0)) / Object.Width(), 0, 1)", "" ] } @@ -6690,6 +7436,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "", + "name": "Parameter", + "type": "objectList" } ], "objectGroups": [] @@ -6754,7 +7505,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -6763,9 +7514,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickAngle()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickAngle", "" ] } @@ -7125,7 +7876,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyControllerIdentifier()" + "ControllerIdentifier" ] } ] @@ -7168,7 +7919,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -7206,7 +7957,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyJoystickIdentifier()" + "JoystickIdentifier" ] } ] @@ -7249,7 +8000,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -7332,6 +8083,58 @@ "=", "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": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] } ] } @@ -7347,6 +8150,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "Touch identifier", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -7521,12 +8329,31 @@ "conditions": [ { "type": { - "value": "CollisionPoint" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)" + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer())", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer())" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyRadius" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer()), TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer()))" + ] + } ] } ], @@ -7539,7 +8366,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] }, { @@ -7595,7 +8422,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -7763,9 +8590,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyButtonIdentifier()", - "GetArgumentAsString(\"ButtonState\")", + "ControllerIdentifier", + "ButtonIdentifier", + "ButtonState", "" ] } @@ -7842,6 +8669,16 @@ "extraInformation": [], "hidden": true, "name": "IsReleased" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Triggering circle radius", + "description": "This circle adds up to the object collision mask.", + "group": "", + "extraInformation": [], + "name": "Radius" } ], "sharedPropertyDescriptors": [] @@ -7867,8 +8704,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -7895,8 +8732,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -7923,8 +8760,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -7960,8 +8797,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -7988,8 +8825,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJumpButton()", + "ControllerIdentifier", + "JumpButton", "\"Down\"" ] } @@ -8069,9 +8906,9 @@ "sharedPropertyDescriptors": [] }, { - "description": "Control a top-down character with a multitouch controller.", - "fullName": "Top-down multitouch controller mapper", - "name": "TopDownMultitouchMapper", + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D platformer multitouch controller mapper", + "name": "Platformer3DMultitouchMapper", "objectType": "", "eventsFunctions": [ { @@ -8085,55 +8922,39 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "value": "SpriteMultitouchJoystick::StickForce" }, "parameters": [ - "Object", - "Behavior", - "=", - "\"Analog\"" + "", + ">", + "0", + "ControllerIdentifier", + "JoystickIdentifier", + "" ] } ], "actions": [ { "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "SpriteMultitouchJoystick::StickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", - "SpriteMultitouchJoystick::StickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "value": "Physics3D::PhysicsCharacter3D::SetForwardAngle" }, "parameters": [ "Object", - "Behavior", + "PhysicsCharacter3D", "=", - "\"360°\"" + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier) + CameraAngle(Object.Layer())" ] - } - ], - "actions": [ + }, { "type": { - "value": "TopDownMovementBehavior::SimulateStick" + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" }, "parameters": [ "Object", - "TopDownMovement", - "SpriteMultitouchJoystick::StickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", - "sign(SpriteMultitouchJoystick::StickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier()))" + "PhysicsCharacter3D", + "-90", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -8143,423 +8964,24 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "value": "SpriteMultitouchJoystick::IsButtonPressed" }, "parameters": [ - "Object", - "Behavior", - "=", - "\"8 Directions\"" + "", + "ControllerIdentifier", + "JumpButton", + "\"Down\"" ] } ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "TopDownMovementBehavior::DiagonalsAllowed" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - } - ] - }, + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "TopDownMovementBehavior::DiagonalsAllowed" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"UpLeft\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"UpRight\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"DownLeft\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"DownRight\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - } + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" ] } ] @@ -8574,7 +8996,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", + "supplementaryInformation": "SpriteMultitouchJoystick::Platformer3DMultitouchMapper", "type": "behavior" } ], @@ -8585,13 +9007,13 @@ { "value": "", "type": "Behavior", - "label": "Top-down movement behavior", + "label": "3D physics character", "description": "", "group": "", "extraInformation": [ - "TopDownMovementBehavior::TopDownMovementBehavior" + "Physics3D::PhysicsCharacter3D" ], - "name": "TopDownMovement" + "name": "PhysicsCharacter3D" }, { "value": "1", @@ -8605,9 +9027,9 @@ { "value": "Primary", "type": "Choice", - "label": "Joystick name", + "label": "Walk joystick", "description": "", - "group": "", + "group": "Controls", "extraInformation": [ "Primary", "Secondary" @@ -8615,164 +9037,239 @@ "name": "JoystickIdentifier" }, { - "value": "Analog", - "type": "Choice", - "label": "Stick mode", + "value": "A", + "type": "String", + "label": "Jump button name", "description": "", "group": "Controls", - "extraInformation": [ - "Analog", - "360°", - "8 Directions" - ], - "name": "StickMode" + "extraInformation": [], + "name": "JumpButton" } ], "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", + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D shooter multitouch controller mapper", + "name": "Shooter3DMultitouchMapper", + "objectType": "", "eventsFunctions": [ { "fullName": "", "functionType": "Action", - "name": "onCreated", + "name": "doStepPreEvents", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "Create" + "value": "SpriteMultitouchJoystick::StickForce" }, "parameters": [ "", - "Border", - "0", + ">", "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] - }, + } + ], + "actions": [ { "type": { - "value": "Create" + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" }, "parameters": [ - "", - "Thumb", - "0", - "0", - "" + "Object", + "PhysicsCharacter3D", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "ChangePlan" + "value": "SpriteMultitouchJoystick::IsButtonPressed" }, "parameters": [ - "Border", - "=", - "1" - ] - }, + "", + "ControllerIdentifier", + "JumpButton", + "\"Down\"" + ] + } + ], + "actions": [ { "type": { - "value": "ChangePlan" + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" }, "parameters": [ - "Thumb", + "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", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control camera rotations with a multitouch controller.", + "fullName": "First person camera multitouch controller mapper", + "name": "FirstPersonMultitouchMapper", + "objectType": "", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyCurrentRotationSpeedZ" + }, + "parameters": [ + "Object", + "Behavior", "=", - "2" + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedZ, SpriteMultitouchJoystick::StickForceX(ControllerIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" ] }, { "type": { - "value": "SetCenter" + "value": "SetAngle" }, "parameters": [ - "Border", - "=", - "0", - "=", - "0" + "Object", + "+", + "CurrentRotationSpeedZ * TimeDelta()" ] }, { "type": { - "value": "SetCenter" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyCurrentRotationSpeedY" }, "parameters": [ - "Thumb", - "=", - "0", + "Object", + "Behavior", "=", - "0" + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedY, SpriteMultitouchJoystick::StickForceY(ControllerIdentifier, CameraStick) * VerticalRotationSpeedMax, VerticalRotationSpeedMax, VerticalRotationAcceleration, VerticalRotationDeceleration)" ] }, { "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + "value": "Scene3D::Base3DBehavior::SetRotationY" }, "parameters": [ "Object", - "" + "Object3D", + "+", + "CurrentRotationSpeedY * TimeDelta()" ] }, { "type": { - "value": "SetIncludedInParentCollisionMask" + "value": "Scene3D::Base3DBehavior::SetRotationY" }, "parameters": [ - "Thumb", - "" + "Object", + "Object3D", + "=", + "clamp(Object.Object3D::RotationY(), VerticalAngleMin, VerticalAngleMax)" ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + }, { "type": { - "value": "MettreAutour" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::LookFromObjectEyes" }, "parameters": [ - "Thumb", - "Border", - "Border.MultitouchJoystick::JoystickForce() * Border.Width() / 2", - "Border.MultitouchJoystick::JoystickAngle()" + "Object", + "Behavior", + "" ] } ] @@ -8782,17 +9279,25 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "", + "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", - "name": "onHotReloading", - "sentence": "", + "group": "Layers and cameras", + "name": "LookFromObjectEyes", + "private": true, + "sentence": "Move the camera to look though _PARAM0_ eyes", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -8800,71 +9305,61 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + "value": "CentreCamera" }, "parameters": [ + "", "Object", + "", + "Object.Layer()", "" ] - } - ] - } - ], - "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" + "value": "Scene3D::SetCameraZ" }, "parameters": [ - "Border", - "MultitouchJoystick", + "", "=", - "Object.PropertyControllerIdentifier()", + "Object.Object3D::Z() + Object.Object3D::Depth() + OffsetZ", + "", "" ] }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + "value": "Scene3D::SetCameraRotationX" }, "parameters": [ - "Border", - "MultitouchJoystick", + "", "=", - "Object.PropertyJoystickIdentifier()", + "- Object.Object3D::RotationY() + 90", + "GetArgumentAsString(\"Layer\")", "" ] }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + "value": "Scene3D::SetCameraRotationY" }, "parameters": [ - "Border", - "MultitouchJoystick", + "", + "=", + "Object.Object3D::RotationX()", + "GetArgumentAsString(\"Layer\")", + "" + ] + }, + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", "=", - "Object.PropertyDeadZoneRadius()", + "Object.Angle() + 90", + "Object.Layer()", "" ] } @@ -8875,114 +9370,78 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "De/activate control of the joystick.", - "fullName": "De/activate control", - "functionType": "Action", - "name": "ActivateControl", - "sentence": "Activate control of _PARAM0_: _PARAM1_", + "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": [ - { - "type": { - "inverted": true, - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"ShouldActivate\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "no" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"ShouldActivate\"" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "ActivateBehavior" + "value": "SetReturnNumber" }, "parameters": [ - "Border", - "MultitouchJoystick", - "yes" + "HorizontalRotationSpeedMax" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Activate", - "name": "ShouldActivate", - "type": "yesorno" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if a stick is pressed.", - "fullName": "Stick pressed", - "functionType": "Condition", - "name": "IsPressed", - "sentence": "Stick _PARAM0_ is pressed", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationSpeedMax", + "name": "SetHorizontalRotationSpeedMax", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsPressed" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "!=" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationSpeedMax" }, "parameters": [ - "True" + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -8992,19 +9451,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the joystick force (from 0 to 1).", - "fullName": "Joystick force (deprecated)", + "description": "the horizontal rotation acceleration of the object.", + "fullName": "Horizontal rotation acceleration", "functionType": "ExpressionAndCondition", - "name": "JoystickForce", - "private": true, - "sentence": "the joystick force", + "group": "First person camera multitouch controller mapper horizontal rotation configuration", + "name": "HorizontalRotationAcceleration", + "sentence": "the horizontal rotation acceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -9015,7 +9479,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::JoystickForce()" + "HorizontalRotationAcceleration" ] } ] @@ -9028,18 +9492,23 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the strick force (from 0 to 1).", - "fullName": "Stick force", - "functionType": "ExpressionAndCondition", - "name": "StickForce", - "sentence": "the stick force", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationAcceleration", + "name": "SetHorizontalRotationAcceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -9047,34 +9516,40 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationAcceleration" }, "parameters": [ - "Border.MultitouchJoystick::JoystickForce()" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the stick force on X axis (from -1 at the left to 1 at the right).", - "fullName": "Stick X force", + "description": "the horizontal rotation deceleration of the object.", + "fullName": "Horizontal rotation deceleration", "functionType": "ExpressionAndCondition", - "name": "StickForceX", - "sentence": "the stick X force", + "group": "First person camera multitouch controller mapper horizontal rotation configuration", + "name": "HorizontalRotationDeceleration", + "sentence": "the horizontal rotation deceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -9085,7 +9560,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::StickForceX()" + "HorizontalRotationDeceleration" ] } ] @@ -9098,18 +9573,23 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "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", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationDeceleration", + "name": "SetHorizontalRotationDeceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -9117,35 +9597,40 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationDeceleration" }, "parameters": [ - "Border.MultitouchJoystick::StickForceY()" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "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": "", + "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", @@ -9156,7 +9641,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::JoystickAngle()" + "VerticalRotationSpeedMax" ] } ] @@ -9169,17 +9654,22 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Return the angle the stick is pointing towards (from -180 to 180).", - "fullName": "Stick angle", - "functionType": "Expression", - "name": "StickAngle", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationSpeedMax", + "name": "SetVerticalRotationSpeedMax", "sentence": "", "events": [ { @@ -9188,107 +9678,94 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationSpeedMax" }, "parameters": [ - "Border.MultitouchJoystick::JoystickAngle()" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "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 _PARAM1_", + "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": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "Direction", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "VerticalRotationAcceleration" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", - "type": "stringWithSelector" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "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_", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationAcceleration", + "name": "SetVerticalRotationAcceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "Direction", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationAcceleration" }, "parameters": [ - "True" + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -9298,25 +9775,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", - "type": "stringWithSelector" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the multitouch controller identifier (1, 2, 3, 4...).", - "fullName": "Multitouch controller identifier", + "description": "the vertical rotation deceleration of the object.", + "fullName": "Vertical rotation deceleration", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "ControllerIdentifier", - "sentence": "the multitouch controller identifier", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalRotationDeceleration", + "sentence": "the vertical rotation deceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -9327,7 +9803,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyControllerIdentifier()" + "VerticalRotationDeceleration" ] } ] @@ -9340,8 +9816,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -9349,8 +9830,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "ControllerIdentifier", - "name": "SetControllerIdentifier", + "getterName": "VerticalRotationDeceleration", + "name": "SetVerticalRotationDeceleration", "sentence": "", "events": [ { @@ -9359,14 +9840,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationDeceleration" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "Value" ] } ] @@ -9376,19 +9856,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the joystick name of the object.", - "fullName": "Joystick name", + "description": "the minimum vertical camera angle of the object.", + "fullName": "Minimum vertical camera angle", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "JoystickIdentifier", - "sentence": "the joystick name", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalAngleMin", + "sentence": "the minimum vertical camera angle", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -9396,24 +9881,29 @@ "actions": [ { "type": { - "value": "SetReturnString" + "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyJoystickIdentifier()" + "VerticalAngleMin" ] } ] } ], "expressionType": { - "type": "string" + "type": "expression" }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -9421,8 +9911,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "JoystickIdentifier", - "name": "SetJoystickIdentifier", + "getterName": "VerticalAngleMin", + "name": "SetVerticalAngleMin", "sentence": "", "events": [ { @@ -9431,14 +9921,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMin" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsString(\"Value\")", - "" + "Value" ] } ] @@ -9448,19 +9937,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "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", + "description": "the maximum vertical camera angle of the object.", + "fullName": "Maximum vertical camera angle", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "DeadZoneRadius", - "sentence": "the dead zone radius", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalAngleMax", + "sentence": "the maximum vertical camera angle", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -9471,7 +9965,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyDeadZoneRadius()" + "VerticalAngleMax" ] } ] @@ -9484,8 +9978,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -9493,8 +9992,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "DeadZoneRadius", - "name": "SetDeadZoneRadius", + "getterName": "VerticalAngleMax", + "name": "SetVerticalAngleMax", "sentence": "", "events": [ { @@ -9503,14 +10002,94 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMax" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyOffsetZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -9520,1932 +10099,2083 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] } ], "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "description": "", + "group": "", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "name": "Object3D" + }, { "value": "1", "type": "Number", - "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "label": "Controller identifier (1, 2, 3, 4...)", "description": "", "group": "", "extraInformation": [], "name": "ControllerIdentifier" }, { - "value": "Primary", + "value": "Secondary", "type": "Choice", - "label": "Joystick name", + "label": "Camera joystick", "description": "", - "group": "", + "group": "Controls", "extraInformation": [ "Primary", "Secondary" ], - "name": "JoystickIdentifier" + "name": "CameraStick" }, { - "value": "0.4", + "value": "180", "type": "Number", - "label": "Dead zone radius (range: 0 to 1)", - "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", - "group": "", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Horizontal rotation", "extraInformation": [], - "name": "DeadZoneRadius" + "name": "HorizontalRotationSpeedMax" }, { - "value": "Center-center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [ - "Thumb" - ], - "hidden": true, - "name": "ThumbAnchorOrigin" + "value": "360", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationAcceleration" }, { - "value": "Center-center", + "value": "720", "type": "Number", - "label": "", - "description": "Only used by the scene editor.", - "group": "", + "label": "Rotation deceleration", + "description": "", + "group": "Horizontal rotation", "extraInformation": [], - "hidden": true, - "name": "ThumbAnchorTarget" + "name": "HorizontalRotationDeceleration" }, { - "value": "true", - "type": "Boolean", - "label": "", - "description": "Only used by the scene editor.", + "value": "120", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationSpeedMax" + }, + { + "value": "240", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationAcceleration" + }, + { + "value": "480", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationDeceleration" + }, + { + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Minimum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMin" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Maximum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z position offset", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Z", + "description": "", "group": "", - "extraInformation": [ - "Thumb" - ], + "extraInformation": [], "hidden": true, - "name": "ThumbIsScaledProportionally" + "name": "CurrentRotationSpeedZ" }, { - "value": "Center-center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Y", + "description": "", "group": "", "extraInformation": [], "hidden": true, - "name": "ParentOrigin" + "name": "CurrentRotationSpeedY" } ], - "objects": [ + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a top-down character with a multitouch controller.", + "fullName": "Top-down multitouch controller mapper", + "name": "TopDownMultitouchMapper", + "objectType": "", + "eventsFunctions": [ { - "adaptCollisionMaskAutomatically": false, - "assetStoreId": "", - "name": "Thumb", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [], - "animations": [ + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [] + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" + ] } ] - } - ] - }, - { - "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": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [] + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "sign(SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" + ] } ] - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Thumb" - }, - { - "objectName": "Border" - } - ] - }, - "objectsGroups": [], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ + }, { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [] - } - ] - }, - { - "author": "Bouh", - "category": "Input", - "extensionNamespace": "", - "fullName": "Gamepads (controllers)", - "helpPath": "/all-features/gamepad", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWdhbWVwYWQtdmFyaWFudC1vdXRsaW5lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTYsOUg4VjExSDEwVjEzSDhWMTVINlYxM0g0VjExSDZWOU0xOC41LDlBMS41LDEuNSAwIDAsMSAyMCwxMC41QTEuNSwxLjUgMCAwLDEgMTguNSwxMkExLjUsMS41IDAgMCwxIDE3LDEwLjVBMS41LDEuNSAwIDAsMSAxOC41LDlNMTUuNSwxMkExLjUsMS41IDAgMCwxIDE3LDEzLjVBMS41LDEuNSAwIDAsMSAxNS41LDE1QTEuNSwxLjUgMCAwLDEgMTQsMTMuNUExLjUsMS41IDAgMCwxIDE1LjUsMTJNMTcsNUE3LDcgMCAwLDEgMjQsMTJBNyw3IDAgMCwxIDE3LDE5QzE1LjA0LDE5IDEzLjI3LDE4LjIgMTIsMTYuOUMxMC43MywxOC4yIDguOTYsMTkgNywxOUE3LDcgMCAwLDEgMCwxMkE3LDcgMCAwLDEgNyw1SDE3TTcsN0E1LDUgMCAwLDAgMiwxMkE1LDUgMCAwLDAgNywxN0M4LjY0LDE3IDEwLjA5LDE2LjIxIDExLDE1SDEzQzEzLjkxLDE2LjIxIDE1LjM2LDE3IDE3LDE3QTUsNSAwIDAsMCAyMiwxMkE1LDUgMCAwLDAgMTcsN0g3WiIgLz48L3N2Zz4=", - "name": "Gamepads", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/gamepad-variant-outline.svg", - "shortDescription": "Add support for gamepads (or other controllers) to your game, giving access to information such as button presses, axis positions, trigger pressure, etc...", - "version": "0.6.1", - "description": [ - "Add support for gamepads (or other controllers).", - "", - "It gives access to:", - "- button presses", - "- axis positions and force", - "- trigger pressure", - "- configurable deadzone", - "- vibration", - "- automatic mappers for platformer characters and top-down movement", - "", - "The Bomberman-like example handles 4 players with gamepads ([open the project online](https://editor.gdevelop.io/?project=example://goose-bomberman))." - ], - "origin": { - "identifier": "Gamepads", - "name": "gdevelop-extension-store" - }, - "tags": [ - "controllers", - "gamepads", - "joysticks", - "axis", - "xbox", - "ps4", - "platformer", - "platform", - "top-down" - ], - "authorIds": [ - "2OwwM8ToR9dx9RJ2sAKTcrLmCB92", - "taRwmWxwAFYFL9yyBwB3cwBw0BO2", - "mnImQKdn8nQxwzkS5D6a1JB27V23" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Get the value of the pressure on a gamepad trigger.", - "fullName": "Pressure on a gamepad trigger", - "functionType": "Expression", - "name": "TriggerPressure", - "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const trigger = eventsFunctionContext.getArgument(\"trigger\").toUpperCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in expression: \"Pressure on a gamepad trigger\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "if (trigger != \"LT\" && trigger != \"RT\" && trigger != \"L2\" && trigger != \"R2\") {\r", - " console.error('Parameter trigger is not valid in expression: \"Pressure on a gamepad trigger\"');\r", - " return;\r", - "}\r", - "\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "switch (trigger) {\r", - " case 'LT':\r", - " case 'L2':\r", - " eventsFunctionContext.returnValue = gamepad.buttons[6].value;\r", - " break;\r", - "\r", - " case 'RT':\r", - " case 'R2':\r", - " eventsFunctionContext.returnValue = gamepad.buttons[7].value;\r", - " break;\r", - "\r", - " default:\r", - " eventsFunctionContext.returnValue = -1;\r", - " break;\r", - "}" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - }, - { - "description": "Trigger button", - "name": "trigger", - "supplementaryInformation": "[\"LT\",\"RT\",\"L2\",\"R2\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "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": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", - "\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick force\"');\r", - " return;\r", - "}\r", - "\r", - "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a stick force\"');\r", - " return;\r", - "}\r", - "\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "\r", - "switch (stick) {\r", - " case 'LEFT':\r", - " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId)), 0, 1);\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId)), 0, 1);\r", - " break;\r", - "\r", - " default:\r", - " eventsFunctionContext.returnValue = -1;\r", - " break;\r", - "}" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "TopDownMovementBehavior::DiagonalsAllowed" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "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" + ] + } + ] + } + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] } ], - "expressionType": { - "type": "expression" - }, - "parameters": [ + "propertyDescriptors": [ { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "value": "", + "type": "Behavior", + "label": "Top-down movement behavior", + "description": "", + "group": "", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" + ], + "name": "TopDownMovement" }, { - "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": [ + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Gamepads::StickAngle(GetArgumentAsNumber(\"player_ID\"), GetArgumentAsString(\"stick\"))" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "description": "", + "group": "", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" }, { - "description": "Stick: \"Left\" or \"Right\"", - "name": "stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" + "value": "Analog", + "type": "Choice", + "label": "Stick mode", + "description": "", + "group": "Controls", + "extraInformation": [ + "Analog", + "360°", + "8 Directions" + ], + "name": "StickMode" } ], - "objectGroups": [] - }, + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [ { - "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": [ + "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", + "eventsFunctions": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", - "\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick rotation\"');\r", - " return;\r", - "}\r", - "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a stick rotation\"');\r", - " return;\r", - "}\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "switch (stick) {\r", - " case 'LEFT':\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId));\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId));\r", - " break;\r", - "\r", - " default:\r", - " eventsFunctionContext.returnValue = -1;\r", - " break;\r", - "}" + "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", + "" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] }, { - "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": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", - "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "if (stick != \"LEFT\" && stick != \"RIGHT\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "if (direction != \"UP\" && direction != \"DOWN\" && direction != \"LEFT\" && direction != \"RIGHT\" && direction != \"HORIZONTAL\" && direction != \"VERTICAL\") {\r", - " console.error('Parameter direction is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "let parameterError = false;\r", - "switch (stick) {\r", - " case 'LEFT':\r", - " switch (direction) {\r", - " case 'LEFT':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'UP':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'DOWN':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", - " }\r", - " break;\r", - "\r", - " case \"HORIZONTAL\":\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", - " break;\r", - "\r", - " case \"VERTICAL\":\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", - " break;\r", - "\r", - " default:\r", - " break;\r", - " }\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " switch (direction) {\r", - " case 'LEFT':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'UP':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'DOWN':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", - " }\r", - " break;\r", - "\r", - " case \"HORIZONTAL\":\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", - " break;\r", - "\r", - " case \"VERTICAL\":\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", - " break;\r", - "\r", - " default:\r", - " break;\r", - " }\r", - " break;\r", - "\r", - " default:\r", - " break;\r", - "}\r", - "" + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreAutour" + }, + "parameters": [ + "Thumb", + "Border", + "Border.MultitouchJoystick::JoystickForce() * Border.Width() / 2", + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::PropertyShouldBeHiddenWhenReleased" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Object", + "no", + "" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] }, { - "description": "Stick: \"Left\" or \"Right\"", - "name": "stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" + "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": "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": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "if (stick != \"left\" && stick != \"right\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "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": "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": "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": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "if (stick != \"left\" && stick != \"right\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "const axisIndex = stick === 'right' ? 3 : 1;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[axisIndex], playerId);\r", - "" + "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": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::SetPropertyShouldBeHiddenWhenReleased" + }, + "parameters": [ + "Object", + "yes" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::ForceStartPressing" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "StartedTouchOrMouseId(0)", + "" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Gamepad", - "type": "expression" + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] }, { - "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": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in condition: \"Gamepad button released\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "if (button === \"\") {\r", - " console.error('Parameter button is not valid in condition: \"Gamepad button released\"');\r", - " return;\r", - "}\r", - "\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "let buttonId;\r", - "\r", - "switch (button) {\r", - " case 'A':\r", - " case 'CROSS':\r", - " buttonId = 0;\r", - " break;\r", - " case 'B':\r", - " case 'CIRCLE':\r", - " buttonId = 1;\r", - " break;\r", - " case 'X':\r", - " case 'SQUARE':\r", - " buttonId = 2;\r", - " break;\r", - " case 'Y':\r", - " case 'TRIANGLE':\r", - " buttonId = 3;\r", - " break;\r", - " case 'LB':\r", - " case 'L1':\r", - " buttonId = 4;\r", - " break;\r", - " case 'RB':\r", - " case 'R1':\r", - " buttonId = 5;\r", - " break;\r", - " case 'LT':\r", - " case 'L2':\r", - " buttonId = 6;\r", - " break;\r", - " case 'RT':\r", - " case 'R2':\r", - " buttonId = 7;\r", - " break;\r", - "\r", - " case 'UP':\r", - " buttonId = 12;\r", - " break;\r", - " case 'DOWN':\r", - " buttonId = 13;\r", - " break;\r", - " case 'LEFT':\r", - " buttonId = 14;\r", - " break;\r", - " case 'RIGHT':\r", - " buttonId = 15;\r", - " break;\r", - "\r", - " case 'BACK':\r", - " case 'SHARE':\r", - " buttonId = 8;\r", - " break;\r", - " case 'START':\r", - " case 'OPTIONS':\r", - " buttonId = 9;\r", - " break;\r", - "\r", - " case 'CLICK_STICK_LEFT':\r", - " buttonId = 10;\r", - " break;\r", - " case 'CLICK_STICK_RIGHT':\r", - " buttonId = 11;\r", - " break;\r", - "\r", - " //PS4\r", - " case 'PS_BUTTON':\r", - " buttonId = 16;\r", - " break;\r", - " case 'CLICK_TOUCHPAD':\r", - " buttonId = 17;\r", - " break;\r", - "\r", - " default:\r", - " console.error('The button: ' + button + ' in condition: \"Gamepad button released\" is not valid.');\r", - " break;\r", - "}\r", - "\r", - "if (buttonId === undefined) {\r", - " console.error('There is no buttons valid in condition: \"Gamepad button released\"');\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", - " console.error('Buttons on the gamepad are not accessible in condition: \"Gamepad button released\"');\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "//Define default value on pressed button or use previous value\r", - "gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] || { pressed: false };\r", - "\r", - "//Get state of button at previous frame\r", - "const previousStateButton = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed;\r", - "\r", - "//When previousStateButton is true and actual button state is not pressed\r", - "//Player have release the button\r", - "if (previousStateButton === true && gamepad.buttons[buttonId].pressed === false) {\r", - " // Save the last button used for the player \r", - " gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", - " gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = true;\r", - " eventsFunctionContext.returnValue = true;\r", - "\r", - "} else {\r", - " gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = false;\r", - " eventsFunctionContext.returnValue = false;\r", - "}\r", - "" + "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 + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Touch identifier", + "name": "TouchId", + "type": "expression" + } + ], + "objectGroups": [] }, { - "description": "Name of the button", - "name": "button", - "supplementaryInformation": "[\"A\",\"Cross\",\"B\",\"Circle\",\"X\",\"Square\",\"Y\",\"Triangle\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"Up\",\"Down\",\"Left\",\"Right\",\"Back\",\"Share\",\"Start\",\"Options\",\"Click_Stick_Left\",\"Click_Stick_Right\",\"PS_Button\",\"Click_Touchpad\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Return the index of the last pressed button of a gamepad.", - "fullName": "Last pressed button (id)", - "functionType": "Expression", - "name": "LastButtonID", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "//Get function parameter\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "\r", - "//Player id is not valid\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in expression: \"Last pressed button (id)\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "\r", - "//Return the last button used by the player\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].lastButtonUsed;" + "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 + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Check if any button is pressed on a gamepad.", - "fullName": "Any gamepad button pressed", - "functionType": "Condition", - "name": "C_Any_Button_pressed", - "sentence": "Any button of gamepad _PARAM1_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameter\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in condition: \"Any gamepad button pressed\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "let buttonId;\r", - "for (let i = 0; i < gamepad.buttons.length; i++) { //For each buttons\r", - " if (gamepad.buttons[i].pressed) { //One of them is pressed\r", - " buttonId = i; //Save the button pressed\r", - " break;\r", - " }\r", - "}\r", - "\r", - "if (buttonId === undefined) {\r", - " // No buttons are pressed.\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", - " console.error('Buttons on the gamepad are not accessible in condition: \"Any gamepad button pressed\"');\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "//When a button is pressed, save the button in lastButtonUsed for each players\r", - "if (gamepad.buttons[buttonId].pressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", - "eventsFunctionContext.returnValue = gamepad.buttons[buttonId].pressed;\r", - "\r", - "\r", - "" + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Touch identifier", + "name": "TouchId", + "type": "expression" + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ + "objectGroups": [] + }, { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Return the last button pressed. \nButtons for Xbox and PS4 can be:\n* Xbox: \"A\", \"B\", \"X\", \"Y\", \"LB\", \"RB\", \"LT\", \"RT\", \"BACK\", \"START\",\n* PS4: \"CROSS\", \"SQUARE\", \"CIRCLE\", \"TRIANGLE\", \"L1\", \"L2\", \"R1\", \"R2\", \"SHARE\", \"OPTIONS\", \"PS_BUTTON\", \"CLICK_TOUCHPAD\",\n* Both: \"UP\", \"DOWN\", \"LEFT\", \"RIGHT\", \"CLICK_STICK_LEFT\", \"CLICK_STICK_RIGHT\".", - "fullName": "Last pressed button (string)", - "functionType": "StringExpression", - "name": "LastButtonString", - "sentence": "Button _PARAM2_ of gamepad _PARAM1_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in string expression: \"Last pressed button (LastButtonString)\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "if (controllerType === \"\") {\r", - " console.error('Parameter controller type is not valid in string expression: \"Last pressed button (LastButtonString)\"');\r", - " return;\r", - "}\r", - "\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "if (gamepad !== null) { //Gamepad exist\r", - " //Get last btn id\r", - " const lastButtonUsedID = gdjs._extensionController.players[playerId].lastButtonUsed;\r", - "\r", - " //Return last button as string \r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getInputString(controllerType, lastButtonUsedID);\r", - "\r", - "} else { //Gamepad dosen't exist\r", - " console.error('Your controller is not supported or the gamepad wasn\\'t detected in string expression: \"Last pressed button (LastButtonString)\"');\r", - " eventsFunctionContext.returnValue = \"Gamepad not connected\";\r", - "}" + "description": "De/activate control of the joystick.", + "fullName": "De/activate control", + "functionType": "Action", + "name": "ActivateControl", + "sentence": "Activate control of _PARAM0_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "yes" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Activate", + "name": "ShouldActivate", + "type": "yesorno" + } + ], + "objectGroups": [] }, { - "description": "Controller type", - "name": "controller_type", - "supplementaryInformation": "[\"Xbox\",\"PS4\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Return the number of gamepads.", - "fullName": "Gamepad count", - "functionType": "Expression", - "name": "GamepadCount", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get the last activated controller\r", - "const controllerId = gdjs._extensionController.lastActiveController;\r", - "\r", - "// Check if controller is active\r", - "const gamepad = gamepads[controllerId];\r", - "if (gamepad == null) {\r", - " eventsFunctionContext.returnValue = 0;\r", - "} else {\r", - " // Return active controller id\r", - " eventsFunctionContext.returnValue = controllerId + 1;\r", - "}\r", - "" + "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" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [], - "objectGroups": [] - }, - { - "description": "Check if a button is pressed on a gamepad. \nButtons can be:\n* Xbox: \"A\", \"B\", \"X\", \"Y\", \"LB\", \"RB\", \"LT\", \"RT\", \"BACK\", \"START\",\n* PS4: \"CROSS\", \"SQUARE\", \"CIRCLE\", \"TRIANGLE\", \"L1\", \"L2\", \"R1\", \"R2\", \"SHARE\", \"OPTIONS\", \"PS_BUTTON\", \"CLICK_TOUCHPAD\",\n* Other: \"UP\", \"DOWN\", \"LEFT\", \"RIGHT\", \"CLICK_STICK_LEFT\", \"CLICK_STICK_RIGHT\".", - "fullName": "Gamepad button pressed", - "functionType": "Condition", - "name": "C_Button_pressed", - "sentence": "Button _PARAM2_ of gamepad _PARAM1_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in condition: \"Gamepad button pressed\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "if (button === \"\") {\r", - " console.error('Parameter button is not valid in condition: \"Gamepad button pressed\"');\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "let buttonId;\r", - "\r", - "switch (button) {\r", - " case 'A':\r", - " case 'CROSS':\r", - " buttonId = 0;\r", - " break;\r", - " case 'B':\r", - " case 'CIRCLE':\r", - " buttonId = 1;\r", - " break;\r", - " case 'X':\r", - " case 'SQUARE':\r", - " buttonId = 2;\r", - " break;\r", - " case 'Y':\r", - " case 'TRIANGLE':\r", - " buttonId = 3;\r", - " break;\r", - " case 'LB':\r", - " case 'L1':\r", - " buttonId = 4;\r", - " break;\r", - " case 'RB':\r", - " case 'R1':\r", - " buttonId = 5;\r", - " break;\r", - " case 'LT':\r", - " case 'L2':\r", - " buttonId = 6;\r", - " break;\r", - " case 'RT':\r", - " case 'R2':\r", - " buttonId = 7;\r", - " break;\r", - "\r", - " case 'UP':\r", - " buttonId = 12;\r", - " break;\r", - " case 'DOWN':\r", - " buttonId = 13;\r", - " break;\r", - " case 'LEFT':\r", - " buttonId = 14;\r", - " break;\r", - " case 'RIGHT':\r", - " buttonId = 15;\r", - " break;\r", - "\r", - " case 'BACK':\r", - " case 'SHARE':\r", - " buttonId = 8;\r", - " break;\r", - " case 'START':\r", - " case 'OPTIONS':\r", - " buttonId = 9;\r", - " break;\r", - "\r", - " case 'CLICK_STICK_LEFT':\r", - " buttonId = 10;\r", - " break;\r", - " case 'CLICK_STICK_RIGHT':\r", - " buttonId = 11;\r", - " break;\r", - "\r", - " //PS4\r", - " case 'PS_BUTTON':\r", - " buttonId = 16;\r", - " break;\r", - " case 'CLICK_TOUCHPAD':\r", - " buttonId = 17;\r", - " break;\r", - "\r", - " default:\r", - " console.error('The button: ' + button + ' in condition: \"Gamepad button pressed\" is not valid.');\r", - " eventsFunctionContext.returnValue = false;\r", - " break;\r", - "}\r", - "\r", - "\r", - "\r", - "if (buttonId === undefined) {\r", - " console.error('There is no buttons valid in condition: \"Gamepad button pressed\"');\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", - " console.error('Buttons on the gamepad are not accessible in condition: \"Gamepad button pressed\"');\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "//When a button is pressed, save the button in lastButtonUsed for each players\r", - "if (gamepad.buttons[buttonId].pressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", - "eventsFunctionContext.returnValue = gamepad.buttons[buttonId].pressed;\r", - "\r", - "\r", - "\r", - "" + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "objectGroups": [] }, { - "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": [] + "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": [] }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "//Get function parameter\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in expression: \"Gamepad deadzone for sticks\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "///Return the deadzone value for a given player\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].deadzone;" + "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()" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Set the deadzone for sticks of the gamepad. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved). Deadzone is between 0 and 1, and is by default 0.2.", - "fullName": "Set gamepad deadzone for sticks", - "functionType": "Action", - "name": "A_Set_deadzone", - "sentence": "Set deadzone for sticks on gamepad: _PARAM1_ to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "//Get function parameter\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const newDeadzone = eventsFunctionContext.getArgument(\"deadzone\");\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in action: \"Set gamepad deadzone for sticks\", is not valid, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "\r", - "// clamp the newDeadzone in range [0, 1].\r", - "// https://github.com/4ian/GDevelop-extensions/pull/33#issuecomment-618224857\r", - "gdjs._extensionController.players[playerId].deadzone = gdjs.evtTools.common.clamp(newDeadzone, 0, 1);\r", - "" + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "objectGroups": [] }, { - "description": "Deadzone for sticks, 0.2 by default (0 to 1)", - "name": "deadzone", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Check if a stick of a gamepad is pushed in a given direction.", - "fullName": "Gamepad stick pushed (axis)", - "functionType": "Condition", - "name": "C_Axis_pushed", - "sentence": "_PARAM2_ stick of gamepad _PARAM1_ is pushed in direction _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", - "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in condition: \"Gamepad stick pushed (axis)\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "if (stick != \"LEFT\" && stick != \"RIGHT\") {\r", - " console.error('Parameter stick in condition: \"Gamepad stick pushed (axis)\", is not valid, must be LEFT or RIGHT');\r", - " return;\r", - "}\r", - "if (direction != \"UP\" && direction != \"DOWN\" && direction != \"LEFT\" && direction != \"RIGHT\" && direction != \"ANY\") {\r", - " console.error('Parameter deadzone in condition: \"Gamepad stick pushed (axis)\", is not valid, must be UP, DOWN, LEFT or RIGHT');\r", - " return;\r", - "}\r", - "\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) {\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "\r", - "//Define in onFirstSceneLoaded function\r", - "const getNormalizedAxisValue = gdjs._extensionController.getNormalizedAxisValue;\r", - "\r", - "switch (stick) {\r", - " case 'LEFT':\r", - " switch (direction) {\r", - " case 'LEFT':\r", - " if (getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " if (getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'UP':\r", - " if (getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'DOWN':\r", - " if (getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'ANY':\r", - " if ( getNormalizedAxisValue(gamepad.axes[0], playerId) < 0\r", - " || getNormalizedAxisValue(gamepad.axes[0], playerId) > 0\r", - " || getNormalizedAxisValue(gamepad.axes[1], playerId) < 0 \r", - " || getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " default:\r", - " console.error('The value Direction on stick Left on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", - " eventsFunctionContext.returnValue = false;\r", - " break;\r", - " }\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " switch (direction) {\r", - " case 'LEFT':\r", - " if (getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " if (getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'UP':\r", - " if (getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'DOWN':\r", - " if (getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'ANY':\r", - " if ( getNormalizedAxisValue(gamepad.axes[2], playerId) < 0\r", - " || getNormalizedAxisValue(gamepad.axes[2], playerId) > 0\r", - " || getNormalizedAxisValue(gamepad.axes[3], playerId) < 0 \r", - " || getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " default:\r", - " console.error('The value Direction on stick Right on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", - " eventsFunctionContext.returnValue = false;\r", - " break;\r", - " }\r", - " break;\r", - "\r", - " default:\r", - " console.error('The value Stick on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", - " eventsFunctionContext.returnValue = false;\r", - " break;\r", - "}\r", - "\r", - "eventsFunctionContext.returnValue = false;\r", - "" + "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()" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] }, { - "description": "Stick: \"Left\" or \"Right\"", - "name": "stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" + "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": "Direction", - "name": "direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"Any\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Return the number of connected gamepads.", - "fullName": "Connected gamepads number", - "functionType": "Expression", - "name": "ConnectedGamepadsCount", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] + "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": [] }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "// Gamepads can be disconnected and become null, so we have to filter them.\r", - "eventsFunctionContext.returnValue = Object.keys(gamepads).filter(key => !!gamepads[key]).length;\r", - "" + "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()" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [], - "objectGroups": [] - }, - { - "description": "Return a string containing informations about the specified gamepad.", - "fullName": "Gamepad type", - "functionType": "StringExpression", - "name": "GamepadType", - "sentence": "Player _PARAM1_ use _PARAM2_ controller", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", - "", - "//Get function parameter", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", - "", - "if (playerId < 0 || playerId > 4) {", - " console.error('Parameter gamepad identifier in string expression: \"Gamepad type\", is not valid number, must be between 0 and 4');", - " return;", - "}", - "", - "const gamepad = gamepads[playerId];", - "", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", - "if (gamepad == null) return;", - "", - "eventsFunctionContext.returnValue = (gamepad && gamepad.id) ? gamepad.id : \"No information for player \" + (playerId + 1)", - "" + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the specified gamepad has the specified information in its description. Useful to know if the gamepad is a Xbox or PS4 controller.", - "fullName": "Gamepad type", - "functionType": "Condition", - "name": "C_Controller_type", - "sentence": "Gamepad _PARAM1_ is a _PARAM2_ controller", - "events": [ + "objectGroups": [] + }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", - "", - "//Get function parameters", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", - "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();", - "", - "if (playerId < 0 || playerId > 4) {", - " console.error('Parameter gamepad identifier in condition: \"Gamepad type\", is not valid number, must be between 0 and 4.');", - " return;", - "}", - "if (controllerType === \"\") {", - " console.error('Parameter type in condition: \"Gamepad type\", is not a string.');", - " return;", - "}", - "", - "const gamepad = gamepads[playerId];", - "", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", - "if (gamepad == null) return;", - "", - "", - "if (controllerType == \"XBOX\") {", - " eventsFunctionContext.returnValue = gdjs._extensionController.isXbox(gamepad);", - "} else {", - " eventsFunctionContext.returnValue = gamepad ? gamepad.id.toUpperCase().indexOf(controllerType) !== -1 : false;", - "}" + "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" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "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": "Type: \"Xbox\", \"PS4\", \"Steam\" or \"PS3\" (among other)", - "name": "controller_type", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "Check if a gamepad is connected.", - "fullName": "Gamepad connected", - "functionType": "Condition", - "name": "C_Controller_X_is_connected", - "sentence": "Gamepad _PARAM1_ is plugged and connected", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", - "", - "//Get function parameter", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", - "", - "if (playerId < 0 || playerId > 4) {", - " console.error('Parameter gamepad identifier in condition: \"Gamepad connected\", is not valid number, must be between 0 and 4.');", - " return;", - "}", - "", - "// If gamepad was disconnected it will be null (so this will return false)", - "// If gamepad was never connected it will be undefined (so this will return false)", - "eventsFunctionContext.returnValue = !!gamepads[playerId];" + "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()" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Generate a vibration on the specified controller. Might only work if the game is running in a recent web browser.", - "fullName": "Gamepad vibration", - "functionType": "Action", - "name": "A_Vibrate_controller", - "sentence": "Make gamepad _PARAM1_ vibrate for _PARAM2_ seconds", - "events": [ + "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": [] + }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */", - "//Vibration work only on game in browser.", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", - "", - "//Get function parameters", - "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", - "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", - "", - "if (playerId < 0 || playerId > 4) {", - " console.error('Parameter gamepad identifier in action: \"Gamepad connected\", is not valid number, must be between 0 and 4.');", - " return;", - "}", - "", - "const gamepad = gamepads[playerId];", - "", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", - "if (gamepad == null) return;", - "", - "if (gamepad && gamepad.vibrationActuator) {", - " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", - " startDelay: 0,", - " duration: duration * 1000,", - " weakMagnitude: 1.0,", - " strongMagnitude: 1.0", - " });", - "}" + "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()" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Player_ID", - "type": "expression" + "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": "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": [ + "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": [] + }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */", - "//Vibration work only on game in browser.", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", - "", - "//Get function parameters", - "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", - "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", - "const strongRumbleMagnitude = eventsFunctionContext.getArgument(\"StrongMagnitude\");", - "const weakRumbleMagnitude = eventsFunctionContext.getArgument(\"WeakMagnitude\");", - "", - "if (playerId < 0 || playerId > 4) {", - " console.error('Parameter gamepad identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 4.');", - " return;", - "}", - "if (weakRumbleMagnitude < 0 || weakRumbleMagnitude > 1) {", - " console.error('Parameter weakRumble identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 1.');", - " return;", - "}", - "if (strongRumbleMagnitude < 0 || strongRumbleMagnitude > 1) {", - " console.error('Parameter strongRumble identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 1.');", - " return;", - "}", - "", - "const gamepad = gamepads[playerId];", - "", - "//we need keep this condition because when use have not yet plug the controller we can't get the controller in the gamepad variable.", - "if (gamepad == null) return;", - "", - "if (gamepad && gamepad.vibrationActuator) {", - " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", - " startDelay: 0,", - " duration: duration * 1000,", - " weakMagnitude: weakRumbleMagnitude,", - " strongMagnitude: strongRumbleMagnitude", - " });", - "}", - "", - "gdjs._extensionController.players[playerId].rumble.duration = duration;", - "gdjs._extensionController.players[playerId].rumble.elapsedTime = 0;", - "gdjs._extensionController.players[playerId].rumble.weakMagnitude = weakRumbleMagnitude;", - "gdjs._extensionController.players[playerId].rumble.strongMagnitude = strongRumbleMagnitude;" + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DeadZoneRadius", + "name": "SetDeadZoneRadius", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Value", + "" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] } ], - "parameters": [ + "propertyDescriptors": [ { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Player_ID", - "type": "expression" + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" }, { - "description": "Time of the vibration, in seconds (optional, default value is 1)", - "name": "Duration", - "type": "expression" + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "description": "", + "group": "", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" }, { - "description": "Strong rumble magnitude (from 0 to 1)", - "name": "StrongMagnitude", - "type": "expression" + "value": "0.4", + "type": "Number", + "label": "Dead zone radius (range: 0 to 1)", + "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", + "group": "", + "extraInformation": [], + "name": "DeadZoneRadius" }, { - "description": "Weak rumble magnitude (from 0 to 1)", - "name": "WeakMagnitude", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Change a vibration on the specified controller. Incompatible with Firefox.", - "fullName": "Change gamepad active vibration", - "functionType": "Action", - "name": "A_Change_Vibration_Magnitude", - "sentence": "Change the vibration magnitude of _PARAM2_ & _PARAM3_ on gamepad _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */", - "//Vibration work only on game in browser.", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", - "", - "//Get function parameters", - "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", - "const elapsedTime = gdjs._extensionController.players[playerId].rumble.elapsedTime || 0;", - "const originalDuration = gdjs._extensionController.players[playerId].rumble.duration || 1;", - "const strongRumbleMagnitude = eventsFunctionContext.getArgument(\"StrongMagnitude\");", - "const weakRumbleMagnitude = eventsFunctionContext.getArgument(\"WeakMagnitude\");", - "", - "", - "if (playerId < 0 || playerId > 4) {", - " console.error('Parameter gamepad identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 4.');", - " return;", - "}", - "if (weakRumbleMagnitude < 0 || weakRumbleMagnitude > 1) {", - " console.error('Parameter weakRumble identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 1.');", - " return;", - "}", - "if (strongRumbleMagnitude < 0 || strongRumbleMagnitude > 1) {", - " console.error('Parameter strongRumble identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 1.');", - " return;", - "}", - "", - "const gamepad = gamepads[playerId];", - "", - "//we need keep this condition because when use have not yet plug the controller we can't get the controller in the gamepad variable.", - "if (gamepad == null) return;", - "", - "if (originalDuration - elapsedTime <= 0) return;", - "", - "if (gamepad && gamepad.vibrationActuator) {", - " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", - " startDelay: 0,", - " duration: 1000 * (originalDuration - elapsedTime),", - " weakMagnitude: weakRumbleMagnitude,", - " strongMagnitude: strongRumbleMagnitude", - " });", - "}", - "", - "gdjs._extensionController.players[playerId].rumble.weakMagnitude = weakRumbleMagnitude;", - "gdjs._extensionController.players[playerId].rumble.strongMagnitude = strongRumbleMagnitude;" + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Thumb" ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ + "hidden": true, + "name": "ThumbAnchorOrigin" + }, { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Player_ID", - "type": "expression" + "value": "Center-center", + "type": "Number", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ThumbAnchorTarget" }, { - "description": "Strong rumble magnitude (from 0 to 1)", - "name": "StrongMagnitude", - "type": "expression" + "value": "true", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Thumb" + ], + "hidden": true, + "name": "ThumbIsScaledProportionally" }, { - "description": "Weak rumble magnitude (from 0 to 1)", - "name": "WeakMagnitude", - "type": "expression" + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ParentOrigin" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShouldBeHiddenWhenReleased" } ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onFirstSceneLoaded", - "sentence": "", - "events": [ + "objects": [ { - "type": "BuiltinCommonInstructions::Standard", + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Thumb", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Border", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "MultitouchJoystick", + "type": "SpriteMultitouchJoystick::MultitouchJoystick", + "ControllerIdentifier": 1, + "JoystickIdentifier": "Primary", + "FloatingEnabled": false, + "DeadZoneRadius": 0.4, + "JoystickAngle": 0, + "JoystickForce": 0, + "TouchId": 0, + "TouchIndex": 0 + } + ], + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Thumb" + }, + { + "objectName": "Border" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [] + } + ] + }, + { + "author": "Bouh", + "category": "Input", + "extensionNamespace": "", + "fullName": "Gamepads (controllers)", + "helpPath": "/all-features/gamepad", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWdhbWVwYWQtdmFyaWFudC1vdXRsaW5lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTYsOUg4VjExSDEwVjEzSDhWMTVINlYxM0g0VjExSDZWOU0xOC41LDlBMS41LDEuNSAwIDAsMSAyMCwxMC41QTEuNSwxLjUgMCAwLDEgMTguNSwxMkExLjUsMS41IDAgMCwxIDE3LDEwLjVBMS41LDEuNSAwIDAsMSAxOC41LDlNMTUuNSwxMkExLjUsMS41IDAgMCwxIDE3LDEzLjVBMS41LDEuNSAwIDAsMSAxNS41LDE1QTEuNSwxLjUgMCAwLDEgMTQsMTMuNUExLjUsMS41IDAgMCwxIDE1LjUsMTJNMTcsNUE3LDcgMCAwLDEgMjQsMTJBNyw3IDAgMCwxIDE3LDE5QzE1LjA0LDE5IDEzLjI3LDE4LjIgMTIsMTYuOUMxMC43MywxOC4yIDguOTYsMTkgNywxOUE3LDcgMCAwLDEgMCwxMkE3LDcgMCAwLDEgNyw1SDE3TTcsN0E1LDUgMCAwLDAgMiwxMkE1LDUgMCAwLDAgNywxN0M4LjY0LDE3IDEwLjA5LDE2LjIxIDExLDE1SDEzQzEzLjkxLDE2LjIxIDE1LjM2LDE3IDE3LDE3QTUsNSAwIDAsMCAyMiwxMkE1LDUgMCAwLDAgMTcsN0g3WiIgLz48L3N2Zz4=", + "name": "Gamepads", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/gamepad-variant-outline.svg", + "shortDescription": "Add support for gamepads (or other controllers) to your game, giving access to information such as button presses, axis positions, trigger pressure, etc...", + "version": "0.6.3", + "description": [ + "Add support for gamepads (or other controllers).", + "", + "It gives access to:", + "- button presses", + "- axis positions and force", + "- trigger pressure", + "- configurable deadzone", + "- vibration", + "- automatic mappers for platformer characters and top-down movement", + "", + "The Bomberman-like example handles 4 players with gamepads ([open the project online](https://editor.gdevelop.io/?project=example://goose-bomberman))." + ], + "origin": { + "identifier": "Gamepads", + "name": "gdevelop-extension-store" + }, + "tags": [ + "controllers", + "gamepads", + "joysticks", + "axis", + "xbox", + "ps4", + "platformer", + "platform", + "top-down" + ], + "authorIds": [ + "2OwwM8ToR9dx9RJ2sAKTcrLmCB92", + "taRwmWxwAFYFL9yyBwB3cwBw0BO2", + "mnImQKdn8nQxwzkS5D6a1JB27V23" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [] }, @@ -11643,655 +12373,212 @@ "objectGroups": [] }, { - "description": "Check if any button is released on a gamepad.", - "fullName": "Any gamepad button released", - "functionType": "Condition", - "name": "C_any_button_released", - "sentence": "Any button of gamepad _PARAM1_ is released", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] - }, - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - "\tconsole.error('Parameter gamepad identifier in condition: \"Any gamepad button released\", is not valid number, must be between 0 and 4.');\r", - "\treturn;\r", - "}\r", - "\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "for (let buttonId = 0; buttonId < gamepad.buttons.length; buttonId++) { //For each buttons on current frame.\r", - "\r", - "\tif (buttonId === undefined) {\r", - "\t\teventsFunctionContext.returnValue = false;\r", - "\t\treturn;\r", - "\t}\r", - "\r", - "\t//Get previous value or define value by default for the current button\r", - "\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] || { pressed: false };\r", - "\r", - "\t//Get state of the button at previous frame\r", - "\tconst previousStateButtonIsPressed = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed;\r", - "\r", - "\t//Get the state of the button on the current frame.\r", - "\tconst currentFrameStateButtonIsPressed = gamepad.buttons[buttonId].pressed;\r", - "\r", - "\t//When previousStateButtonIsPressed is true and actual button state is not pressed\r", - "\t//Player have release the button\r", - "\tif (previousStateButtonIsPressed === true && currentFrameStateButtonIsPressed === false) {\r", - "\t\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = true;\r", - "\t\teventsFunctionContext.returnValue = true;\r", - "\t\t//break;\r", - "\t\treturn;\r", - "\t} else {\r", - "\t\t//The player didn't released the button yet, the previous frame state is still true\r", - "\t\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = false;\r", - "\t\teventsFunctionContext.returnValue = false;\r", - "\t}\r", - "\r", - "\tif (currentFrameStateButtonIsPressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", - "}\r", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Return the strength of the weak vibration motor on the gamepad of a player.", - "fullName": "Weak rumble magnitude", - "functionType": "Expression", - "name": "WeakVibrationMagnitude", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].rumble.weakMagnitude;" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Player_ID", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Return the strength of the strong vibration motor on the gamepad of a player.", - "fullName": "Strong rumble magnitude", + "fullName": "Accelerated speed", "functionType": "Expression", - "name": "StrongVibrationMagnitude", + "name": "AcceleratedSpeed", + "private": true, "sentence": "", "events": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].rumble.strongMagnitude;" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "CurrentSpeed" + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Player_ID", - "type": "expression" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ - { - "description": "Control a platformer character with a gamepad.", - "fullName": "Platformer gamepad mapper", - "name": "PlatformerGamepadMapper", - "objectType": "", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "Gamepads::C_Controller_X_is_connected" + "value": "CompareArgumentAsNumber" }, "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "" + "\"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": "Gamepads::PlatformerGamepadMapper::PropertyUseArrows" + "value": "CompareArgumentAsNumber" }, "parameters": [ - "Object", - "Behavior" + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" ] } ], - "actions": [], - "events": [ + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Left\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Right\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Up\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - }, - { - "type": { - "value": "PlatformBehavior::SimulateLadderKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "0" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Down\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "type": { + "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": "Gamepads::PlatformerGamepadMapper::PropertyUseLeftStick" + "value": "CompareArgumentAsNumber" }, "parameters": [ - "Object", - "Behavior" + "\"CurrentSpeed\"", + ">=", + "0" ] } ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Left\"", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Left\"", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Left\"", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - }, - { - "type": { - "value": "PlatformBehavior::SimulateLadderKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Left\"", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "actions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseRightStick" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Right\"", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Right\"", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Right\"", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - }, - { - "type": { - "value": "PlatformBehavior::SimulateLadderKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Right\"", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" ] } ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"A or Cross\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"A\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"B or Circle\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" + "value": "CompareArgumentAsNumber" }, "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"B\"", - "\"Left\"" + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" ] } ], "actions": [ { "type": { - "value": "PlatformBehavior::SimulateJumpKey" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "PlatformerCharacter" + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" ] } ] @@ -12301,187 +12588,118 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + "value": "CompareArgumentAsNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "\"X or Square\"" + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" ] }, { "type": { - "value": "Gamepads::C_Button_pressed" + "value": "CompareArgumentAsNumber" }, "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"X\"", - "\"Left\"" + "\"CurrentSpeed\"", + ">", + "0" ] } ], "actions": [ { "type": { - "value": "PlatformBehavior::SimulateJumpKey" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "PlatformerCharacter" + "AcceleratedSpeed", + "+", + "Acceleration * TimeDelta()" ] } ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"Y or Triangle\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Y\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] + "type": "BuiltinCommonInstructions::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": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"LB or L1\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" + "value": "CompareArgumentAsNumber" }, "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"LB\"", - "\"Left\"" + "\"CurrentSpeed\"", + "<=", + "0" ] } ], "actions": [ { "type": { - "value": "PlatformBehavior::SimulateJumpKey" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "PlatformerCharacter" + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" ] } ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"RB or R1\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"RB\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"TargetedSpeed\"", + "=", + "0" ] - }, + } + ], + "actions": [], + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"LT or L2\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" + "value": "CompareArgumentAsNumber" }, "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"LT\"", - "\"Left\"" + "\"CurrentSpeed\"", + "<", + "0" ] } ], "actions": [ { "type": { - "value": "PlatformBehavior::SimulateJumpKey" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "PlatformerCharacter" + "AcceleratedSpeed", + "=", + "min(0, CurrentSpeed + Acceleration * TimeDelta())" ] } ] @@ -12491,3087 +12709,2062 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"RT or R2\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" + "value": "CompareArgumentAsNumber" }, "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"RT\"", - "\"Left\"" + "\"CurrentSpeed\"", + ">", + "0" ] } ], "actions": [ { "type": { - "value": "PlatformBehavior::SimulateJumpKey" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "PlatformerCharacter" + "AcceleratedSpeed", + "=", + "max(0, CurrentSpeed - Acceleration * TimeDelta())" ] } ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::PlatformerGamepadMapper", - "type": "behavior" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "clamp(AcceleratedSpeed, -SpeedMax, SpeedMax)" + ] + } + ] } ], - "objectGroups": [] + "variables": [ + { + "name": "AcceleratedSpeed", + "type": "number", + "value": 0 + } + ] } ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "Platformer character behavior", - "description": "", - "group": "", - "extraInformation": [ - "PlatformBehavior::PlatformerObjectBehavior" - ], - "name": "PlatformerCharacter" + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Current speed", + "name": "CurrentSpeed", + "type": "expression" }, { - "value": "1", - "type": "Number", - "label": "Gamepad identifier (1, 2, 3 or 4)", - "description": "", - "group": "", - "extraInformation": [], - "name": "GamepadIdentifier" + "description": "Targeted speed", + "name": "TargetedSpeed", + "type": "expression" }, { - "value": "true", - "type": "Boolean", - "label": "Use directional pad", - "description": "", - "group": "Controls", - "extraInformation": [], - "name": "UseArrows" + "description": "Max speed", + "name": "SpeedMax", + "type": "expression" }, { - "value": "true", - "type": "Boolean", - "label": "Use left stick", - "description": "", - "group": "Controls", - "extraInformation": [], - "name": "UseLeftStick" + "description": "Acceleration", + "name": "Acceleration", + "type": "expression" }, { - "value": "", - "type": "Boolean", - "label": "Use right stick", - "description": "", - "group": "Controls", - "extraInformation": [], - "name": "UseRightStick" + "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": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const trigger = eventsFunctionContext.getArgument(\"trigger\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in expression: \"Pressure on a gamepad trigger\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (trigger != \"LT\" && trigger != \"RT\" && trigger != \"L2\" && trigger != \"R2\") {\r", + " console.error('Parameter trigger is not valid in expression: \"Pressure on a gamepad trigger\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "switch (trigger) {\r", + " case 'LT':\r", + " case 'L2':\r", + " eventsFunctionContext.returnValue = gamepad.buttons[6].value;\r", + " break;\r", + "\r", + " case 'RT':\r", + " case 'R2':\r", + " eventsFunctionContext.returnValue = gamepad.buttons[7].value;\r", + " break;\r", + "\r", + " default:\r", + " eventsFunctionContext.returnValue = -1;\r", + " break;\r", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" }, { - "value": "A or Cross", - "type": "Choice", - "label": "Jump button", - "description": "", - "group": "Controls", - "extraInformation": [ - "A or Cross", - "B or Circle", - "X or Square", - "Y or Triangle", - "LB or L1", - "RB or R1", - "LT or L2", - "RT or R2" + "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": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick force\"');\r", + " return;\r", + "}\r", + "\r", + "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a stick force\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId)), 0, 1);\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId)), 0, 1);\r", + " break;\r", + "\r", + " default:\r", + " eventsFunctionContext.returnValue = -1;\r", + " break;\r", + "}" ], - "name": "JumpButton" + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true } ], - "sharedPropertyDescriptors": [] + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] }, { - "description": "Control a top-down character with a gamepad.", - "fullName": "Top-down gamepad mapper", - "name": "TopDownGamepadMapper", - "objectType": "", - "eventsFunctions": [ + "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": [ { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Controller_X_is_connected" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseArrows" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Left\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Right\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Up\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Down\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseLeftStick" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"Analog\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")", - "Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"360°\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")", - "sign(Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Left\"))" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"8 Directions\"" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Left\"", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Left\"", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Left\"", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Left\"", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseRightStick" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"Analog\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Right\")", - "Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Right\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"360°\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "sign(Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Right\"))", - "1" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"8 Directions\"" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Right\"", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Right\"", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Right\"", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Right\"", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - } - ] - } - ] - } + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Gamepads::StickAngle(player_ID, stick)" ] } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Gamepads::TopDownGamepadMapper", - "type": "behavior" - } - ], - "objectGroups": [] + ] } ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "Top-down movement behavior", - "description": "", - "group": "", - "extraInformation": [ - "TopDownMovementBehavior::TopDownMovementBehavior" - ], - "name": "TopDownMovement" - }, - { - "value": "1", - "type": "Number", - "label": "Gamepad identifier (1, 2, 3 or 4)", - "description": "", - "group": "", - "extraInformation": [], - "name": "GamepadIdentifier" - }, - { - "value": "true", - "type": "Boolean", - "label": "Use directional pad", - "description": "", - "group": "Controls", - "extraInformation": [], - "name": "UseArrows" - }, - { - "value": "true", - "type": "Boolean", - "label": "Use left stick", - "description": "", - "group": "Controls", - "extraInformation": [], - "name": "UseLeftStick" - }, + "expressionType": { + "type": "expression" + }, + "parameters": [ { - "value": "", - "type": "Boolean", - "label": "Use right stick", - "description": "", - "group": "Controls", - "extraInformation": [], - "name": "UseRightStick" + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" }, { - "value": "Analog", - "type": "Choice", - "label": "Stick mode", - "description": "", - "group": "Controls", - "extraInformation": [ - "Analog", - "360°", - "8 Directions" - ], - "name": "StickMode" + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" } ], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "Camera", - "extensionNamespace": "", - "fullName": "Copy camera settings", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWxheWVycy10cmlwbGUtb3V0bGluZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMiAxNi41NEwxOS4zNyAxMC44TDIxIDEyLjA3TDEyIDE5LjA3TDMgMTIuMDdMNC42MiAxMC44MUwxMiAxNi41NE0xMiAxNEwzIDdMMTIgMEwyMSA3TDEyIDE0TTEyIDIuNTNMNi4yNiA3TDEyIDExLjQ3TDE3Ljc0IDdMMTIgMi41M00xMiAyMS40N0wxOS4zNyAxNS43M0wyMSAxN0wxMiAyNEwzIDE3TDQuNjIgMTUuNzRMMTIgMjEuNDciIC8+PC9zdmc+", - "name": "CopyCameraSettings", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/layers-triple-outline.svg", - "shortDescription": "Copy the camera settings of a layer and apply them to another layer.", - "version": "1.0.0", - "description": [ - "Useful when multiple layers need to use the same camera values.", - "", - "How to use:", - "- Run the \"Copy camera settings\" action after all other camera actions have been performed", - "", - "Tips:", - "- Do not use on layers that implement a parallax effect" - ], - "origin": { - "identifier": "CopyCameraSettings", - "name": "gdevelop-extension-store" - }, - "tags": [ - "camera", - "clone", - "zoom", - "position", - "layer", - "angle", - "copy" - ], - "authorIds": [ - "gqDaZjCfevOOxBYkK6zlhtZnXCg1" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ + "objectGroups": [] + }, { - "description": "Copy camera settings of a layer and apply them to another layer.", - "fullName": "Copy camera settings", - "functionType": "Action", - "name": "CopyCameraSettings", - "sentence": "Copy camera settings of _PARAM1_ layer and apply them to _PARAM3_ layer (X position: _PARAM5_, Y position: _PARAM6_, Zoom: _PARAM7_, Angle: _PARAM8_)", + "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::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"CloneX\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetCameraX" - }, - "parameters": [ - "", - "=", - "CameraX(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", - "GetArgumentAsString(\"DestinationLayer\")", - "GetArgumentAsNumber(\"DestinationCamera\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"CloneY\"" - ] - } + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick rotation\"');\r", + " return;\r", + "}\r", + "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a stick rotation\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId));\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId));\r", + " break;\r", + "\r", + " default:\r", + " eventsFunctionContext.returnValue = -1;\r", + " break;\r", + "}" ], - "actions": [ - { - "type": { - "value": "SetCameraY" - }, - "parameters": [ - "", - "=", - "CameraY(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", - "GetArgumentAsString(\"DestinationLayer\")", - "GetArgumentAsNumber(\"DestinationCamera\")" - ] - } - ] - }, + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"CloneZoom\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ZoomCamera" - }, - "parameters": [ - "", - "CameraZoom(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", - "GetArgumentAsString(\"DestinationLayer\")", - "GetArgumentAsNumber(\"DestinationCamera\")" - ] - } - ] + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"CloneAngle\"" - ] - } + "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": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (stick != \"LEFT\" && stick != \"RIGHT\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (direction != \"UP\" && direction != \"DOWN\" && direction != \"LEFT\" && direction != \"RIGHT\" && direction != \"HORIZONTAL\" && direction != \"VERTICAL\") {\r", + " console.error('Parameter direction is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let parameterError = false;\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", + " }\r", + " break;\r", + "\r", + " case \"HORIZONTAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", + " break;\r", + "\r", + " case \"VERTICAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", + " break;\r", + "\r", + " default:\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", + " }\r", + " break;\r", + "\r", + " case \"HORIZONTAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", + " break;\r", + "\r", + " case \"VERTICAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", + " break;\r", + "\r", + " default:\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " break;\r", + "}\r", + "" ], - "actions": [ - { - "type": { - "value": "SetCameraAngle" - }, - "parameters": [ - "", - "=", - "CameraAngle(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", - "GetArgumentAsString(\"DestinationLayer\")", - "GetArgumentAsNumber(\"DestinationCamera\")" - ] - } - ] + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { - "description": "Source layer", - "name": "SourceLayer", - "type": "layer" - }, - { - "description": "Source camera", - "name": "SourceCamera", + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", "type": "expression" }, { - "description": "Destination layer", - "name": "DestinationLayer", - "type": "layer" + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" }, { - "description": "Destination camera", - "name": "DestinationCamera", + "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": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (stick != \"left\" && stick != \"right\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "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" }, { - "defaultValue": "yes", - "description": "Clone X position", - "name": "CloneX", - "optional": true, - "type": "yesorno" - }, + "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": [ { - "defaultValue": "yes", - "description": "Clone Y position", - "name": "CloneY", - "optional": true, - "type": "yesorno" - }, + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (stick != \"left\" && stick != \"right\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "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": [ { - "defaultValue": "yes", - "description": "Clone zoom", - "name": "CloneZoom", - "optional": true, - "type": "yesorno" + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Gamepad", + "type": "expression" }, { - "defaultValue": "yes", - "description": "Clone angle", - "name": "CloneAngle", - "optional": true, - "type": "yesorno" + "description": "Stick: \"Left\" or \"Right\"", + "name": "Stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" } ], "objectGroups": [] - } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [] - }, - { - "author": "@4ian, Tristan Rhodes (https://victrisgames.itch.io/)", - "category": "Movement", - "extensionNamespace": "", - "fullName": "Ellipse movement", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXNpbmUtd2F2ZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNi41LDIxQzEzLjUsMjEgMTIuMzEsMTYuNzYgMTEuMDUsMTIuMjhDMTAuMTQsOS4wNCA5LDUgNy41LDVDNC4xMSw1IDQsMTEuOTMgNCwxMkgyQzIsMTEuNjMgMi4wNiwzIDcuNSwzQzEwLjUsMyAxMS43MSw3LjI1IDEyLjk3LDExLjc0QzEzLjgzLDE0LjggMTUsMTkgMTYuNSwxOUMxOS45NCwxOSAyMC4wMywxMi4wNyAyMC4wMywxMkgyMi4wM0MyMi4wMywxMi4zNyAyMS45NywyMSAxNi41LDIxWiIgLz48L3N2Zz4=", - "name": "EllipseMovement", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/sine-wave.svg", - "shortDescription": "Move objects on ellipses or smoothly back and forth in one direction.", - "version": "1.0.2", - "description": [ - "It allows objects to move:", - "- on an ellipsis or arcs", - "- smoothly vertically or horizontally (by setting one radius to 0)", - "- on a sine wave (by adding a force)", - "", - "It can be used for:", - "- Making objects float, such as powerups or coins", - "- Moving platforms", - "- Enemy movement patterns", - "- Making a player constantly turn right or left ([open the project online](https://editor.gdevelop.io/?project=example://star-seeker))" - ], - "origin": { - "identifier": "EllipseMovement", - "name": "gdevelop-extension-store" - }, - "tags": [ - "sine", - "ellipse", - "movement", - "circular", - "circle", - "floating", - "platform", - "enemy" - ], - "authorIds": [ - "wWP8BSlAW0UP4NeaHa2LcmmDzmH2", - "gqDaZjCfevOOxBYkK6zlhtZnXCg1", - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [], - "eventsBasedBehaviors": [ + }, { - "description": "Move objects on ellipses or smoothly back and forth in one direction.", - "fullName": "Ellipse movement", - "name": "EllipseMovement", - "objectType": "", - "eventsFunctions": [ + "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": [ { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyOldX" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.X()" - ] - }, - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyOldY" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Y()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Evaluate the center of movement from the object position and properties." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::PropertyInitialTurningLeft" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" - }, - "parameters": [ - "Object", - "Behavior", - "*", - "-1" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" - }, - "parameters": [ - "Object", - "Behavior", - "<", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyInitialDirectionAngle() + 90" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" - }, - "parameters": [ - "Object", - "Behavior", - ">=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyInitialDirectionAngle() - 90" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyCenterX" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.X() - Object.Behavior::DeltaX()" - ] - }, - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyCenterY" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Y() - Object.Behavior::DeltaY()" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - } + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Gamepad button released\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (button === \"\") {\r", + " console.error('Parameter button is not valid in condition: \"Gamepad button released\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let buttonId;\r", + "\r", + "switch (button) {\r", + " case 'A':\r", + " case 'CROSS':\r", + " buttonId = 0;\r", + " break;\r", + " case 'B':\r", + " case 'CIRCLE':\r", + " buttonId = 1;\r", + " break;\r", + " case 'X':\r", + " case 'SQUARE':\r", + " buttonId = 2;\r", + " break;\r", + " case 'Y':\r", + " case 'TRIANGLE':\r", + " buttonId = 3;\r", + " break;\r", + " case 'LB':\r", + " case 'L1':\r", + " buttonId = 4;\r", + " break;\r", + " case 'RB':\r", + " case 'R1':\r", + " buttonId = 5;\r", + " break;\r", + " case 'LT':\r", + " case 'L2':\r", + " buttonId = 6;\r", + " break;\r", + " case 'RT':\r", + " case 'R2':\r", + " buttonId = 7;\r", + " break;\r", + "\r", + " case 'UP':\r", + " buttonId = 12;\r", + " break;\r", + " case 'DOWN':\r", + " buttonId = 13;\r", + " break;\r", + " case 'LEFT':\r", + " buttonId = 14;\r", + " break;\r", + " case 'RIGHT':\r", + " buttonId = 15;\r", + " break;\r", + "\r", + " case 'BACK':\r", + " case 'SHARE':\r", + " buttonId = 8;\r", + " break;\r", + " case 'START':\r", + " case 'OPTIONS':\r", + " buttonId = 9;\r", + " break;\r", + "\r", + " case 'CLICK_STICK_LEFT':\r", + " buttonId = 10;\r", + " break;\r", + " case 'CLICK_STICK_RIGHT':\r", + " buttonId = 11;\r", + " break;\r", + "\r", + " //PS4\r", + " case 'PS_BUTTON':\r", + " buttonId = 16;\r", + " break;\r", + " case 'CLICK_TOUCHPAD':\r", + " buttonId = 17;\r", + " break;\r", + "\r", + " default:\r", + " console.error('The button: ' + button + ' in condition: \"Gamepad button released\" is not valid.');\r", + " break;\r", + "}\r", + "\r", + "if (buttonId === undefined) {\r", + " console.error('There is no buttons valid in condition: \"Gamepad button released\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", + " console.error('Buttons on the gamepad are not accessible in condition: \"Gamepad button released\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "//Define default value on pressed button or use previous value\r", + "gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] || { pressed: false };\r", + "\r", + "//Get state of button at previous frame\r", + "const previousStateButton = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed;\r", + "\r", + "//When previousStateButton is true and actual button state is not pressed\r", + "//Player have release the button\r", + "if (previousStateButton === true && gamepad.buttons[buttonId].pressed === false) {\r", + " // Save the last button used for the player \r", + " gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + " gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = true;\r", + " eventsFunctionContext.returnValue = true;\r", + "\r", + "} else {\r", + " gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = false;\r", + " eventsFunctionContext.returnValue = false;\r", + "}\r", + "" ], - "objectGroups": [] - }, + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Update the center when the object is moved outside of the behavior." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyCenterX" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "Object.X() - Object.Behavior::PropertyOldX()" - ] - }, - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyCenterY" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "Object.Y() - Object.Behavior::PropertyOldY()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Place the object according to the movement angle." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::PropertyRadiusX" - }, - "parameters": [ - "Object", - "Behavior", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Object", - "=", - "Object.Behavior::PropertyCenterX() + Object.Behavior::DeltaX()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::PropertyRadiusY" - }, - "parameters": [ - "Object", - "Behavior", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Object", - "=", - "Object.Behavior::PropertyCenterY() + Object.Behavior::DeltaY()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::PropertyShouldRotate" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "Object", - "=", - "Object.Behavior::DirectionAngle() + Object.Behavior::PropertyRotationOffset()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Save the position to detect when the object is moved outside of the behavior." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyOldX" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.X()" - ] - }, - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyOldY" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Y()" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - } - ], - "objectGroups": [] + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" }, { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Update the movement angle for the next frame." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "360 * TimeDelta() / Object.Behavior::PropertyLoopDuration()" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - } - ], - "objectGroups": [] - }, + "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": [ { - "description": "Change the turning direction (left or right).", - "fullName": "Turn the other way", - "functionType": "Action", - "name": "ToggleTurningLeft", - "sentence": "_PARAM0_ turn the other way", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyCenterX" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "2 * Object.X() - Object.Behavior::CenterX()" - ] - }, - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyCenterY" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "2 * Object.Y() - Object.Behavior::CenterY()" - ] - }, - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "180" - ] - }, - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" - }, - "parameters": [ - "Object", - "Behavior", - "*", - "-1" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - } + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "//Player id is not valid\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in expression: \"Last pressed button (id)\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "\r", + "//Return the last button used by the player\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].lastButtonUsed;" ], - "objectGroups": [] - }, + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ { - "description": "Change the in which side the object is turning (left or right).", - "fullName": "Turn left or right", - "functionType": "Action", - "name": "SetTurningLeft", - "sentence": "_PARAM0_ turn left: _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BuiltinCommonInstructions::And" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::IsTurningLeft" - }, - "parameters": [ - "Object", - "Behavior", - "yes", - "" - ] - }, - { - "type": { - "inverted": true, - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"TurnLeft\"" - ] - } - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::And" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "inverted": true, - "value": "EllipseMovement::EllipseMovement::IsTurningLeft" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"TurnLeft\"" - ] - } - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::ToggleTurningLeft" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - }, - { - "description": "Turn left", - "name": "TurnLeft", - "type": "yesorno" - } - ], - "objectGroups": [] - }, + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if any button is pressed on a gamepad.", + "fullName": "Any gamepad button pressed", + "functionType": "Condition", + "name": "C_Any_Button_pressed", + "sentence": "Any button of gamepad _PARAM1_ is pressed", + "events": [ { - "description": "Check if the object is turning left.", - "fullName": "Is turning left", - "functionType": "Condition", - "name": "IsTurningLeft", - "sentence": "_PARAM0_ is turning left", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" - }, - "parameters": [ - "Object", - "Behavior", - "<", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - } + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Any gamepad button pressed\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let buttonId;\r", + "for (let i = 0; i < gamepad.buttons.length; i++) { //For each buttons\r", + " if (gamepad.buttons[i].pressed) { //One of them is pressed\r", + " buttonId = i; //Save the button pressed\r", + " break;\r", + " }\r", + "}\r", + "\r", + "if (buttonId === undefined) {\r", + " // No buttons are pressed.\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", + " console.error('Buttons on the gamepad are not accessible in condition: \"Any gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "//When a button is pressed, save the button in lastButtonUsed for each players\r", + "if (gamepad.buttons[buttonId].pressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + "eventsFunctionContext.returnValue = gamepad.buttons[buttonId].pressed;\r", + "\r", + "\r", + "" ], - "objectGroups": [] - }, + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ { - "description": "Return the movement angle of the object.", - "fullName": "Movement angle", - "functionType": "Expression", - "name": "MovementAngle", - "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyMovementAngle()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - } - ], - "objectGroups": [] - }, + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the last button pressed. \nButtons for Xbox and PS4 can be:\n* Xbox: \"A\", \"B\", \"X\", \"Y\", \"LB\", \"RB\", \"LT\", \"RT\", \"BACK\", \"START\",\n* PS4: \"CROSS\", \"SQUARE\", \"CIRCLE\", \"TRIANGLE\", \"L1\", \"L2\", \"R1\", \"R2\", \"SHARE\", \"OPTIONS\", \"PS_BUTTON\", \"CLICK_TOUCHPAD\",\n* Both: \"UP\", \"DOWN\", \"LEFT\", \"RIGHT\", \"CLICK_STICK_LEFT\", \"CLICK_STICK_RIGHT\".", + "fullName": "Last pressed button (string)", + "functionType": "StringExpression", + "name": "LastButtonString", + "sentence": "Button _PARAM2_ of gamepad _PARAM1_ is pressed", + "events": [ { - "description": "Return the loop duration (in seconds).", - "fullName": "Loop duration", - "functionType": "Expression", - "group": "Configuration", - "name": "LoopDuration", - "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "abs(Object.Behavior::PropertyLoopDuration())" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - } + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in string expression: \"Last pressed button (LastButtonString)\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (controllerType === \"\") {\r", + " console.error('Parameter controller type is not valid in string expression: \"Last pressed button (LastButtonString)\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "if (gamepad !== null) { //Gamepad exist\r", + " //Get last btn id\r", + " const lastButtonUsedID = gdjs._extensionController.players[playerId].lastButtonUsed;\r", + "\r", + " //Return last button as string \r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getInputString(controllerType, lastButtonUsedID);\r", + "\r", + "} else { //Gamepad dosen't exist\r", + " console.error('Your controller is not supported or the gamepad wasn\\'t detected in string expression: \"Last pressed button (LastButtonString)\"');\r", + " eventsFunctionContext.returnValue = \"Gamepad not connected\";\r", + "}" ], - "objectGroups": [] - }, + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ { - "description": "Return the ellipse radius on X axis.", - "fullName": "Radius X", - "functionType": "Expression", - "group": "Configuration", - "name": "RadiusX", - "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyRadiusX()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - } - ], - "objectGroups": [] + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" }, { - "description": "Return the ellipse radius on X axis.", - "fullName": "Radius Y", - "functionType": "Expression", - "group": "Configuration", - "name": "RadiusY", - "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyRadiusY()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - } - ], - "objectGroups": [] - }, + "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": [ { - "description": "Return the movement center position on X axis.", - "fullName": "Movement center X", - "functionType": "Expression", - "group": "Configuration", - "name": "CenterX", - "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyCenterX()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - } + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get the last activated controller\r", + "const controllerId = gdjs._extensionController.lastActiveController;\r", + "\r", + "// Check if controller is active\r", + "const gamepad = gamepads[controllerId];\r", + "if (gamepad == null) {\r", + " eventsFunctionContext.returnValue = 0;\r", + "} else {\r", + " // Return active controller id\r", + " eventsFunctionContext.returnValue = controllerId + 1;\r", + "}\r", + "" ], - "objectGroups": [] - }, + "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": [ { - "description": "Return the movement center position on Y axis.", - "fullName": "Movement center Y", - "functionType": "Expression", - "group": "Configuration", - "name": "CenterY", - "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyCenterY()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - } + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Gamepad button pressed\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (button === \"\") {\r", + " console.error('Parameter button is not valid in condition: \"Gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let buttonId;\r", + "\r", + "switch (button) {\r", + " case 'A':\r", + " case 'CROSS':\r", + " buttonId = 0;\r", + " break;\r", + " case 'B':\r", + " case 'CIRCLE':\r", + " buttonId = 1;\r", + " break;\r", + " case 'X':\r", + " case 'SQUARE':\r", + " buttonId = 2;\r", + " break;\r", + " case 'Y':\r", + " case 'TRIANGLE':\r", + " buttonId = 3;\r", + " break;\r", + " case 'LB':\r", + " case 'L1':\r", + " buttonId = 4;\r", + " break;\r", + " case 'RB':\r", + " case 'R1':\r", + " buttonId = 5;\r", + " break;\r", + " case 'LT':\r", + " case 'L2':\r", + " buttonId = 6;\r", + " break;\r", + " case 'RT':\r", + " case 'R2':\r", + " buttonId = 7;\r", + " break;\r", + "\r", + " case 'UP':\r", + " buttonId = 12;\r", + " break;\r", + " case 'DOWN':\r", + " buttonId = 13;\r", + " break;\r", + " case 'LEFT':\r", + " buttonId = 14;\r", + " break;\r", + " case 'RIGHT':\r", + " buttonId = 15;\r", + " break;\r", + "\r", + " case 'BACK':\r", + " case 'SHARE':\r", + " buttonId = 8;\r", + " break;\r", + " case 'START':\r", + " case 'OPTIONS':\r", + " buttonId = 9;\r", + " break;\r", + "\r", + " case 'CLICK_STICK_LEFT':\r", + " buttonId = 10;\r", + " break;\r", + " case 'CLICK_STICK_RIGHT':\r", + " buttonId = 11;\r", + " break;\r", + "\r", + " //PS4\r", + " case 'PS_BUTTON':\r", + " buttonId = 16;\r", + " break;\r", + " case 'CLICK_TOUCHPAD':\r", + " buttonId = 17;\r", + " break;\r", + "\r", + " default:\r", + " console.error('The button: ' + button + ' in condition: \"Gamepad button pressed\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + "}\r", + "\r", + "\r", + "\r", + "if (buttonId === undefined) {\r", + " console.error('There is no buttons valid in condition: \"Gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", + " console.error('Buttons on the gamepad are not accessible in condition: \"Gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "//When a button is pressed, save the button in lastButtonUsed for each players\r", + "if (gamepad.buttons[buttonId].pressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + "eventsFunctionContext.returnValue = gamepad.buttons[buttonId].pressed;\r", + "\r", + "\r", + "\r", + "" ], - "objectGroups": [] - }, + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ { - "description": "Change the radius on X axis of the movement.", - "fullName": "Radius X", - "functionType": "Action", - "group": "Elliptical movement configuration", - "name": "SetRadiusX", - "sentence": "Change the radius on X axis of the movement of _PARAM0_ to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyRadiusX" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - }, - { - "description": "Radius X", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" }, { - "description": "Change the radius on Y axis of the movement.", - "fullName": "Radius Y", - "functionType": "Action", - "group": "Elliptical movement configuration", - "name": "SetRadiusY", - "sentence": "Change the radius on Y axis of the movement of _PARAM0_ to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyRadiusY" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - }, - { - "description": "Radius Y", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, + "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": [ { - "description": "Change the loop duration.", - "fullName": "Loop duration", - "functionType": "Action", - "group": "Elliptical movement configuration", - "name": "SetLoopDuration", - "sentence": "Change the loop duration of _PARAM0_ to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::IsTurningLeft" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "-GetArgumentAsNumber(\"Value\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "EllipseMovement::EllipseMovement::IsTurningLeft" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - }, - { - "description": "Speed (in degrees per second)", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] }, { - "description": "Change the movement angle. The object is teleported according to the angle.", - "fullName": "Teleport at an angle", - "functionType": "Action", - "name": "SetMovementAngle", - "sentence": "Teleport _PARAM0_ on the ellipse at _PARAM2_°", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - }, - { - "description": "Movement angle", - "name": "Value", - "type": "expression" - } + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in expression: \"Gamepad deadzone for sticks\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "///Return the deadzone value for a given player\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].deadzone;" ], - "objectGroups": [] - }, + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ { - "fullName": "Delta X", - "functionType": "Expression", - "name": "DeltaX", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "cos(ToRad(Object.Behavior::PropertyMovementAngle())) * Object.Behavior::PropertyRadiusX()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - } + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set the deadzone for sticks of the gamepad. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved). Deadzone is between 0 and 1, and is by default 0.2.", + "fullName": "Set gamepad deadzone for sticks", + "functionType": "Action", + "name": "A_Set_deadzone", + "sentence": "Set deadzone for sticks on gamepad: _PARAM1_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const newDeadzone = eventsFunctionContext.getArgument(\"deadzone\");\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in action: \"Set gamepad deadzone for sticks\", is not valid, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "\r", + "// clamp the newDeadzone in range [0, 1].\r", + "// https://github.com/4ian/GDevelop-extensions/pull/33#issuecomment-618224857\r", + "gdjs._extensionController.players[playerId].deadzone = gdjs.evtTools.common.clamp(newDeadzone, 0, 1);\r", + "" ], - "objectGroups": [] + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" }, { - "fullName": "Delta Y", - "functionType": "Expression", - "name": "DeltaY", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "sin(ToRad(Object.Behavior::PropertyMovementAngle())) * Object.Behavior::PropertyRadiusY()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - } - ], - "objectGroups": [] - }, + "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": [ { - "fullName": "Direction angle", - "functionType": "Expression", - "name": "DirectionAngle", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" - }, - "parameters": [ - "Object", - "Behavior", - "<", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyMovementAngle() + 90" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" - }, - "parameters": [ - "Object", - "Behavior", - ">=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyMovementAngle() - 90" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "EllipseMovement::EllipseMovement", - "type": "behavior" - } + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Gamepad stick pushed (axis)\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (stick != \"LEFT\" && stick != \"RIGHT\") {\r", + " console.error('Parameter stick in condition: \"Gamepad stick pushed (axis)\", is not valid, must be LEFT or RIGHT');\r", + " return;\r", + "}\r", + "if (direction != \"UP\" && direction != \"DOWN\" && direction != \"LEFT\" && direction != \"RIGHT\" && direction != \"ANY\") {\r", + " console.error('Parameter deadzone in condition: \"Gamepad stick pushed (axis)\", is not valid, must be UP, DOWN, LEFT or RIGHT');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) {\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "\r", + "//Define in onFirstSceneLoaded function\r", + "const getNormalizedAxisValue = gdjs._extensionController.getNormalizedAxisValue;\r", + "\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'ANY':\r", + " if ( getNormalizedAxisValue(gamepad.axes[0], playerId) < 0\r", + " || getNormalizedAxisValue(gamepad.axes[0], playerId) > 0\r", + " || getNormalizedAxisValue(gamepad.axes[1], playerId) < 0 \r", + " || getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " console.error('The value Direction on stick Left on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'ANY':\r", + " if ( getNormalizedAxisValue(gamepad.axes[2], playerId) < 0\r", + " || getNormalizedAxisValue(gamepad.axes[2], playerId) > 0\r", + " || getNormalizedAxisValue(gamepad.axes[3], playerId) < 0 \r", + " || getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " console.error('The value Direction on stick Right on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " console.error('The value Stick on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + "}\r", + "\r", + "eventsFunctionContext.returnValue = false;\r", + "" ], - "objectGroups": [] + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true } ], - "propertyDescriptors": [ - { - "value": "100", - "type": "Number", - "unit": "Pixel", - "label": "Radius of the movement on X axis", - "description": "", - "group": "Ellipse", - "extraInformation": [], - "name": "RadiusX" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Radius of the movement on Y axis", - "description": "", - "group": "Ellipse", - "extraInformation": [], - "name": "RadiusY" - }, + "parameters": [ { - "value": "6", - "type": "Number", - "unit": "Second", - "label": "Loop duration", - "description": "", - "group": "Speed", - "extraInformation": [], - "name": "LoopDuration" + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" }, { - "value": "", - "type": "Boolean", - "label": "Turn left", - "description": "", - "group": "Speed", - "extraInformation": [], - "name": "InitialTurningLeft" + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" }, { - "value": "0", - "type": "Number", - "unit": "DegreeAngle", - "label": "Initial direction", - "description": "", - "group": "Speed", - "extraInformation": [], - "name": "InitialDirectionAngle" - }, + "description": "Direction", + "name": "direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"Any\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the number of connected gamepads.", + "fullName": "Connected gamepads number", + "functionType": "Expression", + "name": "ConnectedGamepadsCount", + "sentence": "", + "events": [ { - "value": "", - "type": "Boolean", - "label": "Rotate", - "description": "", - "group": "Rotation", - "extraInformation": [], - "name": "ShouldRotate" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] }, { - "value": "0", - "type": "Number", - "unit": "DegreeAngle", - "label": "Rotation offset", - "description": "", - "group": "Rotation", - "extraInformation": [], - "name": "RotationOffset" - }, + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "// Gamepads can be disconnected and become null, so we have to filter them.\r", + "eventsFunctionContext.returnValue = Object.keys(gamepads).filter(key => !!gamepads[key]).length;\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Return a string containing informations about the specified gamepad.", + "fullName": "Gamepad type", + "functionType": "StringExpression", + "name": "GamepadType", + "sentence": "Player _PARAM1_ use _PARAM2_ controller", + "events": [ { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "CenterX" - }, + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameter", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in string expression: \"Gamepad type\", is not valid number, must be between 0 and 4');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "eventsFunctionContext.returnValue = (gamepad && gamepad.id) ? gamepad.id : \"No information for player \" + (playerId + 1)", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "CenterY" - }, + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the specified gamepad has the specified information in its description. Useful to know if the gamepad is a Xbox or PS4 controller.", + "fullName": "Gamepad type", + "functionType": "Condition", + "name": "C_Controller_type", + "sentence": "Gamepad _PARAM1_ is a _PARAM2_ controller", + "events": [ { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "MovementAngle" - }, + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", + "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in condition: \"Gamepad type\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "if (controllerType === \"\") {", + " console.error('Parameter type in condition: \"Gamepad type\", is not a string.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "", + "if (controllerType == \"XBOX\") {", + " eventsFunctionContext.returnValue = gdjs._extensionController.isXbox(gamepad);", + "} else {", + " eventsFunctionContext.returnValue = gamepad ? gamepad.id.toUpperCase().indexOf(controllerType) !== -1 : false;", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "OldX" + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" }, { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "OldY" + "description": "Type: \"Xbox\", \"PS4\", \"Steam\" or \"PS3\" (among other)", + "name": "controller_type", + "type": "string" } ], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "Camera", - "extensionNamespace": "", - "fullName": "Smooth Camera", - "helpPath": "/tutorials/follow-player-with-camera/", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwO30NCjwvc3R5bGU+DQo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjQsMTNoLTZjLTEuMSwwLTItMC45LTItMlY1YzAtMS4xLDAuOS0yLDItMmg2YzEuMSwwLDIsMC45LDIsMnY2QzI2LDEyLjEsMjUuMSwxMywyNCwxM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yNiw4djEwYzAsMS4xLTAuOSwyLTIsMkg4Yy0xLjEsMC0yLTAuOS0yLTJWOGMwLTEuMSwwLjktMiwyLTJoOCIvPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMjEiIGN5PSI4IiByPSIyIi8+DQo8Y2lyY2xlIGNsYXNzPSJzdDAiIGN4PSIxMSIgY3k9IjE2IiByPSIxIi8+DQo8cmVjdCB4PSI5IiB5PSI5IiBjbGFzcz0ic3QwIiB3aWR0aD0iNCIgaGVpZ2h0PSIzIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIyMSwyOSAyMSwyOSAxMSwyOSAxMSwyOSAiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjE4LDIwIDE4LDI5IDE0LDI5IDE0LDIwICIvPg0KPHJlY3QgeD0iNyIgeT0iMyIgY2xhc3M9InN0MCIgd2lkdGg9IjQiIGhlaWdodD0iMyIvPg0KPC9zdmc+DQo=", - "name": "SmoothCamera", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Computers and Hardware/Computers and Hardware_camcoder_gopro_go_pro_camera.svg", - "shortDescription": "Smoothly scroll to follow an object.", - "version": "0.3.1", - "description": [ - "The camera follows an object according to:", - "- a frame rate independent catch-up speed to make the scrolling from smooth to strong", - "- a maximum speed to do linear following ([open the project online](https://editor.gdevelop.io/?project=example://platformer-with-tilemap)) or slow down the camera when teleporting the object", - "- a follow-free zone to avoid scrolling on small movements", - "- an offset to see further in one direction", - "- an extra delay and catch-up speed to give an impression of speed (useful for dash)", - "- position forecasting and delay to simulate a cameraman response time", - "", - "A platformer dedicated behavior allows to switch of settings when the character is in air or on the floor. This can be used to stabilize the camera when jumping." - ], - "origin": { - "identifier": "SmoothCamera", - "name": "gdevelop-extension-store" - }, - "tags": [ - "camera", - "scrolling", - "follow", - "smooth", - "platformer", - "platform" - ], - "authorIds": [ - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + "objectGroups": [] + }, + { + "description": "Check if a gamepad is connected.", + "fullName": "Gamepad connected", + "functionType": "Condition", + "name": "C_Controller_X_is_connected", + "sentence": "Gamepad _PARAM1_ is plugged and connected", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameter", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in condition: \"Gamepad connected\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "", + "// If gamepad was disconnected it will be null (so this will return false)", + "// If gamepad was never connected it will be undefined (so this will return false)", + "eventsFunctionContext.returnValue = !!gamepads[playerId];" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Generate a vibration on the specified controller. Might only work if the game is running in a recent web browser.", + "fullName": "Gamepad vibration", + "functionType": "Action", + "name": "A_Vibrate_controller", + "sentence": "Make gamepad _PARAM1_ vibrate for _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "//Vibration work only on game in browser.", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", + "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in action: \"Gamepad connected\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "if (gamepad && gamepad.vibrationActuator) {", + " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", + " startDelay: 0,", + " duration: duration * 1000,", + " weakMagnitude: 1.0,", + " strongMagnitude: 1.0", + " });", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + }, + { + "description": "Time of the vibration, in seconds (optional, default value is 1)", + "name": "Duration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Generate an advanced vibration on the specified controller. Incompatible with Firefox.", + "fullName": "Advanced gamepad vibration", + "functionType": "Action", + "name": "A_Advanced_Vibration_Controller", + "sentence": "Make gamepad _PARAM1_ vibrate for _PARAM2_ seconds with the vibration magnitude of _PARAM3_ and _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "//Vibration work only on game in browser.", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", + "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", + "const strongRumbleMagnitude = eventsFunctionContext.getArgument(\"StrongMagnitude\");", + "const weakRumbleMagnitude = eventsFunctionContext.getArgument(\"WeakMagnitude\");", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "if (weakRumbleMagnitude < 0 || weakRumbleMagnitude > 1) {", + " console.error('Parameter weakRumble identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "if (strongRumbleMagnitude < 0 || strongRumbleMagnitude > 1) {", + " console.error('Parameter strongRumble identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug the controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "if (gamepad && gamepad.vibrationActuator) {", + " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", + " startDelay: 0,", + " duration: duration * 1000,", + " weakMagnitude: weakRumbleMagnitude,", + " strongMagnitude: strongRumbleMagnitude", + " });", + "}", + "", + "gdjs._extensionController.players[playerId].rumble.duration = duration;", + "gdjs._extensionController.players[playerId].rumble.elapsedTime = 0;", + "gdjs._extensionController.players[playerId].rumble.weakMagnitude = weakRumbleMagnitude;", + "gdjs._extensionController.players[playerId].rumble.strongMagnitude = strongRumbleMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + }, + { + "description": "Time of the vibration, in seconds (optional, default value is 1)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Strong rumble magnitude (from 0 to 1)", + "name": "StrongMagnitude", + "type": "expression" + }, + { + "description": "Weak rumble magnitude (from 0 to 1)", + "name": "WeakMagnitude", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change a vibration on the specified controller. Incompatible with Firefox.", + "fullName": "Change gamepad active vibration", + "functionType": "Action", + "name": "A_Change_Vibration_Magnitude", + "sentence": "Change the vibration magnitude of _PARAM2_ & _PARAM3_ on gamepad _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "//Vibration work only on game in browser.", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", + "const elapsedTime = gdjs._extensionController.players[playerId].rumble.elapsedTime || 0;", + "const originalDuration = gdjs._extensionController.players[playerId].rumble.duration || 1;", + "const strongRumbleMagnitude = eventsFunctionContext.getArgument(\"StrongMagnitude\");", + "const weakRumbleMagnitude = eventsFunctionContext.getArgument(\"WeakMagnitude\");", + "", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "if (weakRumbleMagnitude < 0 || weakRumbleMagnitude > 1) {", + " console.error('Parameter weakRumble identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "if (strongRumbleMagnitude < 0 || strongRumbleMagnitude > 1) {", + " console.error('Parameter strongRumble identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug the controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "if (originalDuration - elapsedTime <= 0) return;", + "", + "if (gamepad && gamepad.vibrationActuator) {", + " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", + " startDelay: 0,", + " duration: 1000 * (originalDuration - elapsedTime),", + " weakMagnitude: weakRumbleMagnitude,", + " strongMagnitude: strongRumbleMagnitude", + " });", + "}", + "", + "gdjs._extensionController.players[playerId].rumble.weakMagnitude = weakRumbleMagnitude;", + "gdjs._extensionController.players[playerId].rumble.strongMagnitude = strongRumbleMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + }, + { + "description": "Strong rumble magnitude (from 0 to 1)", + "name": "StrongMagnitude", + "type": "expression" + }, + { + "description": "Weak rumble magnitude (from 0 to 1)", + "name": "WeakMagnitude", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if any button is released on a gamepad.", + "fullName": "Any gamepad button released", + "functionType": "Condition", + "name": "C_any_button_released", + "sentence": "Any button of gamepad _PARAM1_ is released", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + "\tconsole.error('Parameter gamepad identifier in condition: \"Any gamepad button released\", is not valid number, must be between 0 and 4.');\r", + "\treturn;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "for (let buttonId = 0; buttonId < gamepad.buttons.length; buttonId++) { //For each buttons on current frame.\r", + "\r", + "\tif (buttonId === undefined) {\r", + "\t\teventsFunctionContext.returnValue = false;\r", + "\t\treturn;\r", + "\t}\r", + "\r", + "\t//Get previous value or define value by default for the current button\r", + "\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] || { pressed: false };\r", + "\r", + "\t//Get state of the button at previous frame\r", + "\tconst previousStateButtonIsPressed = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed;\r", + "\r", + "\t//Get the state of the button on the current frame.\r", + "\tconst currentFrameStateButtonIsPressed = gamepad.buttons[buttonId].pressed;\r", + "\r", + "\t//When previousStateButtonIsPressed is true and actual button state is not pressed\r", + "\t//Player have release the button\r", + "\tif (previousStateButtonIsPressed === true && currentFrameStateButtonIsPressed === false) {\r", + "\t\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = true;\r", + "\t\teventsFunctionContext.returnValue = true;\r", + "\t\t//break;\r", + "\t\treturn;\r", + "\t} else {\r", + "\t\t//The player didn't released the button yet, the previous frame state is still true\r", + "\t\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = false;\r", + "\t\teventsFunctionContext.returnValue = false;\r", + "\t}\r", + "\r", + "\tif (currentFrameStateButtonIsPressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + "}\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the strength of the weak vibration motor on the gamepad of a player.", + "fullName": "Weak rumble magnitude", + "functionType": "Expression", + "name": "WeakVibrationMagnitude", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].rumble.weakMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the strength of the strong vibration motor on the gamepad of a player.", + "fullName": "Strong rumble magnitude", + "functionType": "Expression", + "name": "StrongVibrationMagnitude", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].rumble.strongMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + } + ], + "objectGroups": [] + } ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [], "eventsBasedBehaviors": [ { - "description": "Smoothly scroll to follow an object.", - "fullName": "Smooth Camera", - "name": "SmoothCamera", + "description": "Control a platformer character with a gamepad.", + "fullName": "Platformer gamepad mapper", + "name": "PlatformerGamepadMapper", "objectType": "", "eventsFunctions": [ { "fullName": "", "functionType": "Action", - "name": "onCreated", + "name": "doStepPreEvents", "sentence": "", "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Update private properties through setters to check their values and initialize state." - }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetLeftwardSpeed" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyLeftwardSpeed()", - "log(1 - )" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetRightwardSpeed" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyRightwardSpeed()", - "log(1 - )" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetUpwardSpeed" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyUpwardSpeed()", - "log(1 - )" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetDownwardSpeed" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyDownwardSpeed()", - "log(1 - )" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetLeftwardSpeedMax" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyLeftwardSpeedMax()", - "log(1 - )" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetRightwardSpeedMax" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyRightwardSpeedMax()", - "log(1 - )" - ] - }, + "conditions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetUpwardSpeedMax" + "value": "Gamepads::C_Controller_X_is_connected" }, "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyUpwardSpeedMax()", - "log(1 - )" + "", + "GamepadIdentifier", + "" ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetDownwardSpeedMax" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyDownwardSpeedMax()", - "log(1 - )" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaLeft" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyFollowFreeAreaLeft()", - "log(1 - )" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaRight" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyFollowFreeAreaRight()", - "log(1 - )" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaTop" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyFollowFreeAreaTop()", - "log(1 - )" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaBottom" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyFollowFreeAreaBottom()", - "log(1 - )" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyCameraDelay" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyCameraDelay()" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "SmoothCamera::SmoothCamera::PropertyIsCalledManually" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::DoMoveCameraCloser" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Move the camera closer to the object. This action must be called after the object has moved for the frame.", - "fullName": "Move the camera closer", - "functionType": "Action", - "name": "MoveCameraCloser", - "sentence": "Move the camera closer to _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "The camera following is called with an action, the call from doStepPreEvents must be disabled to avoid to do it twice." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyIsCalledManually" - }, - "parameters": [ - "Object", - "Behavior", - "yes" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::DoMoveCameraCloser" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Move the camera closer to the object.", - "fullName": "Do move the camera closer", - "functionType": "Action", - "name": "DoMoveCameraCloser", - "private": true, - "sentence": "Do move the camera closer _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Delaying and forecasting can be used at the same time.\nForecasting only use the positions that are older than the one used for delaying.\nThe behavior uses a position history that is split in 2 arrays:\n- one for delaying the position (from TimeFromStart to TimeFromStart - CamearDelay)\n- one for forecasting the position (from TimeFromStart - CamearDelay to TimeFromStart - CamearDelay - ForecastHistoryDuration" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::UpdateDelayedPosition" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::UpdateForecastedPosition" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "At each frame, the camera must catchup the target by a given ratio (speed)\ncameraX(t) - targetX = (cameraX(t - 1) - targetX) * speed\n\nThe frame rate must not impact on the catch-up speed, we don't want a speed in ratio per frame but a speed ratio per second, like this:\ncameraX(t) - targetX = (cameraX(t - 1s) - targetX) * speed\n\nOk, but we still need to process each frame, we can use a exponent for this:\ncameraX(t) - targetX = (cameraX(t - timeDelta) - targetX) * speed^timeDelta\ncameraX(t) = targetX + (cameraX(t - timeDelta) - targetX) * exp(timeDelta * ln(speed))\n\npow is probably more efficient than precalculated log if the speed is changed continuously but this might be rare enough." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::PropertyFollowOnX" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyOldX" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "CameraX(Object.Layer(), 0)" - ] - } - ], - "events": [ + } + ], + "actions": [], + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "CameraX" - }, - "parameters": [ - "", - ">", - "Object.Behavior::FreeAreaRight()", - "Object.Layer()", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetCameraX" + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseArrows" }, "parameters": [ - "", - "=", - "Object.Behavior::FreeAreaRight()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaRight())\n* exp(TimeDelta() * Object.Behavior::PropertyLogLeftwardSpeed())", - "Object.Layer()", - "0" + "Object", + "Behavior" ] } ], + "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "CameraX" + "value": "Gamepads::C_Button_pressed" }, "parameters": [ "", - "<", - "Object.Behavior::PropertyOldX() - Object.Behavior::PropertyLeftwardSpeedMax() * TimeDelta()", - "Object.Layer()", - "0" + "GamepadIdentifier", + "\"Left\"", + "\"Left\"" ] } ], "actions": [ { "type": { - "value": "SetCameraX" + "value": "PlatformBehavior::SimulateLeftKey" }, "parameters": [ - "", - "=", - "Object.Behavior::PropertyOldX() - Object.Behavior::PropertyLeftwardSpeedMax() * TimeDelta()", - "Object.Layer()", - "0" + "Object", + "PlatformerCharacter" ] } ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "CameraX" - }, - "parameters": [ - "", - "<", - "Object.Behavior::FreeAreaLeft()", - "Object.Layer()", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetCameraX" - }, - "parameters": [ - "", - "=", - "Object.Behavior::FreeAreaLeft()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaLeft())\n* exp(TimeDelta() * Object.Behavior::PropertyLogRightwardSpeed())", - "Object.Layer()", - "0" - ] - } - ], - "events": [ + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "CameraX" + "value": "Gamepads::C_Button_pressed" }, "parameters": [ "", - ">", - "Object.Behavior::PropertyOldX() + Object.Behavior::PropertyRightwardSpeedMax() * TimeDelta()", - "Object.Layer()", - "0" + "GamepadIdentifier", + "\"Right\"", + "\"Left\"" ] } ], "actions": [ { "type": { - "value": "SetCameraX" + "value": "PlatformBehavior::SimulateRightKey" }, "parameters": [ - "", - "=", - "Object.Behavior::PropertyOldX() + Object.Behavior::PropertyRightwardSpeedMax() * TimeDelta()", - "Object.Layer()", - "0" + "Object", + "PlatformerCharacter" ] } ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::PropertyFollowOnY" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyOldY" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "CameraY(Object.Layer(), 0)" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "CameraY" - }, - "parameters": [ - "", - ">", - "Object.Behavior::FreeAreaBottom()", - "Object.Layer()", - "0" - ] - } - ], - "actions": [ + }, { - "type": { - "value": "SetCameraY" - }, - "parameters": [ - "", - "=", - "Object.Behavior::FreeAreaBottom()\n+ (CameraY(Object.Layer(), 0) - Object.Behavior::FreeAreaBottom())\n* exp(TimeDelta() * Object.Behavior::PropertyLogUpwardSpeed())", - "Object.Layer()", - "0" + "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" + ] + } ] - } - ], - "events": [ + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "CameraY" + "value": "Gamepads::C_Button_pressed" }, "parameters": [ "", - "<", - "Object.Behavior::PropertyOldY() - Object.Behavior::PropertyUpwardSpeedMax() * TimeDelta()", - "Object.Layer()", - "0" + "GamepadIdentifier", + "\"Down\"", + "\"Left\"" ] } ], "actions": [ { "type": { - "value": "SetCameraY" + "value": "PlatformBehavior::SimulateDownKey" }, "parameters": [ - "", - "=", - "Object.Behavior::PropertyOldY() - Object.Behavior::PropertyUpwardSpeedMax() * TimeDelta()", - "Object.Layer()", - "0" + "Object", + "PlatformerCharacter" ] } ] @@ -15583,655 +14776,579 @@ "conditions": [ { "type": { - "value": "CameraY" - }, - "parameters": [ - "", - "<", - "Object.Behavior::FreeAreaTop()", - "Object.Layer()", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetCameraY" + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseLeftStick" }, "parameters": [ - "", - "=", - "Object.Behavior::FreeAreaTop()\n+ (CameraY(Object.Layer(), 0) - Object.Behavior::FreeAreaTop())\n* exp(TimeDelta() * Object.Behavior::PropertyLogDownwardSpeed())", - "Object.Layer()", - "0" + "Object", + "Behavior" ] } ], + "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "CameraY" + "value": "Gamepads::C_Axis_pushed" }, "parameters": [ "", - ">", - "Object.Behavior::PropertyOldY() + Object.Behavior::PropertyDownwardSpeedMax() * TimeDelta()", - "Object.Layer()", - "0" + "GamepadIdentifier", + "\"Left\"", + "\"Left\"", + "" ] } ], "actions": [ { "type": { - "value": "SetCameraY" + "value": "PlatformBehavior::SimulateLeftKey" }, "parameters": [ - "", - "=", - "Object.Behavior::PropertyOldY() + Object.Behavior::PropertyDownwardSpeedMax() * TimeDelta()", - "Object.Layer()", - "0" + "Object", + "PlatformerCharacter" ] } ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Delay the camera according to a maximum speed and catch up the delay.", - "fullName": "Wait and catch up", - "functionType": "Action", - "name": "WaitAndCatchUp", - "sentence": "Delay the camera of _PARAM0_ during: _PARAM2_ seconds according to the maximum speed _PARAM3_;_PARAM4_ seconds and catch up in _PARAM5_ seconds", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Maybe the catch-up show be done in constant pixel speed instead of constant time speed." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyWaitingEnd" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "TimeFromStart() + GetArgumentAsNumber(\"WaitingDuration\")" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyWaitingSpeedXMax" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"WaitingSpeedXMax\")" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyWaitingSpeedYMax" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"WaitingSpeedYMax\")" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyCameraDelayCatchUpDuration" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"CatchUpDuration\")" - ] - } - ] - }, - { - "disabled": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "DebuggerTools::ConsoleLog" - }, - "parameters": [ - "\"Wait and catch up\"", - "\"info\"", - "\"SmoothCamera\"" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" - }, - { - "description": "Waiting duration (in seconds)", - "name": "WaitingDuration", - "type": "expression" - }, - { - "description": "Waiting maximum camera target speed X", - "name": "WaitingSpeedXMax", - "type": "expression" - }, - { - "description": "Waiting maximum camera target speed Y", - "name": "WaitingSpeedYMax", - "type": "expression" - }, - { - "description": "Catch up duration (in seconds)", - "name": "CatchUpDuration", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Draw the targeted and actual camera position.", - "fullName": "Draw debug", - "functionType": "Action", - "name": "DrawDebug", - "sentence": "Draw targeted and actual camera position for _PARAM0_ on _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "PrimitiveDrawing::FillOpacity" - }, - "parameters": [ - "ShapePainter", - "=", - "0" - ] - } - ] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Path used by the forecasting", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { - "type": { - "value": "Egal" - }, - "parameters": [ - "Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime)", - ">", - "0" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } ] - } - ], - "actions": [ + }, { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" + "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": { - "value": "PrimitiveDrawing::OutlineColor" - }, - "parameters": [ - "ShapePainter", - "\"245;166;35\"" + "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": "PrimitiveDrawing::BeginFillPath" + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseRightStick" }, "parameters": [ - "ShapePainter", - "Object.Variable(__SmoothCamera.ForecastHistoryX[0])", - "Object.Variable(__SmoothCamera.ForecastHistoryY[0])" + "Object", + "Behavior" ] } ], + "actions": [], "events": [ { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "Object.VariableChildCount(__SmoothCamera.ForecastHistoryX)", - "conditions": [], - "actions": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "PrimitiveDrawing::PathLineTo" + "value": "Gamepads::C_Axis_pushed" }, "parameters": [ - "ShapePainter", - "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()])", - "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()])" + "", + "GamepadIdentifier", + "\"Right\"", + "\"Left\"", + "" ] - }, + } + ], + "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + "value": "PlatformBehavior::SimulateLeftKey" }, "parameters": [ "Object", - "Behavior", - "+", - "1" + "PlatformerCharacter" ] } ] }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Right\"", + "" + ] + } + ], "actions": [ { "type": { - "value": "PrimitiveDrawing::EndFillPath" + "value": "PlatformBehavior::SimulateRightKey" }, "parameters": [ - "ShapePainter" + "Object", + "PlatformerCharacter" ] } ] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Follow-free area.", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::PropertyFollowFreeAreaLeft" + "value": "Gamepads::C_Axis_pushed" }, "parameters": [ - "Object", - "Behavior", - "!=", - "0" + "", + "GamepadIdentifier", + "\"Right\"", + "\"Up\"", + "" ] - }, + } + ], + "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::PropertyFollowFreeAreaRight" + "value": "PlatformBehavior::SimulateUpKey" }, "parameters": [ "Object", - "Behavior", - "!=", - "0" + "PlatformerCharacter" ] }, { "type": { - "value": "SmoothCamera::SmoothCamera::PropertyFollowFreeAreaTop" + "value": "PlatformBehavior::SimulateLadderKey" }, "parameters": [ "Object", - "Behavior", - "!=", - "0" + "PlatformerCharacter" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::PropertyFollowFreeAreaBottom" + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" }, "parameters": [ "Object", - "Behavior", - "!=", - "0" + "PlatformerCharacter" ] } ] } - ], - "actions": [ + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "PrimitiveDrawing::OutlineColor" + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" }, "parameters": [ - "ShapePainter", - "\"126;211;33\"" + "Object", + "Behavior", + "=", + "\"A or Cross\"" ] }, { "type": { - "value": "PrimitiveDrawing::Rectangle" + "value": "Gamepads::C_Button_pressed" }, "parameters": [ - "ShapePainter", - "Object.Behavior::FreeAreaLeft() - 1", - "Object.Behavior::FreeAreaTop() - 1", - "Object.Behavior::FreeAreaRight() + 1", - "Object.Behavior::FreeAreaBottom() + 1" + "", + "GamepadIdentifier", + "\"A\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" ] } ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Linear regression vector used by the forecasting.", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "PrimitiveDrawing::OutlineColor" + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" }, "parameters": [ - "ShapePainter", - "\"208;2;27\"" + "Object", + "Behavior", + "=", + "\"B or Circle\"" ] }, { "type": { - "value": "PrimitiveDrawing::LineV2" + "value": "Gamepads::C_Button_pressed" }, "parameters": [ - "ShapePainter", - "Object.Behavior::PropertyProjectedOldestX()", - "Object.Behavior::PropertyProjectedOldestY()", - "Object.Behavior::PropertyProjectedNewestX()", - "Object.Behavior::PropertyProjectedNewestY()", - "1" + "", + "GamepadIdentifier", + "\"B\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" ] } ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Targeted and actual camera position", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "PrimitiveDrawing::Circle" + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" }, "parameters": [ - "ShapePainter", - "Object.Behavior::PropertyForecastedX()", - "Object.Behavior::PropertyForecastedY()", - "3" + "Object", + "Behavior", + "=", + "\"X or Square\"" ] }, { "type": { - "value": "PrimitiveDrawing::LineV2" + "value": "Gamepads::C_Button_pressed" }, "parameters": [ - "ShapePainter", - "CameraX(Object.Layer(), 0)", - "CameraY(Object.Layer(), 0) - 4", - "CameraX(Object.Layer(), 0)", - "CameraY(Object.Layer(), 0) + 4", - "1" + "", + "GamepadIdentifier", + "\"X\"", + "\"Left\"" ] - }, + } + ], + "actions": [ { "type": { - "value": "PrimitiveDrawing::LineV2" + "value": "PlatformBehavior::SimulateJumpKey" }, "parameters": [ - "ShapePainter", - "CameraX(Object.Layer(), 0) - 4", - "CameraY(Object.Layer(), 0)", - "CameraX(Object.Layer(), 0) + 4", - "CameraY(Object.Layer(), 0)", - "1" + "Object", + "PlatformerCharacter" ] } ] - } - ], - "parameters": [] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" - }, - { - "description": "Shape painter", - "name": "ShapePainter", - "supplementaryInformation": "PrimitiveDrawing::Drawer", - "type": "objectList" - } - ], - "objectGroups": [] - }, - { - "description": "Enable or disable the following on X axis.", - "fullName": "Follow on X", - "functionType": "Action", - "group": "Camera configuration", - "name": "SetFollowOnX", - "sentence": "The camera follows _PARAM0_ on X axis: _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyFollowOnX" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"FollowOnX\"" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Y or Triangle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Y\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } ] - } - ], - "actions": [ + }, { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyFollowOnX" - }, - "parameters": [ - "Object", - "Behavior", - "yes" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LB or L1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" - }, - { - "description": "Follow on X axis", - "name": "FollowOnX", - "type": "yesorno" - } - ], - "objectGroups": [] - }, - { - "description": "Enable or disable the following on Y axis.", - "fullName": "Follow on Y", - "functionType": "Action", - "group": "Camera configuration", - "name": "SetFollowOnY", - "sentence": "The camera follows _PARAM0_ on Y axis: _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + }, { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyFollowOnY" - }, - "parameters": [ - "Object", - "Behavior", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RB or R1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"FollowOnY\"" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LT or L2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } ] - } - ], - "actions": [ + }, { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyFollowOnY" - }, - "parameters": [ - "Object", - "Behavior", - "yes" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RT or R2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } ] } ] @@ -16246,222 +15363,454 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::PlatformerGamepadMapper", "type": "behavior" - }, - { - "description": "Follow on Y axis", - "name": "FollowOnY", - "type": "yesorno" } ], "objectGroups": [] - }, + } + ], + "propertyDescriptors": [ { - "description": "Change the camera follow free area right border.", - "fullName": "Follow free area right border", - "functionType": "Action", - "group": "Camera configuration", - "name": "SetFollowFreeAreaRight", - "sentence": "Change the camera follow free area right border of _PARAM0_: _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyFollowFreeAreaTop" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaRight\"))" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" - }, - { - "description": "Follow free area right border", - "name": "SetFollowFreeAreaRight", - "type": "expression" - } + "value": "", + "type": "Behavior", + "label": "Platformer character behavior", + "description": "", + "group": "", + "extraInformation": [ + "PlatformBehavior::PlatformerObjectBehavior" ], - "objectGroups": [] + "name": "PlatformerCharacter" }, { - "description": "Change the camera follow free area left border.", - "fullName": "Follow free area left border", - "functionType": "Action", - "group": "Camera configuration", - "name": "SetFollowFreeAreaLeft", - "sentence": "Change the camera follow free area left border of _PARAM0_: _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyFollowFreeAreaTop" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaLeft\"))" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" - }, - { - "description": "Follow free area left border", - "name": "SetFollowFreeAreaLeft", - "type": "expression" - } - ], - "objectGroups": [] + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" }, { - "description": "Change the camera follow free area top border.", - "fullName": "Follow free area top border", + "value": "true", + "type": "Boolean", + "label": "Use directional pad", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseArrows" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use left stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseLeftStick" + }, + { + "value": "", + "type": "Boolean", + "label": "Use right stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseRightStick" + }, + { + "value": "A or Cross", + "type": "Choice", + "label": "Jump button", + "description": "", + "group": "Controls", + "extraInformation": [ + "A or Cross", + "B or Circle", + "X or Square", + "Y or Triangle", + "LB or L1", + "RB or R1", + "LT or L2", + "RT or R2" + ], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a 3D physics character with a gamepad.", + "fullName": "3D platformer gamepad mapper", + "name": "Platformer3DGamepadMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", "functionType": "Action", - "group": "Camera configuration", - "name": "SetFollowFreeAreaTop", - "sentence": "Change the camera follow free area top border of _PARAM0_: _PARAM2_", + "name": "doStepPreEvents", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyFollowFreeAreaTop" + "value": "Gamepads::C_Controller_X_is_connected" }, "parameters": [ - "Object", - "Behavior", - "=", - "max(0, GetArgumentAsNumber(\"FollowFreeAreaTop\"))" + "", + "GamepadIdentifier", + "" ] } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" - }, - { - "description": "Follow free area top border", - "name": "FollowFreeAreaTop", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Change the camera follow free area bottom border.", - "fullName": "Follow free area bottom border", - "functionType": "Action", - "group": "Camera configuration", - "name": "SetFollowFreeAreaBottom", - "sentence": "Change the camera follow free area bottom border of _PARAM0_: _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + ], + "actions": [], + "events": [ { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyFollowFreeAreaBottom" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaBottom\"))" + "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)" + ] + } ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" - }, - { - "description": "Follow free area bottom border", - "name": "SetFollowFreeAreaBottom", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Change the camera leftward maximum speed (in pixels per second).", - "fullName": "Leftward maximum speed", - "functionType": "Action", - "group": "Camera configuration", - "name": "SetLeftwardSpeedMax", - "sentence": "Change the camera leftward maximum speed of _PARAM0_: _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + }, { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyLeftwardSpeedMax" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"A or Cross\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"A\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"B or Circle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"B\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"X or Square\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"X\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Y or Triangle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Y\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LB or L1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RB or R1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LT or L2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RT or R2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } ] } ] @@ -16476,130 +15825,428 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::Platformer3DGamepadMapper", "type": "behavior" - }, - { - "description": "Leftward maximum speed (in ratio per second)", - "name": "Speed", - "type": "expression" } ], "objectGroups": [] - }, + } + ], + "propertyDescriptors": [ { - "description": "Change the camera rightward maximum speed (in pixels per second).", - "fullName": "Rightward maximum speed", - "functionType": "Action", - "group": "Camera configuration", - "name": "SetRightwardSpeedMax", - "sentence": "Change the camera rightward maximum speed of _PARAM0_: _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyLeftwardSpeedMax" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" - ] - } - ] - } + "value": "", + "type": "Behavior", + "label": "3D physics character", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" - }, - { - "description": "Rightward maximum speed (in pixels per second)", - "name": "Speed", - "type": "expression" - } + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" + }, + { + "value": "Left", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Left", + "Right" ], - "objectGroups": [] + "name": "JoystickIdentifier" }, { - "description": "Change the camera upward maximum speed (in pixels per second).", - "fullName": "Upward maximum speed", + "value": "A or Cross", + "type": "Choice", + "label": "Jump button", + "description": "", + "group": "Controls", + "extraInformation": [ + "A or Cross", + "B or Circle", + "X or Square", + "Y or Triangle", + "LB or L1", + "RB or R1", + "LT or L2", + "RT or R2" + ], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a 3D physics character with a gamepad.", + "fullName": "3D shooter gamepad mapper", + "name": "Shooter3DGamepadMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", "functionType": "Action", - "group": "Camera configuration", - "name": "SetUpwardSpeedMax", - "sentence": "Change the camera upward maximum speed of _PARAM0_: _PARAM2_", + "name": "doStepPreEvents", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyUpwardSpeedMax" + "value": "Gamepads::C_Controller_X_is_connected" }, "parameters": [ - "Object", - "Behavior", - "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "", + "GamepadIdentifier", + "" ] } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" - }, - { - "description": "Upward maximum speed (in pixels per second)", - "name": "Speed", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Change the camera downward maximum speed (in pixels per second).", - "fullName": "Downward maximum speed", - "functionType": "Action", - "group": "Camera configuration", - "name": "SetDownwardSpeedMax", - "sentence": "Change the camera downward maximum speed of _PARAM0_: _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + ], + "actions": [], + "events": [ { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyDownwardSpeedMax" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "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::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"A or Cross\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"A\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"B or Circle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"B\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"X or Square\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"X\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Y or Triangle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Y\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LB or L1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RB or R1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LT or L2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RT or R2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } ] } ] @@ -16614,49 +16261,169 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::Shooter3DGamepadMapper", "type": "behavior" - }, - { - "description": "Downward maximum speed (in pixels per second)", - "name": "Speed", - "type": "expression" } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D physics character", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" }, { - "description": "Change the camera leftward catch-up speed (in ratio per second).", - "fullName": "Leftward catch-up speed", + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" + }, + { + "value": "Left", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Left", + "Right" + ], + "name": "WalkStick" + }, + { + "value": "Right", + "type": "Choice", + "label": "Camera joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Left", + "Right" + ], + "name": "CameraStick" + }, + { + "value": "A or Cross", + "type": "Choice", + "label": "Jump button", + "description": "", + "group": "Controls", + "extraInformation": [ + "A or Cross", + "B or Circle", + "X or Square", + "Y or Triangle", + "LB or L1", + "RB or R1", + "LT or L2", + "RT or R2" + ], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control camera rotations with a gamepad.", + "fullName": "First person camera gamepad mapper", + "name": "FirstPersonGamepadMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", "functionType": "Action", - "group": "Camera configuration", - "name": "SetLeftwardSpeed", - "sentence": "Change the camera leftward catch-up speed of _PARAM0_: _PARAM2_", + "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": "SmoothCamera::SmoothCamera::SetPropertyLeftwardSpeed" + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyCurrentRotationSpeedZ" }, "parameters": [ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"LeftwardSpeed\"))" + "Gamepads::AcceleratedSpeed(CurrentRotationSpeedZ, Gamepads::StickForceX(GamepadIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" ] }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyLogLeftwardSpeed" + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "CurrentRotationSpeedZ * TimeDelta()" + ] + }, + { + "type": { + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyCurrentRotationSpeedY" }, "parameters": [ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyLeftwardSpeed())" + "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", + "" ] } ] @@ -16671,24 +16438,20 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" - }, - { - "description": "Leftward catch-up speed (in ratio per second)", - "name": "LeftwardSpeed", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change the camera rightward catch-up speed (in ratio per second).", - "fullName": "Rightward catch-up speed", + "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": "Camera configuration", - "name": "SetRightwardSpeed", - "sentence": "Change the camera rightward catch-up speed of _PARAM0_: _PARAM2_", + "group": "Layers and cameras", + "name": "LookFromObjectEyes", + "private": true, + "sentence": "Move the camera to look though _PARAM0_ eyes", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -16696,24 +16459,62 @@ "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyRightwardSpeed" + "value": "CentreCamera" }, "parameters": [ + "", "Object", - "Behavior", + "", + "Object.Layer()", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraZ" + }, + "parameters": [ + "", "=", - "clamp(0, 1, GetArgumentAsNumber(\"RightwardSpeed\"))" + "Object.Object3D::Z() + Object.Object3D::Depth() + OffsetZ", + "", + "" ] }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyLogRightwardSpeed" + "value": "Scene3D::SetCameraRotationX" }, "parameters": [ - "Object", - "Behavior", + "", + "=", + "- Object.Object3D::RotationY() + 90", + "GetArgumentAsString(\"Layer\")", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraRotationY" + }, + "parameters": [ + "", + "=", + "Object.Object3D::RotationX()", + "GetArgumentAsString(\"Layer\")", + "" + ] + }, + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", "=", - "log(1 - Object.Behavior::PropertyRightwardSpeed())" + "Object.Angle() + 90", + "Object.Layer()", + "" ] } ] @@ -16728,24 +16529,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" - }, - { - "description": "Rightward catch-up speed (in ratio per second)", - "name": "RightwardSpeed", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change the camera downward catch-up speed (in ratio per second).", - "fullName": "Downward catch-up speed", - "functionType": "Action", - "group": "Camera configuration", - "name": "SetDownwardSpeed", - "sentence": "Change the camera downward catch-up speed of _PARAM0_: _PARAM2_", + "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", @@ -16753,30 +16549,19 @@ "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyDownwardSpeed" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "clamp(0, 1, GetArgumentAsNumber(\"DownwardSpeed\"))" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyLogDownwardSpeed" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "log(1 - Object.Behavior::PropertyDownwardSpeed())" + "HorizontalRotationSpeedMax" ] } ] } ], - "parameters": [ + "expressionType": { + "type": "expression" + }, + "parameters": [ { "description": "Object", "name": "Object", @@ -16785,24 +16570,18 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" - }, - { - "description": "Downward catch-up speed (in ratio per second)", - "name": "DownwardSpeed", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change the camera upward catch-up speed (in ratio per second).", - "fullName": "Upward catch-up speed", - "functionType": "Action", - "group": "Camera configuration", - "name": "SetUpwardSpeed", - "sentence": "Change the camera upward catch-up speed of _PARAM0_: _PARAM2_", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationSpeedMax", + "name": "SetHorizontalRotationSpeedMax", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -16810,24 +16589,13 @@ "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyUpwardSpeed" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "clamp(0, 1, GetArgumentAsNumber(\"UpwardSpeed\"))" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyLogUpwardSpeed" + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyHorizontalRotationSpeedMax" }, "parameters": [ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyUpwardSpeed())" + "Value" ] } ] @@ -16842,24 +16610,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" - }, - { - "description": "Upward catch-up speed (in ratio per second)", - "name": "UpwardSpeed", - "type": "expression" } ], "objectGroups": [] }, { - "description": "the camera offset on X axis of the object. This is not the current difference between the object and the camera position.", - "fullName": "Camera offset X", + "description": "the horizontal rotation acceleration of the object.", + "fullName": "Horizontal rotation acceleration", "functionType": "ExpressionAndCondition", - "group": "Camera configuration", - "name": "OffsetX", - "sentence": "the camera offset on X axis", + "group": "First person camera gamepad mapper horizontal rotation configuration", + "name": "HorizontalRotationAcceleration", + "sentence": "the horizontal rotation acceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -16870,7 +16633,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCameraOffsetX()" + "HorizontalRotationAcceleration" ] } ] @@ -16888,7 +16651,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" } ], @@ -16897,8 +16660,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "OffsetX", - "name": "SetOffsetXOp", + "getterName": "HorizontalRotationAcceleration", + "name": "SetHorizontalRotationAcceleration", "sentence": "", "events": [ { @@ -16907,13 +16670,13 @@ "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyCameraOffsetX" + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyHorizontalRotationAcceleration" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -16928,47 +16691,73 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Change the camera offset on X axis of an object.", - "fullName": "Camera Offset X", - "functionType": "Action", - "group": "Camera configuration", - "name": "SetOffsetX", - "private": true, - "sentence": "Change the camera offset on X axis of _PARAM0_: _PARAM2_", + "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::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Deprecated use SetOffsetXOp instead." + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "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": "SmoothCamera::SmoothCamera::SetOffsetXOp" + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyHorizontalRotationDeceleration" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"CameraOffsetX\")", - "" + "Value" ] } ] @@ -16983,24 +16772,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" - }, - { - "description": "Camera offset X", - "name": "CameraOffsetX", - "type": "expression" } ], "objectGroups": [] }, { - "description": "the camera offset on Y axis of the object. This is not the current difference between the object and the camera position.", - "fullName": "Camera offset Y", + "description": "the maximum vertical rotation speed of the object.", + "fullName": "Maximum vertical rotation speed", "functionType": "ExpressionAndCondition", - "group": "Camera configuration", - "name": "OffsetY", - "sentence": "the camera offset on Y axis", + "group": "First person camera gamepad mapper vertical rotation configuration", + "name": "VerticalRotationSpeedMax", + "sentence": "the maximum vertical rotation speed", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -17011,7 +16795,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCameraOffsetY()" + "VerticalRotationSpeedMax" ] } ] @@ -17029,7 +16813,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" } ], @@ -17038,35 +16822,23 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "OffsetY", - "name": "SetOffsetYOp", + "getterName": "VerticalRotationSpeedMax", + "name": "SetVerticalRotationSpeedMax", "sentence": "", "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Deprecated use SetOffsetYOp instead." - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyCameraOffsetY" + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyVerticalRotationSpeedMax" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -17081,20 +16853,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Change the camera offset on Y axis of an object.", - "fullName": "Camera Offset Y", - "functionType": "Action", - "group": "Camera configuration", - "name": "SetOffsetY", - "private": true, - "sentence": "Change the camera offset on Y axis of _PARAM0_: _PARAM2_", + "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", @@ -17102,19 +16873,18 @@ "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetOffsetYOp" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"CameraOffsetY\")", - "" + "VerticalRotationAcceleration" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -17124,24 +16894,18 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" - }, - { - "description": "Camera offset Y", - "name": "CameraOffsetY", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change the camera forecast time (in seconds).", - "fullName": "Forecast time", - "functionType": "Action", - "group": "Camera configuration", - "name": "SetForecastTime", - "sentence": "Change the camera forecast time of _PARAM0_: _PARAM2_", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationAcceleration", + "name": "SetVerticalRotationAcceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -17149,13 +16913,13 @@ "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastTime" + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyVerticalRotationAcceleration" }, "parameters": [ "Object", "Behavior", "=", - "min(0, GetArgumentAsNumber(\"ForecastTime\"))" + "Value" ] } ] @@ -17170,24 +16934,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" - }, - { - "description": "Forecast time", - "name": "ForecastTime", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change the camera delay (in seconds).", - "fullName": "Camera delay", - "functionType": "Action", - "group": "Camera configuration", - "name": "SetCameraDelay", - "sentence": "Change the camera delay of _PARAM0_: _PARAM2_", + "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", @@ -17195,18 +16954,18 @@ "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyCameraDelay" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "min(0, GetArgumentAsNumber(\"CameraDelay\"))" + "VerticalRotationDeceleration" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -17216,24 +16975,17 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" - }, - { - "description": "Camera delay", - "name": "CameraDelay", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Return follow free area left border X.", - "fullName": "Free area left", - "functionType": "Expression", - "group": "Private", - "name": "FreeAreaLeft", - "private": true, + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationDeceleration", + "name": "SetVerticalRotationDeceleration", "sentence": "", "events": [ { @@ -17242,18 +16994,18 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyVerticalRotationDeceleration" }, "parameters": [ - "Object.Behavior::PropertyForecastedX() + Object.Behavior::PropertyCameraOffsetX() - Object.Behavior::PropertyFollowFreeAreaLeft()" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -17263,20 +17015,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Return follow free area right border X.", - "fullName": "Free area right", - "functionType": "Expression", - "group": "Private", - "name": "FreeAreaRight", - "private": true, - "sentence": "", + "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", @@ -17287,7 +17038,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedX() + Object.Behavior::PropertyCameraOffsetX() + Object.Behavior::PropertyFollowFreeAreaRight()" + "VerticalAngleMin" ] } ] @@ -17305,19 +17056,17 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Return follow free area bottom border Y.", - "fullName": "Free area bottom", - "functionType": "Expression", - "group": "Private", - "name": "FreeAreaBottom", - "private": true, + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalAngleMin", + "name": "SetVerticalAngleMin", "sentence": "", "events": [ { @@ -17326,18 +17075,18 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyVerticalAngleMin" }, "parameters": [ - "Object.Behavior::PropertyForecastedY() + Object.Behavior::PropertyCameraOffsetY() + Object.Behavior::PropertyFollowFreeAreaBottom()" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -17347,20 +17096,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Return follow free area top border Y.", - "fullName": "Free area top", - "functionType": "Expression", - "group": "Private", - "name": "FreeAreaTop", - "private": true, - "sentence": "", + "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", @@ -17371,7 +17119,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedY() + Object.Behavior::PropertyCameraOffsetY() - Object.Behavior::PropertyFollowFreeAreaTop()" + "VerticalAngleMax" ] } ] @@ -17389,347 +17137,427 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Update delayed position and delayed history. This is called in doStepPreEvents.", - "fullName": "Update delayed position", - "functionType": "Action", - "group": "Private", - "name": "UpdateDelayedPosition", - "private": true, - "sentence": "Update delayed position and delayed history of _PARAM0_", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalAngleMax", + "name": "SetVerticalAngleMax", + "sentence": "", "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Add the previous position to have enough (2) positions to evaluate the extra delay for waiting mode." - }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::IsWaiting" + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyVerticalAngleMax" }, "parameters": [ "Object", "Behavior", - "" - ] - }, - { - "type": { - "value": "Egal" - }, - "parameters": [ - "Object.VariableChildCount(__SmoothCamera.ObjectTime)", "=", - "0" + "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": "ObjectVariablePushNumber" - }, - "parameters": [ - "Object", - "__SmoothCamera.ObjectTime", - "TimeFromStart()" - ] - }, - { - "type": { - "value": "ObjectVariablePushNumber" - }, - "parameters": [ - "Object", - "__SmoothCamera.ObjectX", - "Object.Behavior::PropertyDelayedCenterX()" - ] - }, - { - "type": { - "value": "ObjectVariablePushNumber" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "__SmoothCamera.ObjectY", - "Object.Behavior::PropertyDelayedCenterY()" + "OffsetZ" ] } ] - }, + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Use the object center when no delay is asked." + "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": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterX" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.CenterX()" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterY" + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyOffsetZ" }, "parameters": [ "Object", "Behavior", "=", - "Object.CenterY()" + "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", + "description": "", + "group": "", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "name": "Object3D" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" + }, + { + "value": "Right", + "type": "Choice", + "label": "Camera joystick", + "description": "", + "group": "", + "extraInformation": [ + "Left", + "Right" + ], + "name": "CameraStick" + }, + { + "value": "180", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationSpeedMax" + }, + { + "value": "360", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationAcceleration" + }, + { + "value": "720", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationDeceleration" + }, + { + "value": "120", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationSpeedMax" + }, + { + "value": "240", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationAcceleration" + }, + { + "value": "480", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationDeceleration" + }, + { + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Minimum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMin" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Maximum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z position offset", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Z", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Y", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedY" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a top-down character with a gamepad.", + "fullName": "Top-down gamepad mapper", + "name": "TopDownGamepadMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": true, - "value": "SmoothCamera::SmoothCamera::IsDelayed" + "value": "Gamepads::C_Controller_X_is_connected" }, "parameters": [ - "Object", - "Behavior", + "", + "GamepadIdentifier", "" ] } ], - "actions": [ + "actions": [], + "events": [ { - "type": { - "value": "SmoothCamera::SmoothCamera::AddForecastHistoryPosition" - }, - "parameters": [ - "Object", - "Behavior", - "TimeFromStart()", - "Object.CenterX()", - "Object.CenterY()", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::IsDelayed" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::IsWaiting" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "ObjectVariablePushNumber" - }, - "parameters": [ - "Object", - "__SmoothCamera.ObjectTime", - "TimeFromStart()" - ] - }, - { - "type": { - "value": "ObjectVariablePushNumber" - }, - "parameters": [ - "Object", - "__SmoothCamera.ObjectX", - "Object.CenterX()" - ] - }, - { - "type": { - "value": "ObjectVariablePushNumber" - }, - "parameters": [ - "Object", - "__SmoothCamera.ObjectY", - "Object.CenterY()" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Remove history entries that are too old to be useful for delaying and pass it to the history for forecasting." - }, - { - "infiniteLoopWarning": true, - "type": "BuiltinCommonInstructions::While", - "whileConditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "Object.VariableChildCount(__SmoothCamera.ObjectTime)", - ">=", - "2" - ] - }, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "VarObjet" + "value": "Gamepads::TopDownGamepadMapper::PropertyUseArrows" }, "parameters": [ "Object", - "__SmoothCamera.ObjectTime[1]", - "<", - "TimeFromStart() - Object.Behavior::CurrentDelay()" + "Behavior" ] } ], - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::AddForecastHistoryPosition" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Variable(__SmoothCamera.ObjectTime[0])", - "Object.Variable(__SmoothCamera.ObjectX[0])", - "Object.Variable(__SmoothCamera.ObjectY[0])", - "" - ] - }, + "actions": [], + "events": [ { - "type": { - "value": "ObjectVariableRemoveAt" - }, - "parameters": [ - "Object", - "__SmoothCamera.ObjectTime", - "0" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } ] }, { - "type": { - "value": "ObjectVariableRemoveAt" - }, - "parameters": [ - "Object", - "__SmoothCamera.ObjectX", - "0" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } ] }, { - "type": { - "value": "ObjectVariableRemoveAt" - }, - "parameters": [ - "Object", - "__SmoothCamera.ObjectY", - "0" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Don't move the camera if there is not enough history." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterX" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Variable(__SmoothCamera.ObjectX[0])" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Up\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } ] }, { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterY" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Variable(__SmoothCamera.ObjectY[0])" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Down\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } ] } ] @@ -17739,294 +17567,409 @@ "conditions": [ { "type": { - "value": "Egal" - }, - "parameters": [ - "Object.VariableChildCount(__SmoothCamera.ObjectTime)", - ">=", - "2" - ] - }, - { - "type": { - "value": "VarObjet" + "value": "Gamepads::TopDownGamepadMapper::PropertyUseLeftStick" }, "parameters": [ "Object", - "__SmoothCamera.ObjectTime[0]", - "<", - "TimeFromStart() - Object.Behavior::CurrentDelay()" + "Behavior" ] } ], "actions": [], "events": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Add the extra delay that could be needed to respect the speed limit in waiting mode.\n\nspeedRatio = min(speedMaxX / historySpeedX, speedMaxY / historySpeedY)\ndelay += min(0, timeDelta * (1 - speedRatio))" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "Gamepads::StickRotationValue(GamepadIdentifier, \"Left\")", + "Gamepads::StickForce(GamepadIdentifier, \"Left\")" + ] + } + ] }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::IsWaiting" + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" }, "parameters": [ "Object", "Behavior", - "" + "=", + "\"360°\"" ] } ], "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyCameraExtraDelay" + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "Gamepads::StickRotationValue(GamepadIdentifier, \"Left\")", + "sign(Gamepads::StickForce(GamepadIdentifier, \"Left\"))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" }, "parameters": [ "Object", "Behavior", - "+", - "max(0, TimeDelta() * (1 - min(Object.Behavior::PropertyWaitingSpeedXMax() * abs(Object.Variable(__SmoothCamera.ObjectX[1]) - Object.Variable(__SmoothCamera.ObjectX[0])), Object.Behavior::PropertyWaitingSpeedYMax() * abs(Object.Variable(__SmoothCamera.ObjectY[1]) - Object.Variable(__SmoothCamera.ObjectY[0]))) / (Object.Variable(__SmoothCamera.ObjectTime[1]) - Object.Variable(__SmoothCamera.ObjectTime[0]))))" + "=", + "\"8 Directions\"" ] } ], + "actions": [], "events": [ { - "disabled": true, "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Left\"", + "" + ] + } + ], "actions": [ { "type": { - "value": "DebuggerTools::ConsoleLog" + "value": "TopDownMovementBehavior::SimulateLeftKey" }, "parameters": [ - "\"Extra delay: \" + ToString(Object.Behavior::PropertyCameraExtraDelay())", - "\"info\"", - "\"SmoothCamera\"" + "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": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyUseRightStick" }, - "comment": "The time with delay is now between the first 2 indexes" - }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterX" + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" }, "parameters": [ "Object", "Behavior", "=", - "lerp(Object.Variable(__SmoothCamera.ObjectX[1]), Object.Variable(__SmoothCamera.ObjectX[0]), ((TimeFromStart() - Object.Behavior::CurrentDelay()) - Object.Variable(__SmoothCamera.ObjectTime[1])) / (Object.Variable(__SmoothCamera.ObjectTime[0]) - Object.Variable(__SmoothCamera.ObjectTime[1])))" + "\"Analog\"" ] - }, + } + ], + "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterY" + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "Gamepads::StickRotationValue(GamepadIdentifier, \"Right\")", + "Gamepads::StickForce(GamepadIdentifier, \"Right\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" }, "parameters": [ "Object", "Behavior", "=", - "lerp(Object.Variable(__SmoothCamera.ObjectY[1]), Object.Variable(__SmoothCamera.ObjectY[0]), ((TimeFromStart() - Object.Behavior::CurrentDelay()) - Object.Variable(__SmoothCamera.ObjectTime[1])) / (Object.Variable(__SmoothCamera.ObjectTime[0]) - Object.Variable(__SmoothCamera.ObjectTime[1])))" + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "sign(Gamepads::StickForce(GamepadIdentifier, \"Right\"))", + "1" ] } ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "SmoothCamera::SmoothCamera::IsDelayed" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "inverted": true, - "value": "SmoothCamera::SmoothCamera::IsWaiting" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ObjectVariableClearChildren" - }, - "parameters": [ - "Object", - "__SmoothCamera.ObjectTime" - ] - }, - { - "type": { - "value": "ObjectVariableClearChildren" - }, - "parameters": [ - "Object", - "__SmoothCamera.ObjectX" - ] - }, - { - "type": { - "value": "ObjectVariableClearChildren" - }, - "parameters": [ - "Object", - "__SmoothCamera.ObjectY" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "SmoothCamera::SmoothCamera::IsWaiting" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyCameraDelayCatchUpSpeed" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyCameraExtraDelay() / Object.Behavior::PropertyCameraDelayCatchUpDuration()" - ] - } - ], - "events": [ - { - "disabled": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "DebuggerTools::ConsoleLog" - }, - "parameters": [ - "\"Start to catch up\"", - "\"info\"", - "\"SmoothCamera\"" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "SmoothCamera::SmoothCamera::IsWaiting" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::PropertyCameraExtraDelay" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyCameraExtraDelay" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "max(0, Object.Behavior::PropertyCameraExtraDelay() -Object.Behavior::PropertyCameraDelayCatchUpSpeed() * TimeDelta())" - ] - } - ], - "events": [ - { - "disabled": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + }, { - "type": { - "value": "DebuggerTools::ConsoleLog" - }, - "parameters": [ - "\"Catching up delay: \" + ToString(Object.Behavior::PropertyCameraExtraDelay())", - "\"info\"", - "\"SmoothCamera\"" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "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" + ] + } + ] + } ] } ] @@ -18043,298 +17986,499 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "Gamepads::TopDownGamepadMapper", "type": "behavior" } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Top-down movement behavior", + "description": "", + "group": "", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" + ], + "name": "TopDownMovement" }, { - "description": "Check if the camera following target is delayed from the object.", - "fullName": "Camera is delayed", - "functionType": "Condition", - "name": "IsDelayed", - "private": true, - "sentence": "The camera of _PARAM0_ is delayed", - "events": [ + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use directional pad", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseArrows" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use left stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseLeftStick" + }, + { + "value": "", + "type": "Boolean", + "label": "Use right stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseRightStick" + }, + { + "value": "Analog", + "type": "Choice", + "label": "Stick mode", + "description": "", + "group": "Controls", + "extraInformation": [ + "Analog", + "360°", + "8 Directions" + ], + "name": "StickMode" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Camera", + "extensionNamespace": "", + "fullName": "Copy camera settings", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWxheWVycy10cmlwbGUtb3V0bGluZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMiAxNi41NEwxOS4zNyAxMC44TDIxIDEyLjA3TDEyIDE5LjA3TDMgMTIuMDdMNC42MiAxMC44MUwxMiAxNi41NE0xMiAxNEwzIDdMMTIgMEwyMSA3TDEyIDE0TTEyIDIuNTNMNi4yNiA3TDEyIDExLjQ3TDE3Ljc0IDdMMTIgMi41M00xMiAyMS40N0wxOS4zNyAxNS43M0wyMSAxN0wxMiAyNEwzIDE3TDQuNjIgMTUuNzRMMTIgMjEuNDciIC8+PC9zdmc+", + "name": "CopyCameraSettings", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/layers-triple-outline.svg", + "shortDescription": "Copy the camera settings of a layer and apply them to another layer.", + "version": "1.0.1", + "description": [ + "Useful when multiple layers need to use the same camera values.", + "", + "How to use:", + "- Run the \"Copy camera settings\" action after all other camera actions have been performed", + "", + "Tips:", + "- Do not use on layers that implement a parallax effect" + ], + "origin": { + "identifier": "CopyCameraSettings", + "name": "gdevelop-extension-store" + }, + "tags": [ + "camera", + "clone", + "zoom", + "position", + "layer", + "angle", + "copy" + ], + "authorIds": [ + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Copy camera settings of a layer and apply them to another layer.", + "fullName": "Copy camera settings", + "functionType": "Action", + "name": "CopyCameraSettings", + "sentence": "Copy camera settings of _PARAM1_ layer and apply them to _PARAM3_ layer (X position: _PARAM5_, Y position: _PARAM6_, Zoom: _PARAM7_, Angle: _PARAM8_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "Object.Behavior::CurrentDelay()", - ">", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"CloneX\"" ] } ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, + "actions": [ { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" + "type": { + "value": "SetCameraX" + }, + "parameters": [ + "", + "=", + "CameraX(SourceLayer,SourceCamera)", + "DestinationLayer", + "DestinationCamera" + ] } - ], - "objectGroups": [] + ] }, { - "description": "Return the current camera delay.", - "fullName": "Current delay", - "functionType": "Expression", - "name": "CurrentDelay", - "private": true, - "sentence": "", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyCameraDelay() + Object.Behavior::PropertyCameraExtraDelay()" - ] - } + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"CloneY\"" ] } ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, + "actions": [ { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, + "type": { + "value": "SetCameraY" + }, + "parameters": [ + "", + "=", + "CameraY(SourceLayer,SourceCamera)", + "DestinationLayer", + "DestinationCamera" + ] + } + ] + }, { - "description": "Check if the camera following is waiting at a reduced speed.", - "fullName": "Camera is waiting", - "functionType": "Condition", - "name": "IsWaiting", - "private": true, - "sentence": "The camera of _PARAM0_ is waiting", + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"CloneZoom\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ZoomCamera" + }, + "parameters": [ + "", + "CameraZoom(SourceLayer,SourceCamera)", + "DestinationLayer", + "DestinationCamera" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"CloneAngle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "=", + "CameraAngle(SourceLayer,SourceCamera)", + "DestinationLayer", + "DestinationCamera" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Source layer", + "name": "SourceLayer", + "type": "layer" + }, + { + "description": "Source camera", + "name": "SourceCamera", + "type": "expression" + }, + { + "description": "Destination layer", + "name": "DestinationLayer", + "type": "layer" + }, + { + "description": "Destination camera", + "name": "DestinationCamera", + "type": "expression" + }, + { + "defaultValue": "yes", + "description": "Clone X position", + "name": "CloneX", + "optional": true, + "type": "yesorno" + }, + { + "defaultValue": "yes", + "description": "Clone Y position", + "name": "CloneY", + "optional": true, + "type": "yesorno" + }, + { + "defaultValue": "yes", + "description": "Clone zoom", + "name": "CloneZoom", + "optional": true, + "type": "yesorno" + }, + { + "defaultValue": "yes", + "description": "Clone angle", + "name": "CloneAngle", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "@4ian, Tristan Rhodes (https://victrisgames.itch.io/)", + "category": "Movement", + "extensionNamespace": "", + "fullName": "Ellipse movement", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXNpbmUtd2F2ZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNi41LDIxQzEzLjUsMjEgMTIuMzEsMTYuNzYgMTEuMDUsMTIuMjhDMTAuMTQsOS4wNCA5LDUgNy41LDVDNC4xMSw1IDQsMTEuOTMgNCwxMkgyQzIsMTEuNjMgMi4wNiwzIDcuNSwzQzEwLjUsMyAxMS43MSw3LjI1IDEyLjk3LDExLjc0QzEzLjgzLDE0LjggMTUsMTkgMTYuNSwxOUMxOS45NCwxOSAyMC4wMywxMi4wNyAyMC4wMywxMkgyMi4wM0MyMi4wMywxMi4zNyAyMS45NywyMSAxNi41LDIxWiIgLz48L3N2Zz4=", + "name": "EllipseMovement", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/sine-wave.svg", + "shortDescription": "Move objects on ellipses or smoothly back and forth in one direction.", + "version": "1.0.3", + "description": [ + "It allows objects to move:", + "- on an ellipsis or arcs", + "- smoothly vertically or horizontally (by setting one radius to 0)", + "- on a sine wave (by adding a force)", + "", + "It can be used for:", + "- Making objects float, such as powerups or coins", + "- Moving platforms", + "- Enemy movement patterns", + "- Making a player constantly turn right or left ([open the project online](https://editor.gdevelop.io/?project=example://star-seeker))" + ], + "origin": { + "identifier": "EllipseMovement", + "name": "gdevelop-extension-store" + }, + "tags": [ + "sine", + "ellipse", + "movement", + "circular", + "circle", + "floating", + "platform", + "enemy" + ], + "authorIds": [ + "wWP8BSlAW0UP4NeaHa2LcmmDzmH2", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Move objects on ellipses or smoothly back and forth in one direction.", + "fullName": "Ellipse movement", + "name": "EllipseMovement", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::PropertyWaitingEnd" + "value": "EllipseMovement::EllipseMovement::SetPropertyOldX" }, "parameters": [ "Object", "Behavior", - ">", - "TimeFromStart()" + "=", + "Object.X()" + ] + }, + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyOldY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Y()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Evaluate the center of movement from the object position and properties." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::PropertyInitialTurningLeft" + }, + "parameters": [ + "Object", + "Behavior" ] } ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" }, "parameters": [ - "True" + "Object", + "Behavior", + "*", + "-1" ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Add a position to the history for forecasting. This is called 2 times in UpadteDelayedPosition.", - "fullName": "Add forecast history position", - "functionType": "Action", - "group": "Private", - "name": "AddForecastHistoryPosition", - "private": true, - "sentence": "Add the time:_PARAM2_ and position: _PARAM3_; _PARAM4_ to the forecast history of _PARAM0_", - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BuiltinCommonInstructions::Or" + "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::PropertyForecastHistoryDuration" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "0" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::PropertyForecastTime" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "0" - ] - } + "parameters": [ + "Object", + "Behavior", + "<", + "0" ] } ], "actions": [ { "type": { - "value": "ObjectVariablePushNumber" + "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" }, "parameters": [ "Object", - "__SmoothCamera.ForecastHistoryTime", - "GetArgumentAsNumber(\"Time\")" + "Behavior", + "=", + "InitialDirectionAngle + 90" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "ObjectVariablePushNumber" + "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" }, "parameters": [ "Object", - "__SmoothCamera.ForecastHistoryX", - "GetArgumentAsNumber(\"ObjectX\")" + "Behavior", + ">=", + "0" ] - }, + } + ], + "actions": [ { "type": { - "value": "ObjectVariablePushNumber" + "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" }, "parameters": [ "Object", - "__SmoothCamera.ForecastHistoryY", - "GetArgumentAsNumber(\"ObjectY\")" + "Behavior", + "=", + "InitialDirectionAngle - 90" ] } - ], - "events": [ + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyCenterX" }, - "comment": "Remove history entries that are too old to be useful.\nKeep at least 2 positions because no forecast can be done with less positions." + "parameters": [ + "Object", + "Behavior", + "=", + "Object.X() - Object.Behavior::DeltaX()" + ] }, { - "infiniteLoopWarning": true, - "type": "BuiltinCommonInstructions::While", - "whileConditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime)", - ">=", - "3" - ] - }, - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__SmoothCamera.ForecastHistoryTime[0]", - "<", - "TimeFromStart() - Object.Behavior::PropertyCameraDelay() - Object.Behavior::PropertyCameraExtraDelay() - Object.Behavior::PropertyForecastHistoryDuration()" - ] - } - ], - "conditions": [], - "actions": [ - { - "type": { - "value": "ObjectVariableRemoveAt" - }, - "parameters": [ - "Object", - "__SmoothCamera.ForecastHistoryTime", - "0" - ] - }, - { - "type": { - "value": "ObjectVariableRemoveAt" - }, - "parameters": [ - "Object", - "__SmoothCamera.ForecastHistoryX", - "0" - ] - }, - { - "type": { - "value": "ObjectVariableRemoveAt" - }, - "parameters": [ - "Object", - "__SmoothCamera.ForecastHistoryY", - "0" - ] - } + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyCenterY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Y() - Object.Behavior::DeltaY()" ] } ] @@ -18349,60 +18493,54 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "EllipseMovement::EllipseMovement", "type": "behavior" - }, - { - "description": "Time", - "name": "Time", - "type": "expression" - }, - { - "description": "Object X", - "name": "ObjectX", - "type": "expression" - }, - { - "description": "Object Y", - "name": "ObjectY", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Update forecasted position. This is called in doStepPreEvents.", - "fullName": "Update forecasted position", + "fullName": "", "functionType": "Action", - "group": "Private", - "name": "UpdateForecastedPosition", - "private": true, - "sentence": "Update forecasted position of _PARAM0_", + "name": "doStepPreEvents", + "sentence": "", "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Update the center when the object is moved outside of the behavior." + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedX" + "value": "EllipseMovement::EllipseMovement::SetPropertyCenterX" }, "parameters": [ "Object", "Behavior", - "=", - "Object.Behavior::PropertyDelayedCenterX()" + "+", + "Object.X() - OldX" ] }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedY" + "value": "EllipseMovement::EllipseMovement::SetPropertyCenterY" }, "parameters": [ "Object", "Behavior", - "=", - "Object.Behavior::PropertyDelayedCenterY()" + "+", + "Object.Y() - OldY" ] } ] @@ -18417,866 +18555,354 @@ "textG": 0, "textR": 0 }, - "comment": "Simple linear regression\ny = A * x + B\n\nA = Covariance / VarianceX\nB = MeanY - A * MeanX\n\nNote than we could use only one position every N positions to reduce the process time,\nbut if we really need efficient process JavaScript and circular queues are a must." + "comment": "Place the object according to the movement angle." }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "Egal" + "value": "EllipseMovement::EllipseMovement::PropertyRadiusX" }, "parameters": [ - "Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime)", - ">=", - "2" + "Object", + "Behavior", + "!=", + "0" ] - }, + } + ], + "actions": [ { "type": { - "value": "BuiltinCommonInstructions::Or" + "value": "MettreX" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::PropertyForecastHistoryDuration" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "0" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::PropertyForecastTime" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "0" - ] - } + "parameters": [ + "Object", + "=", + "CenterX + Object.Behavior::DeltaX()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::PropertyRadiusY" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" ] } ], - "actions": [], - "events": [ + "actions": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Mean X", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanX" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "Object.VariableChildCount(__SmoothCamera.ForecastHistoryX)", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanX" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()])" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "1" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanX" - }, - "parameters": [ - "Object", - "Behavior", - "/", - "Object.VariableChildCount(__SmoothCamera.ForecastHistoryX)" - ] - } - ] - } - ], - "parameters": [] + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "=", + "CenterY + Object.Behavior::DeltaY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::PropertyShouldRotate" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "=", + "Object.Behavior::DirectionAngle() + RotationOffset" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Save the position to detect when the object is moved outside of the behavior." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyOldX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.X()" + ] }, { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Mean Y", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanY" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "Object.VariableChildCount(__SmoothCamera.ForecastHistoryY)", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanY" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()])" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "1" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanY" - }, - "parameters": [ - "Object", - "Behavior", - "/", - "Object.VariableChildCount(__SmoothCamera.ForecastHistoryY)" - ] - } - ] - }, - { - "disabled": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "DebuggerTools::ConsoleLog" - }, - "parameters": [ - "\"Mean: \" + ToString(Object.Behavior::PropertyForecastHistoryMeanX()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryMeanY())", - "", - "" - ] - } - ] - } - ], - "parameters": [] + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyOldY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Y()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "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": "Update the movement angle for the next frame." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "360 * TimeDelta() / LoopDuration" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the turning direction (left or right).", + "fullName": "Turn the other way", + "functionType": "Action", + "name": "ToggleTurningLeft", + "sentence": "_PARAM0_ turn the other way", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyCenterX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "2 * Object.X() - Object.Behavior::CenterX()" + ] }, { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Variance and Covariance", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyCenterY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "2 * Object.Y() - Object.Behavior::CenterY()" + ] + }, + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "180" + ] + }, + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" + }, + "parameters": [ + "Object", + "Behavior", + "*", + "-1" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the in which side the object is turning (left or right).", + "fullName": "Turn left or right", + "functionType": "Action", + "name": "SetTurningLeft", + "sentence": "_PARAM0_ turn left: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "BuiltinCommonInstructions::And" }, - "comment": "VarianceX = sum((X[i] - MeanX)²)\nVarianceY = sum((Y[i] - MeanY)²)\nCovariance = sum((X[i] - MeanX) * (Y[i] - MeanY))" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryVarianceX" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryVarianceY" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - }, + "parameters": [], + "subInstructions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryCovariance" + "value": "EllipseMovement::EllipseMovement::IsTurningLeft" }, "parameters": [ "Object", "Behavior", - "=", - "0" + "yes", + "" ] }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + "inverted": true, + "value": "GetArgumentAsBoolean" }, "parameters": [ - "Object", - "Behavior", - "=", - "0" + "\"TurnLeft\"" ] } ] }, { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "Object.VariableChildCount(__SmoothCamera.ForecastHistoryX)", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryVarianceX" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "pow(Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanX(), 2)" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryVarianceY" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "pow(Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanY(), 2)" - ] - }, + "type": { + "value": "BuiltinCommonInstructions::And" + }, + "parameters": [], + "subInstructions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryCovariance" + "inverted": true, + "value": "EllipseMovement::EllipseMovement::IsTurningLeft" }, "parameters": [ "Object", "Behavior", - "+", - "(Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanX())\n*\n(Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanY())" + "" ] }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + "value": "GetArgumentAsBoolean" }, "parameters": [ - "Object", - "Behavior", - "+", - "1" + "\"TurnLeft\"" ] } ] - }, - { - "disabled": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "DebuggerTools::ConsoleLog" - }, - "parameters": [ - "\"Variances: \" + ToString(Object.Behavior::PropertyForecastHistoryVarianceX()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryVarianceY()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryCovariance())", - "\"info\"", - "\"SmoothCamera\"" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", - "<", - "1" - ] - }, - { - "type": { - "value": "Egal" - }, - "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())", - "<", - "1" - ] - } - ], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedX" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyDelayedCenterX()" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedY" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyDelayedCenterY()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", - ">=", - "1" - ] - }, - { - "type": { - "value": "Egal" - }, - "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())", - ">=", - "1" - ] - } - ] - } - ], - "actions": [], - "events": [ - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Linear function parameters", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "y = A * x + B\n\nA = Covariance / VarianceX\nB = MeanY - A * MeanX" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", - ">=", - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())" - ] - } - ], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryLinearA" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyForecastHistoryCovariance() / Object.Behavior::PropertyForecastHistoryVarianceX()" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryLinearB" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyForecastHistoryMeanY() - Object.Behavior::PropertyForecastHistoryLinearA() * Object.Behavior::PropertyForecastHistoryMeanX()" - ] - } - ], - "events": [ - { - "disabled": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "DebuggerTools::ConsoleLog" - }, - "parameters": [ - "\"Linear: \" + ToString(Object.Behavior::PropertyForecastHistoryLinearA()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryLinearB())", - "\"info\"", - "\"SmoothCamera\"" - ] - } - ] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Projection", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::ProjectHistoryEnds" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Variable(__SmoothCamera.ForecastHistoryX[0])", - "Object.Variable(__SmoothCamera.ForecastHistoryY[0])", - "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.VariableChildCount(__SmoothCamera.ForecastHistoryX) - 1])", - "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.VariableChildCount(__SmoothCamera.ForecastHistoryY) - 1])", - "" - ] - } - ] - } - ], - "parameters": [] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Axis permutation to avoid a ratio between 2 numbers near 0." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", - "<", - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())" - ] - } - ], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryLinearA" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyForecastHistoryCovariance() / Object.Behavior::PropertyForecastHistoryVarianceY()" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryLinearB" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyForecastHistoryMeanX() - Object.Behavior::PropertyForecastHistoryLinearA() * Object.Behavior::PropertyForecastHistoryMeanY()" - ] - } - ], - "events": [ - { - "disabled": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "DebuggerTools::ConsoleLog" - }, - "parameters": [ - "\"Linear: \" + ToString(Object.Behavior::PropertyForecastHistoryLinearA()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryLinearB())", - "\"info\"", - "\"SmoothCamera\"" - ] - } - ] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Projection", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::ProjectHistoryEnds" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Variable(__SmoothCamera.ForecastHistoryY[0])", - "Object.Variable(__SmoothCamera.ForecastHistoryX[0])", - "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.VariableChildCount(__SmoothCamera.ForecastHistoryY) - 1])", - "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.VariableChildCount(__SmoothCamera.ForecastHistoryX) - 1])", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Permute back axis" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyProjectedOldestX()" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedOldestX" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyProjectedOldestY()" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedOldestY" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyIndex()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyProjectedNewestX()" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedNewestX" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyProjectedNewestY()" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedNewestY" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyIndex()" - ] - } - ] - } - ], - "parameters": [] - }, - { - "disabled": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "DebuggerTools::ConsoleLog" - }, - "parameters": [ - "\"Oldest: \" + ToString(Object.Behavior::PropertyProjectedOldestX()) + \" \" + ToString(Object.Behavior::PropertyProjectedOldestY())", - "\"info\"", - "\"SmoothCamera\"" - ] - } - ] - }, - { - "disabled": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "DebuggerTools::ConsoleLog" - }, - "parameters": [ - "\"Newest: \" + ToString(Object.Behavior::PropertyProjectedNewestX()) + \" \" + ToString(Object.Behavior::PropertyProjectedNewestY())", - "\"info\"", - "\"SmoothCamera\"" - ] - } - ] - } - ] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Forecasted position", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedX" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyProjectedNewestX() + ( Object.Behavior::PropertyProjectedNewestX() - Object.Behavior::PropertyProjectedOldestX()) * Object.Behavior::ForecastTimeRatio()" - ] - }, - { - "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedY" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyProjectedNewestY() + ( Object.Behavior::PropertyProjectedNewestY() - Object.Behavior::PropertyProjectedOldestY()) * Object.Behavior::ForecastTimeRatio()" - ] - } - ] - }, - { - "disabled": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "DebuggerTools::ConsoleLog" - }, - "parameters": [ - "\"Forecasted: \" + ToString(Object.Behavior::PropertyForecastedX()) + \" \" + ToString(Object.Behavior::PropertyForecastedY())", - "\"info\"", - "\"SmoothCamera\"" - ] - } - ] - } - ], - "parameters": [] - } - ], - "parameters": [] - } - ] } - ], - "parameters": [] + ] + } + ], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::ToggleTurningLeft" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] } ] } @@ -19290,85 +18916,464 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "EllipseMovement::EllipseMovement", "type": "behavior" + }, + { + "description": "Turn left", + "name": "TurnLeft", + "type": "yesorno" } ], "objectGroups": [] }, { - "description": "Project history ends position to have the vector on the line from linear regression. This function is only called by UpdateForecastedPosition.", - "fullName": "Project history ends", - "functionType": "Action", - "group": "Private", - "name": "ProjectHistoryEnds", - "private": true, - "sentence": "Project history oldest: _PARAM2_;_PARAM3_ and newest position: _PARAM4_;_PARAM5_ of _PARAM0_", + "description": "Check if the object is turning left.", + "fullName": "Is turning left", + "functionType": "Condition", + "name": "IsTurningLeft", + "sentence": "_PARAM0_ is turning left", "events": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Perpendicular line:\npA = -1/a; \npB = -pA * x + y\n\nIntersection:\n/ ProjectedY = a * ProjectedX + b\n\\ ProjectedY = pA * ProjectedX + b\n\nSolution that is cleaned out from indeterminism (like 0 / 0 or infinity / infinity):\nProjectedX= (x + (y - b) * a) / (a² + 1)\nProjectedY = y + (x * a - y + b) / (a² + 1)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the movement angle of the object.", + "fullName": "Movement angle", + "functionType": "Expression", + "name": "MovementAngle", + "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedNewestX" + "value": "SetReturnNumber" + }, + "parameters": [ + "MovementAngle" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the loop duration (in seconds).", + "fullName": "Loop duration", + "functionType": "Expression", + "group": "Configuration", + "name": "LoopDuration", + "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "abs(LoopDuration)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the ellipse radius on X axis.", + "fullName": "Radius X", + "functionType": "Expression", + "group": "Configuration", + "name": "RadiusX", + "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "RadiusX" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the ellipse radius on X axis.", + "fullName": "Radius Y", + "functionType": "Expression", + "group": "Configuration", + "name": "RadiusY", + "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "RadiusY" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the movement center position on X axis.", + "fullName": "Movement center X", + "functionType": "Expression", + "group": "Configuration", + "name": "CenterX", + "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "CenterX" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the movement center position on Y axis.", + "fullName": "Movement center Y", + "functionType": "Expression", + "group": "Configuration", + "name": "CenterY", + "sentence": "Set initial Y of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "CenterY" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the radius on X axis of the movement.", + "fullName": "Radius X", + "functionType": "Action", + "group": "Elliptical movement configuration", + "name": "SetRadiusX", + "sentence": "Change the radius on X axis of the movement of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyRadiusX" }, "parameters": [ "Object", "Behavior", "=", - "(GetArgumentAsNumber(\"NewestX\") + (GetArgumentAsNumber(\"NewestY\") - Object.Behavior::PropertyForecastHistoryLinearB()) * Object.Behavior::PropertyForecastHistoryLinearA()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + "Value" ] - }, + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + }, + { + "description": "Radius X", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the radius on Y axis of the movement.", + "fullName": "Radius Y", + "functionType": "Action", + "group": "Elliptical movement configuration", + "name": "SetRadiusY", + "sentence": "Change the radius on Y axis of the movement of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedNewestY" + "value": "EllipseMovement::EllipseMovement::SetPropertyRadiusY" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"NewestY\") + (GetArgumentAsNumber(\"NewestX\") * Object.Behavior::PropertyForecastHistoryLinearA() - GetArgumentAsNumber(\"NewestY\") \n+ Object.Behavior::PropertyForecastHistoryLinearB()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + "Value" ] } ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" }, + { + "description": "Radius Y", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the loop duration.", + "fullName": "Loop duration", + "functionType": "Action", + "group": "Elliptical movement configuration", + "name": "SetLoopDuration", + "sentence": "Change the loop duration of _PARAM0_ to _PARAM2_", + "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::IsTurningLeft" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedOldestX" + "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" }, "parameters": [ "Object", "Behavior", "=", - "(GetArgumentAsNumber(\"OldestX\") + (GetArgumentAsNumber(\"OldestY\") - Object.Behavior::PropertyForecastHistoryLinearB()) * Object.Behavior::PropertyForecastHistoryLinearA()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + "-Value" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedOldestY" + "inverted": true, + "value": "EllipseMovement::EllipseMovement::IsTurningLeft" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"OldestY\") + (GetArgumentAsNumber(\"OldestX\") * Object.Behavior::PropertyForecastHistoryLinearA() - GetArgumentAsNumber(\"OldestY\") \n+ Object.Behavior::PropertyForecastHistoryLinearB()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + "Value" ] } ] @@ -19383,38 +19388,66 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "EllipseMovement::EllipseMovement", "type": "behavior" }, { - "description": "OldestX", - "name": "OldestX", + "description": "Speed (in degrees per second)", + "name": "Value", "type": "expression" - }, + } + ], + "objectGroups": [] + }, + { + "description": "Change the movement angle. The object is teleported according to the angle.", + "fullName": "Teleport at an angle", + "functionType": "Action", + "name": "SetMovementAngle", + "sentence": "Teleport _PARAM0_ on the ellipse at _PARAM2_°", + "events": [ { - "description": "OldestY", - "name": "OldestY", - "type": "expression" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, { - "description": "Newest X", - "name": "NewestX", - "type": "expression" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" }, { - "description": "Newest Y", - "name": "NewestY", + "description": "Movement angle", + "name": "Value", "type": "expression" } ], "objectGroups": [] }, { - "description": "Return the ratio between forecast time and the duration of the history. This function is only called by UpdateForecastedPosition.", - "fullName": "Forecast time ratio", + "fullName": "Delta X", "functionType": "Expression", - "group": "Private", - "name": "ForecastTimeRatio", + "name": "DeltaX", "private": true, "sentence": "", "events": [ @@ -19427,7 +19460,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "- Object.Behavior::PropertyForecastTime() / (Object.Variable(__SmoothCamera.ForecastHistoryTime[0]) - Object.Variable(__SmoothCamera.ForecastHistoryTime[Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime) - 1]))" + "cos(ToRad(MovementAngle)) * RadiusX" ] } ] @@ -19445,416 +19478,229 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothCamera", + "supplementaryInformation": "EllipseMovement::EllipseMovement", "type": "behavior" } ], "objectGroups": [] - } - ], - "propertyDescriptors": [ + }, { - "value": "0.9", - "type": "Number", - "label": "Leftward catch-up speed (in ratio per second)", - "description": "", - "group": "Catch-up speed", - "extraInformation": [], - "name": "LeftwardSpeed" + "fullName": "Delta Y", + "functionType": "Expression", + "name": "DeltaY", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "sin(ToRad(MovementAngle)) * RadiusY" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "value": "0.9", - "type": "Number", - "label": "Rightward catch-up speed (in ratio per second)", - "description": "", - "group": "Catch-up speed", - "extraInformation": [], - "name": "RightwardSpeed" - }, - { - "value": "0.9", - "type": "Number", - "label": "Upward catch-up speed (in ratio per second)", - "description": "", - "group": "Catch-up speed", - "extraInformation": [], - "name": "UpwardSpeed" - }, - { - "value": "0.9", - "type": "Number", - "label": "Downward catch-up speed (in ratio per second)", - "description": "", - "group": "Catch-up speed", - "extraInformation": [], - "name": "DownwardSpeed" - }, - { - "value": "true", - "type": "Boolean", - "label": "Follow on X axis", - "description": "", - "group": "", - "extraInformation": [], - "name": "FollowOnX" - }, - { - "value": "true", - "type": "Boolean", - "label": "Follow on Y axis", - "description": "", - "group": "", - "extraInformation": [], - "name": "FollowOnY" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Follow free area left border", - "description": "", - "group": "Position", - "extraInformation": [], - "advanced": true, - "name": "FollowFreeAreaLeft" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Follow free area right border", - "description": "", - "group": "Position", - "extraInformation": [], - "advanced": true, - "name": "FollowFreeAreaRight" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Follow free area top border", - "description": "", - "group": "Position", - "extraInformation": [], - "advanced": true, - "name": "FollowFreeAreaTop" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Follow free area bottom border", - "description": "", - "group": "Position", - "extraInformation": [], - "advanced": true, - "name": "FollowFreeAreaBottom" - }, + "fullName": "Direction angle", + "functionType": "Expression", + "name": "DirectionAngle", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "MovementAngle + 90" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "MovementAngle - 90" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "EllipseMovement::EllipseMovement", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ { - "value": "0", + "value": "100", "type": "Number", "unit": "Pixel", - "label": "Camera offset X", + "label": "Radius of the movement on X axis", "description": "", - "group": "Position", + "group": "Ellipse", "extraInformation": [], - "advanced": true, - "name": "CameraOffsetX" + "name": "RadiusX" }, { "value": "0", "type": "Number", "unit": "Pixel", - "label": "Camera offset Y", - "description": "", - "group": "Position", - "extraInformation": [], - "advanced": true, - "name": "CameraOffsetY" - }, - { - "value": "0", - "type": "Number", - "unit": "Second", - "label": "Camera delay", - "description": "", - "group": "Timing", - "extraInformation": [], - "deprecated": true, - "name": "CameraDelay" - }, - { - "value": "0", - "type": "Number", - "unit": "Second", - "label": "Forecast time", + "label": "Radius of the movement on Y axis", "description": "", - "group": "Timing", + "group": "Ellipse", "extraInformation": [], - "deprecated": true, - "name": "ForecastTime" + "name": "RadiusY" }, { - "value": "0", + "value": "6", "type": "Number", "unit": "Second", - "label": "Forecast history duration", - "description": "", - "group": "Timing", - "extraInformation": [], - "deprecated": true, - "name": "ForecastHistoryDuration" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "LogLeftwardSpeed" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "LogRightwardSpeed" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "LogDownwardSpeed" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "LogUpwardSpeed" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "DelayedCenterX" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "DelayedCenterY" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ForecastHistoryMeanX" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ForecastHistoryMeanY" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ForecastHistoryVarianceX" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ForecastHistoryCovariance" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ForecastHistoryLinearA" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ForecastHistoryLinearB" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ForecastedX" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ForecastedY" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ProjectedNewestX" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ProjectedNewestY" - }, - { - "value": "", - "type": "Number", - "label": "", + "label": "Loop duration", "description": "", - "group": "", + "group": "Speed", "extraInformation": [], - "hidden": true, - "name": "ProjectedOldestX" + "name": "LoopDuration" }, { "value": "", - "type": "Number", - "label": "", + "type": "Boolean", + "label": "Turn left", "description": "", - "group": "", + "group": "Speed", "extraInformation": [], - "hidden": true, - "name": "ProjectedOldestY" + "name": "InitialTurningLeft" }, { - "value": "", + "value": "0", "type": "Number", - "label": "", + "unit": "DegreeAngle", + "label": "Initial direction", "description": "", - "group": "", + "group": "Speed", "extraInformation": [], - "hidden": true, - "name": "ForecastHistoryVarianceY" + "name": "InitialDirectionAngle" }, { "value": "", - "type": "Number", - "label": "Index (local variable)", + "type": "Boolean", + "label": "Rotate", "description": "", - "group": "", + "group": "Rotation", "extraInformation": [], - "hidden": true, - "name": "Index" + "name": "ShouldRotate" }, { "value": "0", "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "CameraDelayCatchUpSpeed" - }, - { - "value": "", - "type": "Number", - "label": "", + "unit": "DegreeAngle", + "label": "Rotation offset", "description": "", - "group": "", + "group": "Rotation", "extraInformation": [], - "hidden": true, - "name": "CameraExtraDelay" + "name": "RotationOffset" }, { - "value": "", + "value": "0", "type": "Number", "label": "", "description": "", "group": "", "extraInformation": [], "hidden": true, - "name": "WaitingSpeedXMax" + "name": "CenterX" }, { - "value": "", + "value": "0", "type": "Number", "label": "", "description": "", "group": "", "extraInformation": [], "hidden": true, - "name": "WaitingSpeedYMax" + "name": "CenterY" }, { - "value": "", + "value": "0", "type": "Number", "label": "", "description": "", "group": "", "extraInformation": [], "hidden": true, - "name": "WaitingEnd" + "name": "MovementAngle" }, { "value": "", @@ -19864,164 +19710,158 @@ "group": "", "extraInformation": [], "hidden": true, - "name": "CameraDelayCatchUpDuration" - }, - { - "value": "9000", - "type": "Number", - "unit": "PixelSpeed", - "label": "Leftward maximum speed", - "description": "", - "group": "Maximum speed", - "extraInformation": [], - "advanced": true, - "name": "LeftwardSpeedMax" - }, - { - "value": "9000", - "type": "Number", - "unit": "PixelSpeed", - "label": "Rightward maximum speed", - "description": "", - "group": "Maximum speed", - "extraInformation": [], - "advanced": true, - "name": "RightwardSpeedMax" - }, - { - "value": "9000", - "type": "Number", - "unit": "PixelSpeed", - "label": "Upward maximum speed", - "description": "", - "group": "Maximum speed", - "extraInformation": [], - "advanced": true, - "name": "UpwardSpeedMax" - }, - { - "value": "9000", - "type": "Number", - "unit": "PixelSpeed", - "label": "Downward maximum speed", - "description": "", - "group": "Maximum speed", - "extraInformation": [], - "advanced": true, - "name": "DownwardSpeedMax" - }, - { - "value": "", - "type": "Number", - "label": "OldX (local variable)", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, "name": "OldX" }, { "value": "", "type": "Number", - "label": "OldY (local variable)", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "OldY" - }, - { - "value": "", - "type": "Boolean", "label": "", "description": "", "group": "", "extraInformation": [], "hidden": true, - "name": "IsCalledManually" + "name": "OldY" } ], "sharedPropertyDescriptors": [] - }, - { - "description": "Smoothly scroll to follow a character and stabilize the camera when jumping.", - "fullName": "Smooth platformer camera", - "name": "SmoothPlatformerCamera", - "objectType": "", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Camera", + "extensionNamespace": "", + "fullName": "Smooth Camera", + "helpPath": "/tutorials/follow-player-with-camera/", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwO30NCjwvc3R5bGU+DQo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjQsMTNoLTZjLTEuMSwwLTItMC45LTItMlY1YzAtMS4xLDAuOS0yLDItMmg2YzEuMSwwLDIsMC45LDIsMnY2QzI2LDEyLjEsMjUuMSwxMywyNCwxM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yNiw4djEwYzAsMS4xLTAuOSwyLTIsMkg4Yy0xLjEsMC0yLTAuOS0yLTJWOGMwLTEuMSwwLjktMiwyLTJoOCIvPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMjEiIGN5PSI4IiByPSIyIi8+DQo8Y2lyY2xlIGNsYXNzPSJzdDAiIGN4PSIxMSIgY3k9IjE2IiByPSIxIi8+DQo8cmVjdCB4PSI5IiB5PSI5IiBjbGFzcz0ic3QwIiB3aWR0aD0iNCIgaGVpZ2h0PSIzIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIyMSwyOSAyMSwyOSAxMSwyOSAxMSwyOSAiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjE4LDIwIDE4LDI5IDE0LDI5IDE0LDIwICIvPg0KPHJlY3QgeD0iNyIgeT0iMyIgY2xhc3M9InN0MCIgd2lkdGg9IjQiIGhlaWdodD0iMyIvPg0KPC9zdmc+DQo=", + "name": "SmoothCamera", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Computers and Hardware/Computers and Hardware_camcoder_gopro_go_pro_camera.svg", + "shortDescription": "Smoothly scroll to follow an object.", + "version": "0.3.3", + "description": [ + "The camera follows an object according to:", + "- a frame rate independent catch-up speed to make the scrolling from smooth to strong", + "- a maximum speed to do linear following ([open the project online](https://editor.gdevelop.io/?project=example://platformer-with-tilemap)) or slow down the camera when teleporting the object", + "- a follow-free zone to avoid scrolling on small movements", + "- an offset to see further in one direction", + "- an extra delay and catch-up speed to give an impression of speed (useful for dash)", + "- position forecasting and delay to simulate a cameraman response time", + "", + "A platformer dedicated behavior allows to switch of settings when the character is in air or on the floor. This can be used to stabilize the camera when jumping." + ], + "origin": { + "identifier": "SmoothCamera", + "name": "gdevelop-extension-store" + }, + "tags": [ + "camera", + "scrolling", + "follow", + "smooth", + "platformer", + "platform" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Smoothly scroll to follow an object.", + "fullName": "Smooth Camera", + "name": "SmoothCamera", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", "sentence": "", "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Update private properties through setters to check their values and initialize state." + }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "inverted": true, - "value": "PlatformBehavior::IsJumping" + "value": "SmoothCamera::SmoothCamera::SetLeftwardSpeed" }, "parameters": [ "Object", - "PlatformerCharacter" + "Behavior", + "LeftwardSpeed", + "log(1 - )" ] }, { "type": { - "inverted": true, - "value": "PlatformBehavior::IsFalling" + "value": "SmoothCamera::SmoothCamera::SetRightwardSpeed" }, "parameters": [ "Object", - "PlatformerCharacter" + "Behavior", + "RightwardSpeed", + "log(1 - )" ] - } - ], - "actions": [ + }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaBottom" + "value": "SmoothCamera::SmoothCamera::SetUpwardSpeed" }, "parameters": [ "Object", - "SmoothCamera", - "Object.Behavior::PropertyFloorFollowFreeAreaTop()", - "" + "Behavior", + "UpwardSpeed", + "log(1 - )" ] }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaTop" + "value": "SmoothCamera::SmoothCamera::SetDownwardSpeed" }, "parameters": [ "Object", - "SmoothCamera", - "Object.Behavior::PropertyFloorFollowFreeAreaBottom()", - "" + "Behavior", + "DownwardSpeed", + "log(1 - )" ] }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetUpwardSpeed" + "value": "SmoothCamera::SmoothCamera::SetLeftwardSpeedMax" }, "parameters": [ "Object", - "SmoothCamera", - "Object.Behavior::PropertyFloorUpwardSpeed()", - "" + "Behavior", + "LeftwardSpeedMax", + "log(1 - )" ] }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetDownwardSpeed" + "value": "SmoothCamera::SmoothCamera::SetRightwardSpeedMax" }, "parameters": [ "Object", - "SmoothCamera", - "Object.Behavior::PropertyFloorDownwardSpeed()", - "" + "Behavior", + "RightwardSpeedMax", + "log(1 - )" ] }, { @@ -20030,9 +19870,9 @@ }, "parameters": [ "Object", - "SmoothCamera", - "Object.Behavior::PropertyFloorUpwardSpeedMax()", - "" + "Behavior", + "UpwardSpeedMax", + "log(1 - )" ] }, { @@ -20041,53 +19881,31 @@ }, "parameters": [ "Object", - "SmoothCamera", - "Object.Behavior::PropertyFloorDownwardSpeedMax()", - "" + "Behavior", + "DownwardSpeedMax", + "log(1 - )" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "BuiltinCommonInstructions::Or" + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaLeft" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "PlatformBehavior::IsJumping" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - }, - { - "type": { - "value": "PlatformBehavior::IsFalling" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "parameters": [ + "Object", + "Behavior", + "FollowFreeAreaLeft", + "log(1 - )" ] - } - ], - "actions": [ + }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaBottom" + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaRight" }, "parameters": [ "Object", - "SmoothCamera", - "Object.Behavior::PropertyAirFollowFreeAreaTop()", - "" + "Behavior", + "FollowFreeAreaRight", + "log(1 - )" ] }, { @@ -20096,52 +19914,79 @@ }, "parameters": [ "Object", - "SmoothCamera", - "Object.Behavior::PropertyAirFollowFreeAreaBottom()", - "" + "Behavior", + "FollowFreeAreaTop", + "log(1 - )" ] }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetUpwardSpeed" + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaBottom" }, "parameters": [ "Object", - "SmoothCamera", - "Object.Behavior::PropertyAirUpwardSpeed()", - "" + "Behavior", + "FollowFreeAreaBottom", + "log(1 - )" ] }, { "type": { - "value": "SmoothCamera::SmoothCamera::SetDownwardSpeed" + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraDelay" }, "parameters": [ "Object", - "SmoothCamera", - "Object.Behavior::PropertyAirDownwardSpeed()", - "" + "Behavior", + "=", + "CameraDelay" ] - }, + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetUpwardSpeedMax" + "inverted": true, + "value": "SmoothCamera::SmoothCamera::PropertyIsCalledManually" }, "parameters": [ "Object", - "SmoothCamera", - "Object.Behavior::PropertyAirUpwardSpeedMax()", - "" + "Behavior" ] - }, + } + ], + "actions": [ { "type": { - "value": "SmoothCamera::SmoothCamera::SetDownwardSpeedMax" + "value": "SmoothCamera::SmoothCamera::DoMoveCameraCloser" }, "parameters": [ "Object", - "SmoothCamera", - "Object.Behavior::PropertyAirDownwardSpeedMax()", + "Behavior", "" ] } @@ -20157,248 +20002,5204 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SmoothCamera::SmoothPlatformerCamera", + "supplementaryInformation": "SmoothCamera::SmoothCamera", "type": "behavior" } ], "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "Platformer character behavior", - "description": "", - "group": "", - "extraInformation": [ - "PlatformBehavior::PlatformerObjectBehavior" - ], - "name": "PlatformerCharacter" }, { - "value": "", - "type": "Behavior", - "label": "Smooth camera behavior", - "description": "", - "group": "", - "extraInformation": [ - "SmoothCamera::SmoothCamera" + "description": "Move the camera closer to the object. This action must be called after the object has moved for the frame.", + "fullName": "Move the camera closer", + "functionType": "Action", + "name": "MoveCameraCloser", + "sentence": "Move the camera closer to _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The camera following is called with an action, the call from doStepPreEvents must be disabled to avoid to do it twice." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIsCalledManually" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::DoMoveCameraCloser" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } ], - "name": "SmoothCamera" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "JumpOriginY" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Follow free area top in the air", - "description": "", - "group": "Position", - "extraInformation": [], - "name": "AirFollowFreeAreaTop" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Follow free area bottom in the air", - "description": "", - "group": "Position", - "extraInformation": [], - "name": "AirFollowFreeAreaBottom" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Follow free area top on the floor", - "description": "", - "group": "Position", - "extraInformation": [], - "name": "FloorFollowFreeAreaTop" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Follow free area bottom on the floor", - "description": "", - "group": "Position", - "extraInformation": [], - "name": "FloorFollowFreeAreaBottom" - }, - { - "value": "0.95", - "type": "Number", - "label": "Upward speed in the air (in ratio per second)", - "description": "", - "group": "Catch-up speed", - "extraInformation": [], - "name": "AirUpwardSpeed" - }, - { - "value": "0.95", - "type": "Number", - "label": "Downward speed in the air (in ratio per second)", - "description": "", - "group": "Catch-up speed", - "extraInformation": [], - "name": "AirDownwardSpeed" - }, - { - "value": "0.9", - "type": "Number", - "label": "Upward speed on the floor (in ratio per second)", - "description": "", - "group": "Catch-up speed", - "extraInformation": [], - "name": "FloorUpwardSpeed" - }, - { - "value": "0.9", - "type": "Number", - "label": "Downward speed on the floor (in ratio per second)", - "description": "", - "group": "Catch-up speed", - "extraInformation": [], - "name": "FloorDownwardSpeed" - }, - { - "value": "9000", - "type": "Number", - "unit": "PixelSpeed", - "label": "Upward maximum speed in the air", - "description": "", - "group": "Maximum speed", - "extraInformation": [], - "name": "AirUpwardSpeedMax" - }, - { - "value": "9000", - "type": "Number", - "unit": "PixelSpeed", - "label": "Downward maximum speed in the air", - "description": "", - "group": "Maximum speed", - "extraInformation": [], - "name": "AirDownwardSpeedMax" - }, - { - "value": "9000", - "type": "Number", - "unit": "PixelSpeed", - "label": "Upward maximum speed on the floor", - "description": "", - "group": "Maximum speed", - "extraInformation": [], - "name": "FloorUpwardSpeedMax" + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "value": "9000", - "type": "Number", - "unit": "PixelSpeed", - "label": "Downward maximum speed on the floor", - "description": "", - "group": "Maximum speed", - "extraInformation": [], - "name": "FloorDownwardSpeedMax" - } - ], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "Movement", - "extensionNamespace": "", - "fullName": "Hedgehog platformer", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8cGF0aCBkPSJNMTEsMTZjMCwyLjgsMi4yLDUsNSw1czUtMi4yLDUtNXMtMi4yLTUtNS01UzExLDEzLjIsMTEsMTZ6Ii8+DQoJPHBhdGggZD0iTTEyLjIsMTAuOWMwLjEsMCwwLjIsMCwwLjIsMGMwLjUsMCwwLjktMC4zLDEtMC44YzAuMy0xLjMsMC45LTIuNCwxLjktMy4zQzE3LjEsNSwxOS42LDQuNCwyMi4xLDUNCgkJYzAuNSwwLjEsMS4xLTAuMiwxLjItMC43YzAuMS0wLjUtMC4yLTEuMS0wLjctMS4yYy0zLjEtMC44LTYuNCwwLjEtOC43LDIuM2MtMS4yLDEuMi0yLDIuNy0yLjQsNC4zQzExLjQsMTAuMiwxMS43LDEwLjgsMTIuMiwxMC45DQoJCXoiLz4NCgk8cGF0aCBkPSJNOS4yLDE1LjJjMC4yLDAsMC40LDAsMC41LTAuMmMwLjUtMC4zLDAuNi0wLjksMC4zLTEuNGMtMC43LTEuMS0xLTIuNC0xLTMuN2MwLTIuNSwxLjMtNC44LDMuNS02LjENCgkJQzEzLDMuNywxMy4xLDMsMTIuOSwyLjZjLTAuMy0wLjUtMC45LTAuNi0xLjQtMC40QzguNywzLjgsNyw2LjgsNywxMGMwLDEuNywwLjUsMy4zLDEuMyw0LjdDOC41LDE1LDguOSwxNS4yLDkuMiwxNS4yeiIvPg0KCTxwYXRoIGQ9Ik05LjcsMjAuNWMwLjEsMCwwLjIsMCwwLjIsMGMwLjUsMCwwLjktMC4zLDEtMC44YzAuMS0wLjUtMC4yLTEuMS0wLjctMS4yYy0xLjMtMC4zLTIuNC0wLjktMy4zLTEuOUM1LDE0LjksNC40LDEyLjQsNSw5LjkNCgkJYzAuMS0wLjUtMC4yLTEuMS0wLjctMS4yQzMuNyw4LjYsMy4yLDguOSwzLjEsOS40Yy0wLjgsMy4xLDAuMSw2LjQsMi4zLDguN0M2LjYsMTkuMyw4LjEsMjAuMSw5LjcsMjAuNXoiLz4NCgk8cGF0aCBkPSJNMTQuNywyMy43YzAuNS0wLjMsMC42LTAuOSwwLjMtMS40Yy0wLjMtMC41LTAuOS0wLjYtMS40LTAuM2MtMS4xLDAuNy0yLjQsMS0zLjcsMWMtMi41LDAtNC44LTEuMy02LjEtMy41DQoJCUMzLjcsMTksMywxOC45LDIuNiwxOS4xYy0wLjUsMC4zLTAuNiwwLjktMC40LDEuNEMzLjgsMjMuMyw2LjgsMjUsMTAsMjVDMTEuNywyNSwxMy4zLDI0LjUsMTQuNywyMy43eiIvPg0KCTxwYXRoIGQ9Ik0xOS44LDIxLjFjLTAuNS0wLjEtMS4xLDAuMi0xLjIsMC43Yy0wLjMsMS4zLTAuOSwyLjQtMS45LDMuM2MtMS44LDEuOC00LjQsMi41LTYuOCwxLjhjLTAuNS0wLjEtMS4xLDAuMi0xLjIsMC43DQoJCXMwLjIsMS4xLDAuNywxLjJjMC44LDAuMiwxLjUsMC4zLDIuMywwLjNjMi40LDAsNC43LTAuOSw2LjQtMi42YzEuMi0xLjIsMi0yLjcsMi40LTQuM0MyMC42LDIxLjgsMjAuMywyMS4yLDE5LjgsMjEuMXoiLz4NCgk8cGF0aCBkPSJNMjIuMywxNi45Yy0wLjUsMC4zLTAuNiwwLjktMC4zLDEuNGMwLjcsMS4xLDEsMi40LDEsMy43YzAsMi41LTEuMyw0LjgtMy41LDYuMWMtMC41LDAuMy0wLjYsMC45LTAuNCwxLjQNCgkJYzAuMiwwLjMsMC41LDAuNSwwLjksMC41YzAuMiwwLDAuMywwLDAuNS0wLjFjMi44LTEuNiw0LjUtNC42LDQuNS03LjhjMC0xLjctMC41LTMuMy0xLjMtNC43QzIzLjQsMTYuOCwyMi43LDE2LjYsMjIuMywxNi45eiIvPg0KCTxwYXRoIGQ9Ik0yMi4zLDExLjVjLTAuNS0wLjEtMS4xLDAuMi0xLjIsMC43Yy0wLjEsMC41LDAuMiwxLjEsMC43LDEuMmMxLjMsMC4zLDIuNCwwLjksMy4zLDEuOWMxLjgsMS44LDIuNSw0LjQsMS44LDYuOA0KCQljLTAuMSwwLjUsMC4yLDEuMSwwLjcsMS4yYzAuMSwwLDAuMiwwLDAuMywwYzAuNCwwLDAuOC0wLjMsMS0wLjdjMC44LTMuMS0wLjEtNi40LTIuMy04LjdDMjUuNCwxMi43LDIzLjksMTEuOSwyMi4zLDExLjV6Ii8+DQoJPHBhdGggZD0iTTI5LjgsMTEuNUMyOC4yLDguNywyNS4yLDcsMjIsN2MtMS43LDAtMy4zLDAuNS00LjcsMS4zYy0wLjUsMC4zLTAuNiwwLjktMC4zLDEuNGMwLjMsMC41LDAuOSwwLjYsMS40LDAuMw0KCQljMS4xLTAuNywyLjQtMSwzLjctMWMyLjUsMCw0LjgsMS4zLDYuMSwzLjVjMC4yLDAuMywwLjUsMC41LDAuOSwwLjVjMC4yLDAsMC4zLDAsMC41LTAuMUMyOS45LDEyLjYsMzAuMSwxMiwyOS44LDExLjV6Ii8+DQo8L2c+DQo8L3N2Zz4NCg==", - "name": "HedgehogPlatformer", - "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Space/9ea467d2404c1736b87d763c884e9b9dfb13a401360f69c6a17afc8f5d583d58_Space_warp_galaxy.svg", - "shortDescription": "Jump and run on platforms at 360°.", - "version": "1.0.0", - "description": [ - "A platformer engine for Sonic-like games.", - "", - "A small demo shows how to use this extension ([open the project online](https://editor.gdevelop.io/?project=example://360°-platformer))." - ], - "tags": [ - "platformer", - "sonic" - ], - "authorIds": [ - "SEnxPnvGuQhQmTXJ3xwZa1lQFdr1", - "StSwcmCyAkXK5vcKCNaIGbmgxjU2", - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [ - { - "name": "TimeDelta", - "type": "number", - "value": 1 - }, - { - "folded": true, - "name": "SightRadius", - "type": "number", - "value": 0 - } - ], - "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.__hedgehogPlatformerExtension) {", - " return;", - "}", - "", - "/**", - " * Get the platforms manager of an instance container.", - " * ", - " * @param {gdjs.RuntimeInstanceContainer} instanceContainer", - " */", - "function getManager(instanceContainer) {", - " if (!instanceContainer.hedgehogPlatformsObjectsManager) {", - " //Create the shared manager if necessary.", - " instanceContainer.hedgehogPlatformsObjectsManager = new PlatformObjectsManager(", - " instanceContainer", - " );", - " }", - " return instanceContainer.hedgehogPlatformsObjectsManager;", - "}", - "", - "/**", - " * Manages the common objects shared by objects having a", - " * platform behavior: in particular, the platforms behaviors are required to", - " * declare themselves (see PlatformObjectsManager.addPlatform) to the manager", - " * of their associated container (see PlatformRuntimeBehavior.getManager).", - " */", - "class PlatformObjectsManager {", - " _collisionLayerRBushes;", - " /** Platforms near the object, updated with `_updatePotentialCollidingObjects`.", + "description": "Move the camera closer to the object.", + "fullName": "Do move the camera closer", + "functionType": "Action", + "name": "DoMoveCameraCloser", + "private": true, + "sentence": "Do move the camera closer _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Delaying and forecasting can be used at the same time.\nForecasting only use the positions that are older than the one used for delaying.\nThe behavior uses a position history that is split in 2 arrays:\n- one for delaying the position (from TimeFromStart to TimeFromStart - CamearDelay)\n- one for forecasting the position (from TimeFromStart - CamearDelay to TimeFromStart - CamearDelay - ForecastHistoryDuration" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::UpdateDelayedPosition" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::UpdateForecastedPosition" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "At each frame, the camera must catchup the target by a given ratio (speed)\ncameraX(t) - targetX = (cameraX(t - 1) - targetX) * speed\n\nThe frame rate must not impact on the catch-up speed, we don't want a speed in ratio per frame but a speed ratio per second, like this:\ncameraX(t) - targetX = (cameraX(t - 1s) - targetX) * speed\n\nOk, but we still need to process each frame, we can use a exponent for this:\ncameraX(t) - targetX = (cameraX(t - timeDelta) - targetX) * speed^timeDelta\ncameraX(t) = targetX + (cameraX(t - timeDelta) - targetX) * exp(timeDelta * ln(speed))\n\npow is probably more efficient than precalculated log if the speed is changed continuously but this might be rare enough." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyFollowOnX" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyOldX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "CameraX(Object.Layer(), 0)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraX" + }, + "parameters": [ + "", + ">", + "Object.Behavior::FreeAreaRight()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraX" + }, + "parameters": [ + "", + "=", + "Object.Behavior::FreeAreaRight()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaRight())\n* exp(TimeDelta() * LogLeftwardSpeed)", + "Object.Layer()", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraX" + }, + "parameters": [ + "", + "<", + "OldX - LeftwardSpeedMax * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraX" + }, + "parameters": [ + "", + "=", + "OldX - LeftwardSpeedMax * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraX" + }, + "parameters": [ + "", + "<", + "Object.Behavior::FreeAreaLeft()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraX" + }, + "parameters": [ + "", + "=", + "Object.Behavior::FreeAreaLeft()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaLeft())\n* exp(TimeDelta() * LogRightwardSpeed)", + "Object.Layer()", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraX" + }, + "parameters": [ + "", + ">", + "OldX + RightwardSpeedMax * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraX" + }, + "parameters": [ + "", + "=", + "OldX + RightwardSpeedMax * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyFollowOnY" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyOldY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "CameraY(Object.Layer(), 0)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraY" + }, + "parameters": [ + "", + ">", + "Object.Behavior::FreeAreaBottom()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraY" + }, + "parameters": [ + "", + "=", + "Object.Behavior::FreeAreaBottom()\n+ (CameraY(Object.Layer(), 0) - Object.Behavior::FreeAreaBottom())\n* exp(TimeDelta() * LogUpwardSpeed)", + "Object.Layer()", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraY" + }, + "parameters": [ + "", + "<", + "OldY - UpwardSpeedMax * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraY" + }, + "parameters": [ + "", + "=", + "OldY - UpwardSpeedMax * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraY" + }, + "parameters": [ + "", + "<", + "Object.Behavior::FreeAreaTop()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraY" + }, + "parameters": [ + "", + "=", + "Object.Behavior::FreeAreaTop()\n+ (CameraY(Object.Layer(), 0) - Object.Behavior::FreeAreaTop())\n* exp(TimeDelta() * LogDownwardSpeed)", + "Object.Layer()", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraY" + }, + "parameters": [ + "", + ">", + "OldY + DownwardSpeedMax * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraY" + }, + "parameters": [ + "", + "=", + "OldY + DownwardSpeedMax * TimeDelta()", + "Object.Layer()", + "0" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Delay the camera according to a maximum speed and catch up the delay.", + "fullName": "Wait and catch up", + "functionType": "Action", + "name": "WaitAndCatchUp", + "sentence": "Delay the camera of _PARAM0_ during: _PARAM2_ seconds according to the maximum speed _PARAM3_;_PARAM4_ seconds and catch up in _PARAM5_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Maybe the catch-up show be done in constant pixel speed instead of constant time speed." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyWaitingEnd" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "TimeFromStart() + NewWaitingDuration" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyWaitingSpeedXMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "NewWaitingSpeedXMax" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyWaitingSpeedYMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "NewWaitingSpeedYMax" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraDelayCatchUpDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "NewCatchUpDuration" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Wait and catch up\"", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Waiting duration (in seconds)", + "name": "NewWaitingDuration", + "type": "expression" + }, + { + "description": "Waiting maximum camera target speed X", + "name": "NewWaitingSpeedXMax", + "type": "expression" + }, + { + "description": "Waiting maximum camera target speed Y", + "name": "NewWaitingSpeedYMax", + "type": "expression" + }, + { + "description": "Catch up duration (in seconds)", + "name": "NewCatchUpDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Draw the targeted and actual camera position.", + "fullName": "Draw debug", + "functionType": "Action", + "name": "DrawDebug", + "sentence": "Draw targeted and actual camera position for _PARAM0_ on _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::FillOpacity" + }, + "parameters": [ + "ShapePainter", + "=", + "0" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Path used by the forecasting", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime)", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::OutlineColor" + }, + "parameters": [ + "ShapePainter", + "\"245;166;35\"" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::BeginFillPath" + }, + "parameters": [ + "ShapePainter", + "Object.Variable(__SmoothCamera.ForecastHistoryX[0])", + "Object.Variable(__SmoothCamera.ForecastHistoryY[0])" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "Object.VariableChildCount(__SmoothCamera.ForecastHistoryX)", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::PathLineTo" + }, + "parameters": [ + "ShapePainter", + "Object.Variable(__SmoothCamera.ForecastHistoryX[Index])", + "Object.Variable(__SmoothCamera.ForecastHistoryY[Index])" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::EndFillPath" + }, + "parameters": [ + "ShapePainter" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Follow-free area.", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyFollowFreeAreaLeft" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyFollowFreeAreaRight" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyFollowFreeAreaTop" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyFollowFreeAreaBottom" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::OutlineColor" + }, + "parameters": [ + "ShapePainter", + "\"126;211;33\"" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::Rectangle" + }, + "parameters": [ + "ShapePainter", + "Object.Behavior::FreeAreaLeft() - 1", + "Object.Behavior::FreeAreaTop() - 1", + "Object.Behavior::FreeAreaRight() + 1", + "Object.Behavior::FreeAreaBottom() + 1" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Linear regression vector used by the forecasting.", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::OutlineColor" + }, + "parameters": [ + "ShapePainter", + "\"208;2;27\"" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::LineV2" + }, + "parameters": [ + "ShapePainter", + "ProjectedOldestX", + "ProjectedOldestY", + "ProjectedNewestX", + "ProjectedNewestY", + "1" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Targeted and actual camera position", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::Circle" + }, + "parameters": [ + "ShapePainter", + "ForecastedX", + "ForecastedY", + "3" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::LineV2" + }, + "parameters": [ + "ShapePainter", + "CameraX(Object.Layer(), 0)", + "CameraY(Object.Layer(), 0) - 4", + "CameraX(Object.Layer(), 0)", + "CameraY(Object.Layer(), 0) + 4", + "1" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::LineV2" + }, + "parameters": [ + "ShapePainter", + "CameraX(Object.Layer(), 0) - 4", + "CameraY(Object.Layer(), 0)", + "CameraX(Object.Layer(), 0) + 4", + "CameraY(Object.Layer(), 0)", + "1" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Shape painter", + "name": "ShapePainter", + "supplementaryInformation": "PrimitiveDrawing::Drawer", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Enable or disable the following on X axis.", + "fullName": "Follow on X", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetFollowOnX", + "sentence": "The camera follows _PARAM0_ on X axis: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowOnX" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowOnX" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Follow on X axis", + "name": "Value", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Enable or disable the following on Y axis.", + "fullName": "Follow on Y", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetFollowOnY", + "sentence": "The camera follows _PARAM0_ on Y axis: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowOnY" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowOnY" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Follow on Y axis", + "name": "Value", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera follow free area right border.", + "fullName": "Follow free area right border", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetFollowFreeAreaRight", + "sentence": "Change the camera follow free area right border of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowFreeAreaTop" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Follow free area right border", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera follow free area left border.", + "fullName": "Follow free area left border", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetFollowFreeAreaLeft", + "sentence": "Change the camera follow free area left border of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowFreeAreaTop" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Follow free area left border", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera follow free area top border.", + "fullName": "Follow free area top border", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetFollowFreeAreaTop", + "sentence": "Change the camera follow free area top border of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowFreeAreaTop" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Follow free area top border", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera follow free area bottom border.", + "fullName": "Follow free area bottom border", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetFollowFreeAreaBottom", + "sentence": "Change the camera follow free area bottom border of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyFollowFreeAreaBottom" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Follow free area bottom border", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera leftward maximum speed (in pixels per second).", + "fullName": "Leftward maximum speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetLeftwardSpeedMax", + "sentence": "Change the camera leftward maximum speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyLeftwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Leftward maximum speed (in ratio per second)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera rightward maximum speed (in pixels per second).", + "fullName": "Rightward maximum speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetRightwardSpeedMax", + "sentence": "Change the camera rightward maximum speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyLeftwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Rightward maximum speed (in pixels per second)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera upward maximum speed (in pixels per second).", + "fullName": "Upward maximum speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetUpwardSpeedMax", + "sentence": "Change the camera upward maximum speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyUpwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Upward maximum speed (in pixels per second)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera downward maximum speed (in pixels per second).", + "fullName": "Downward maximum speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetDownwardSpeedMax", + "sentence": "Change the camera downward maximum speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDownwardSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Downward maximum speed (in pixels per second)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera leftward catch-up speed (in ratio per second).", + "fullName": "Leftward catch-up speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetLeftwardSpeed", + "sentence": "Change the camera leftward catch-up speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyLeftwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(0, 1, Value)" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyLogLeftwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "log(1 - Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Leftward catch-up speed (in ratio per second)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera rightward catch-up speed (in ratio per second).", + "fullName": "Rightward catch-up speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetRightwardSpeed", + "sentence": "Change the camera rightward catch-up speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyRightwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(0, 1, Value)" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyLogRightwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "log(1 - Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Rightward catch-up speed (in ratio per second)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera downward catch-up speed (in ratio per second).", + "fullName": "Downward catch-up speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetDownwardSpeed", + "sentence": "Change the camera downward catch-up speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDownwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(0, 1, Value)" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyLogDownwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "log(1 - Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Downward catch-up speed (in ratio per second)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera upward catch-up speed (in ratio per second).", + "fullName": "Upward catch-up speed", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetUpwardSpeed", + "sentence": "Change the camera upward catch-up speed of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyUpwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "clamp(0, 1, Value)" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyLogUpwardSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "log(1 - Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Upward catch-up speed (in ratio per second)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the camera offset on X axis of the object. This is not the current difference between the object and the camera position.", + "fullName": "Camera offset X", + "functionType": "ExpressionAndCondition", + "group": "Camera configuration", + "name": "OffsetX", + "sentence": "the camera offset on X axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "CameraOffsetX" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "OffsetX", + "name": "SetOffsetXOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraOffsetX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera offset on X axis of an object.", + "fullName": "Camera Offset X", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetOffsetX", + "private": true, + "sentence": "Change the camera offset on X axis of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Deprecated use SetOffsetXOp instead." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetOffsetXOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Camera offset X", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the camera offset on Y axis of the object. This is not the current difference between the object and the camera position.", + "fullName": "Camera offset Y", + "functionType": "ExpressionAndCondition", + "group": "Camera configuration", + "name": "OffsetY", + "sentence": "the camera offset on Y axis", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "CameraOffsetY" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "OffsetY", + "name": "SetOffsetYOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Deprecated use SetOffsetYOp instead." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraOffsetY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera offset on Y axis of an object.", + "fullName": "Camera Offset Y", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetOffsetY", + "private": true, + "sentence": "Change the camera offset on Y axis of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetOffsetYOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "CameraOffsetY", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Camera offset Y", + "name": "CameraOffsetY", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera forecast time (in seconds).", + "fullName": "Forecast time", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetForecastTime", + "sentence": "Change the camera forecast time of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(0, Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Forecast time", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the camera delay (in seconds).", + "fullName": "Camera delay", + "functionType": "Action", + "group": "Camera configuration", + "name": "SetCameraDelay", + "sentence": "Change the camera delay of _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraDelay" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(0, Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Camera delay", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return follow free area left border X.", + "fullName": "Free area left", + "functionType": "Expression", + "group": "Private", + "name": "FreeAreaLeft", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ForecastedX + CameraOffsetX - FollowFreeAreaLeft" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return follow free area right border X.", + "fullName": "Free area right", + "functionType": "Expression", + "group": "Private", + "name": "FreeAreaRight", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ForecastedX + CameraOffsetX + FollowFreeAreaRight" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return follow free area bottom border Y.", + "fullName": "Free area bottom", + "functionType": "Expression", + "group": "Private", + "name": "FreeAreaBottom", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ForecastedY + CameraOffsetY + FollowFreeAreaBottom" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return follow free area top border Y.", + "fullName": "Free area top", + "functionType": "Expression", + "group": "Private", + "name": "FreeAreaTop", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ForecastedY + CameraOffsetY - FollowFreeAreaTop" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Update delayed position and delayed history. This is called in doStepPreEvents.", + "fullName": "Update delayed position", + "functionType": "Action", + "group": "Private", + "name": "UpdateDelayedPosition", + "private": true, + "sentence": "Update delayed position and delayed history of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Add the previous position to have enough (2) positions to evaluate the extra delay for waiting mode." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::IsWaiting" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.VariableChildCount(__SmoothCamera.ObjectTime)", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectTime", + "TimeFromStart()" + ] + }, + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectX", + "DelayedCenterX" + ] + }, + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectY", + "DelayedCenterY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Use the object center when no delay is asked." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.CenterX()" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.CenterY()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SmoothCamera::SmoothCamera::IsDelayed" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::AddForecastHistoryPosition" + }, + "parameters": [ + "Object", + "Behavior", + "TimeFromStart()", + "Object.CenterX()", + "Object.CenterY()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::IsDelayed" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::IsWaiting" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectTime", + "TimeFromStart()" + ] + }, + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectX", + "Object.CenterX()" + ] + }, + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectY", + "Object.CenterY()" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Remove history entries that are too old to be useful for delaying and pass it to the history for forecasting." + }, + { + "infiniteLoopWarning": true, + "type": "BuiltinCommonInstructions::While", + "whileConditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.VariableChildCount(__SmoothCamera.ObjectTime)", + ">=", + "2" + ] + }, + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectTime[1]", + "<", + "TimeFromStart() - Object.Behavior::CurrentDelay()" + ] + } + ], + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::AddForecastHistoryPosition" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Variable(__SmoothCamera.ObjectTime[0])", + "Object.Variable(__SmoothCamera.ObjectX[0])", + "Object.Variable(__SmoothCamera.ObjectY[0])", + "" + ] + }, + { + "type": { + "value": "ObjectVariableRemoveAt" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectTime", + "0" + ] + }, + { + "type": { + "value": "ObjectVariableRemoveAt" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectX", + "0" + ] + }, + { + "type": { + "value": "ObjectVariableRemoveAt" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectY", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Don't move the camera if there is not enough history." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Variable(__SmoothCamera.ObjectX[0])" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Variable(__SmoothCamera.ObjectY[0])" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.VariableChildCount(__SmoothCamera.ObjectTime)", + ">=", + "2" + ] + }, + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectTime[0]", + "<", + "TimeFromStart() - Object.Behavior::CurrentDelay()" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Add the extra delay that could be needed to respect the speed limit in waiting mode.\n\nspeedRatio = min(speedMaxX / historySpeedX, speedMaxY / historySpeedY)\ndelay += min(0, timeDelta * (1 - speedRatio))" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::IsWaiting" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraExtraDelay" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "max(0, TimeDelta() * (1 - min(WaitingSpeedXMax * abs(Object.Variable(__SmoothCamera.ObjectX[1]) - Object.Variable(__SmoothCamera.ObjectX[0])), WaitingSpeedYMax * abs(Object.Variable(__SmoothCamera.ObjectY[1]) - Object.Variable(__SmoothCamera.ObjectY[0]))) / (Object.Variable(__SmoothCamera.ObjectTime[1]) - Object.Variable(__SmoothCamera.ObjectTime[0]))))" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Extra delay: \" + ToString(CameraExtraDelay)", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The time with delay is now between the first 2 indexes" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "lerp(Object.Variable(__SmoothCamera.ObjectX[1]), Object.Variable(__SmoothCamera.ObjectX[0]), ((TimeFromStart() - Object.Behavior::CurrentDelay()) - Object.Variable(__SmoothCamera.ObjectTime[1])) / (Object.Variable(__SmoothCamera.ObjectTime[0]) - Object.Variable(__SmoothCamera.ObjectTime[1])))" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyDelayedCenterY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "lerp(Object.Variable(__SmoothCamera.ObjectY[1]), Object.Variable(__SmoothCamera.ObjectY[0]), ((TimeFromStart() - Object.Behavior::CurrentDelay()) - Object.Variable(__SmoothCamera.ObjectTime[1])) / (Object.Variable(__SmoothCamera.ObjectTime[0]) - Object.Variable(__SmoothCamera.ObjectTime[1])))" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SmoothCamera::SmoothCamera::IsDelayed" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "SmoothCamera::SmoothCamera::IsWaiting" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ObjectVariableClearChildren" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectTime" + ] + }, + { + "type": { + "value": "ObjectVariableClearChildren" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectX" + ] + }, + { + "type": { + "value": "ObjectVariableClearChildren" + }, + "parameters": [ + "Object", + "__SmoothCamera.ObjectY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SmoothCamera::SmoothCamera::IsWaiting" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraDelayCatchUpSpeed" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "CameraExtraDelay / CameraDelayCatchUpDuration" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Start to catch up\"", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SmoothCamera::SmoothCamera::IsWaiting" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyCameraExtraDelay" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyCameraExtraDelay" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "max(0, CameraExtraDelay -CameraDelayCatchUpSpeed * TimeDelta())" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Catching up delay: \" + ToString(CameraExtraDelay)", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the camera following target is delayed from the object.", + "fullName": "Camera is delayed", + "functionType": "Condition", + "name": "IsDelayed", + "private": true, + "sentence": "The camera of _PARAM0_ is delayed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.Behavior::CurrentDelay()", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Return the current camera delay.", + "fullName": "Current delay", + "functionType": "Expression", + "name": "CurrentDelay", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "CameraDelay + CameraExtraDelay" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the camera following is waiting at a reduced speed.", + "fullName": "Camera is waiting", + "functionType": "Condition", + "name": "IsWaiting", + "private": true, + "sentence": "The camera of _PARAM0_ is waiting", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyWaitingEnd" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "TimeFromStart()" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Add a position to the history for forecasting. This is called 2 times in UpadteDelayedPosition.", + "fullName": "Add forecast history position", + "functionType": "Action", + "group": "Private", + "name": "AddForecastHistoryPosition", + "private": true, + "sentence": "Add the time:_PARAM2_ and position: _PARAM3_; _PARAM4_ to the forecast history of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyForecastHistoryDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyForecastTime" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ForecastHistoryTime", + "Time" + ] + }, + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ForecastHistoryX", + "ObjectX" + ] + }, + { + "type": { + "value": "ObjectVariablePushNumber" + }, + "parameters": [ + "Object", + "__SmoothCamera.ForecastHistoryY", + "ObjectY" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Remove history entries that are too old to be useful.\nKeep at least 2 positions because no forecast can be done with less positions." + }, + { + "infiniteLoopWarning": true, + "type": "BuiltinCommonInstructions::While", + "whileConditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime)", + ">=", + "3" + ] + }, + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__SmoothCamera.ForecastHistoryTime[0]", + "<", + "TimeFromStart() - CameraDelay - CameraExtraDelay - ForecastHistoryDuration" + ] + } + ], + "conditions": [], + "actions": [ + { + "type": { + "value": "ObjectVariableRemoveAt" + }, + "parameters": [ + "Object", + "__SmoothCamera.ForecastHistoryTime", + "0" + ] + }, + { + "type": { + "value": "ObjectVariableRemoveAt" + }, + "parameters": [ + "Object", + "__SmoothCamera.ForecastHistoryX", + "0" + ] + }, + { + "type": { + "value": "ObjectVariableRemoveAt" + }, + "parameters": [ + "Object", + "__SmoothCamera.ForecastHistoryY", + "0" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "Time", + "name": "Time", + "type": "expression" + }, + { + "description": "Object X", + "name": "ObjectX", + "type": "expression" + }, + { + "description": "Object Y", + "name": "ObjectY", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Update forecasted position. This is called in doStepPreEvents.", + "fullName": "Update forecasted position", + "functionType": "Action", + "group": "Private", + "name": "UpdateForecastedPosition", + "private": true, + "sentence": "Update forecasted position of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "DelayedCenterX" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "DelayedCenterY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Simple linear regression\ny = A * x + B\n\nA = Covariance / VarianceX\nB = MeanY - A * MeanX\n\nNote than we could use only one position every N positions to reduce the process time,\nbut if we really need efficient process JavaScript and circular queues are a must." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime)", + ">=", + "2" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyForecastHistoryDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::PropertyForecastTime" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ] + } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Mean X", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "Object.VariableChildCount(__SmoothCamera.ForecastHistoryX)", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanX" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Object.Variable(__SmoothCamera.ForecastHistoryX[Index])" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanX" + }, + "parameters": [ + "Object", + "Behavior", + "/", + "Object.VariableChildCount(__SmoothCamera.ForecastHistoryX)" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Mean Y", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "Object.VariableChildCount(__SmoothCamera.ForecastHistoryY)", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanY" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Object.Variable(__SmoothCamera.ForecastHistoryY[Index])" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryMeanY" + }, + "parameters": [ + "Object", + "Behavior", + "/", + "Object.VariableChildCount(__SmoothCamera.ForecastHistoryY)" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Mean: \" + ToString(ForecastHistoryMeanX) + \" \" + ToString(ForecastHistoryMeanY)", + "", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Variance and Covariance", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "VarianceX = sum((X[i] - MeanX)²)\nVarianceY = sum((Y[i] - MeanY)²)\nCovariance = sum((X[i] - MeanX) * (Y[i] - MeanY))" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryVarianceX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryVarianceY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryCovariance" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "Object.VariableChildCount(__SmoothCamera.ForecastHistoryX)", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryVarianceX" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "pow(Object.Variable(__SmoothCamera.ForecastHistoryX[Index]) - ForecastHistoryMeanX, 2)" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryVarianceY" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "pow(Object.Variable(__SmoothCamera.ForecastHistoryY[Index]) - ForecastHistoryMeanY, 2)" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryCovariance" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "(Object.Variable(__SmoothCamera.ForecastHistoryX[Index]) - ForecastHistoryMeanX)\n*\n(Object.Variable(__SmoothCamera.ForecastHistoryY[Index]) - ForecastHistoryMeanY)" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Variances: \" + ToString(ForecastHistoryVarianceX) + \" \" + ToString(ForecastHistoryVarianceY) + \" \" + ToString(ForecastHistoryCovariance)", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "abs(ForecastHistoryVarianceX)", + "<", + "1" + ] + }, + { + "type": { + "value": "Egal" + }, + "parameters": [ + "abs(ForecastHistoryVarianceY)", + "<", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "DelayedCenterX" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "DelayedCenterY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "abs(ForecastHistoryVarianceX)", + ">=", + "1" + ] + }, + { + "type": { + "value": "Egal" + }, + "parameters": [ + "abs(ForecastHistoryVarianceY)", + ">=", + "1" + ] + } + ] + } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Linear function parameters", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "y = A * x + B\n\nA = Covariance / VarianceX\nB = MeanY - A * MeanX" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "abs(ForecastHistoryVarianceX)", + ">=", + "abs(ForecastHistoryVarianceY)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryLinearA" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ForecastHistoryCovariance / ForecastHistoryVarianceX" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryLinearB" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ForecastHistoryMeanY - ForecastHistoryLinearA * ForecastHistoryMeanX" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Linear: \" + ToString(ForecastHistoryLinearA) + \" \" + ToString(ForecastHistoryLinearB)", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Projection", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::ProjectHistoryEnds" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Variable(__SmoothCamera.ForecastHistoryX[0])", + "Object.Variable(__SmoothCamera.ForecastHistoryY[0])", + "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.VariableChildCount(__SmoothCamera.ForecastHistoryX) - 1])", + "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.VariableChildCount(__SmoothCamera.ForecastHistoryY) - 1])", + "" + ] + } + ] + } + ], + "parameters": [] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Axis permutation to avoid a ratio between 2 numbers near 0." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "abs(ForecastHistoryVarianceX)", + "<", + "abs(ForecastHistoryVarianceY)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryLinearA" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ForecastHistoryCovariance / ForecastHistoryVarianceY" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastHistoryLinearB" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ForecastHistoryMeanX - ForecastHistoryLinearA * ForecastHistoryMeanY" + ] + } + ], + "events": [ + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Linear: \" + ToString(ForecastHistoryLinearA) + \" \" + ToString(ForecastHistoryLinearB)", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Projection", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::ProjectHistoryEnds" + }, + "parameters": [ + "Object", + "Behavior", + "Object.Variable(__SmoothCamera.ForecastHistoryY[0])", + "Object.Variable(__SmoothCamera.ForecastHistoryX[0])", + "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.VariableChildCount(__SmoothCamera.ForecastHistoryY) - 1])", + "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.VariableChildCount(__SmoothCamera.ForecastHistoryX) - 1])", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Permute back axis" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ProjectedOldestX" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedOldestX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ProjectedOldestY" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedOldestY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Index" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ProjectedNewestX" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedNewestX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ProjectedNewestY" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedNewestY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Index" + ] + } + ] + } + ], + "parameters": [] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Oldest: \" + ToString(ProjectedOldestX) + \" \" + ToString(ProjectedOldestY)", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Newest: \" + ToString(ProjectedNewestX) + \" \" + ToString(ProjectedNewestY)", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Forecasted position", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ProjectedNewestX + ( ProjectedNewestX - ProjectedOldestX) * Object.Behavior::ForecastTimeRatio()" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyForecastedY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ProjectedNewestY + ( ProjectedNewestY - ProjectedOldestY) * Object.Behavior::ForecastTimeRatio()" + ] + } + ] + }, + { + "disabled": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "DebuggerTools::ConsoleLog" + }, + "parameters": [ + "\"Forecasted: \" + ToString(ForecastedX) + \" \" + ToString(ForecastedY)", + "\"info\"", + "\"SmoothCamera\"" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Project history ends position to have the vector on the line from linear regression. This function is only called by UpdateForecastedPosition.", + "fullName": "Project history ends", + "functionType": "Action", + "group": "Private", + "name": "ProjectHistoryEnds", + "private": true, + "sentence": "Project history oldest: _PARAM2_;_PARAM3_ and newest position: _PARAM4_;_PARAM5_ of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Perpendicular line:\npA = -1/a; \npB = -pA * x + y\n\nIntersection:\n/ ProjectedY = a * ProjectedX + b\n\\ ProjectedY = pA * ProjectedX + b\n\nSolution that is cleaned out from indeterminism (like 0 / 0 or infinity / infinity):\nProjectedX= (x + (y - b) * a) / (a² + 1)\nProjectedY = y + (x * a - y + b) / (a² + 1)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedNewestX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "(NewestX + (NewestY - ForecastHistoryLinearB) * ForecastHistoryLinearA) / (1 + pow(ForecastHistoryLinearA, 2))" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedNewestY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "NewestY + (NewestX * ForecastHistoryLinearA - NewestY \n+ ForecastHistoryLinearB) / (1 + pow(ForecastHistoryLinearA, 2))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedOldestX" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "(OldestX + (OldestY - ForecastHistoryLinearB) * ForecastHistoryLinearA) / (1 + pow(ForecastHistoryLinearA, 2))" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetPropertyProjectedOldestY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "OldestY + (OldestX * ForecastHistoryLinearA - OldestY \n+ ForecastHistoryLinearB) / (1 + pow(ForecastHistoryLinearA, 2))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + }, + { + "description": "OldestX", + "name": "OldestX", + "type": "expression" + }, + { + "description": "OldestY", + "name": "OldestY", + "type": "expression" + }, + { + "description": "Newest X", + "name": "NewestX", + "type": "expression" + }, + { + "description": "Newest Y", + "name": "NewestY", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the ratio between forecast time and the duration of the history. This function is only called by UpdateForecastedPosition.", + "fullName": "Forecast time ratio", + "functionType": "Expression", + "group": "Private", + "name": "ForecastTimeRatio", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "- ForecastTime / (Object.Variable(__SmoothCamera.ForecastHistoryTime[0]) - Object.Variable(__SmoothCamera.ForecastHistoryTime[Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime) - 1]))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothCamera", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0.9", + "type": "Number", + "label": "Leftward catch-up speed (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "LeftwardSpeed" + }, + { + "value": "0.9", + "type": "Number", + "label": "Rightward catch-up speed (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "RightwardSpeed" + }, + { + "value": "0.9", + "type": "Number", + "label": "Upward catch-up speed (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "UpwardSpeed" + }, + { + "value": "0.9", + "type": "Number", + "label": "Downward catch-up speed (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "DownwardSpeed" + }, + { + "value": "true", + "type": "Boolean", + "label": "Follow on X axis", + "description": "", + "group": "", + "extraInformation": [], + "name": "FollowOnX" + }, + { + "value": "true", + "type": "Boolean", + "label": "Follow on Y axis", + "description": "", + "group": "", + "extraInformation": [], + "name": "FollowOnY" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area left border", + "description": "", + "group": "Position", + "extraInformation": [], + "advanced": true, + "name": "FollowFreeAreaLeft" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area right border", + "description": "", + "group": "Position", + "extraInformation": [], + "advanced": true, + "name": "FollowFreeAreaRight" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area top border", + "description": "", + "group": "Position", + "extraInformation": [], + "advanced": true, + "name": "FollowFreeAreaTop" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area bottom border", + "description": "", + "group": "Position", + "extraInformation": [], + "advanced": true, + "name": "FollowFreeAreaBottom" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Camera offset X", + "description": "", + "group": "Position", + "extraInformation": [], + "advanced": true, + "name": "CameraOffsetX" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Camera offset Y", + "description": "", + "group": "Position", + "extraInformation": [], + "advanced": true, + "name": "CameraOffsetY" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Camera delay", + "description": "", + "group": "Timing", + "extraInformation": [], + "deprecated": true, + "name": "CameraDelay" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Forecast time", + "description": "", + "group": "Timing", + "extraInformation": [], + "deprecated": true, + "name": "ForecastTime" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Forecast history duration", + "description": "", + "group": "Timing", + "extraInformation": [], + "deprecated": true, + "name": "ForecastHistoryDuration" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "LogLeftwardSpeed" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "LogRightwardSpeed" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "LogDownwardSpeed" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "LogUpwardSpeed" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "DelayedCenterX" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "DelayedCenterY" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastHistoryMeanX" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastHistoryMeanY" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastHistoryVarianceX" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastHistoryCovariance" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastHistoryLinearA" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastHistoryLinearB" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastedX" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastedY" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ProjectedNewestX" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ProjectedNewestY" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ProjectedOldestX" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ProjectedOldestY" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ForecastHistoryVarianceY" + }, + { + "value": "", + "type": "Number", + "label": "Index (local variable)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Index" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CameraDelayCatchUpSpeed" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CameraExtraDelay" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "WaitingSpeedXMax" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "WaitingSpeedYMax" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "WaitingEnd" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CameraDelayCatchUpDuration" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Leftward maximum speed", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "advanced": true, + "name": "LeftwardSpeedMax" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Rightward maximum speed", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "advanced": true, + "name": "RightwardSpeedMax" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Upward maximum speed", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "advanced": true, + "name": "UpwardSpeedMax" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Downward maximum speed", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "advanced": true, + "name": "DownwardSpeedMax" + }, + { + "value": "", + "type": "Number", + "label": "OldX (local variable)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "OldX" + }, + { + "value": "", + "type": "Number", + "label": "OldY (local variable)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "OldY" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsCalledManually" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Smoothly scroll to follow a character and stabilize the camera when jumping.", + "fullName": "Smooth platformer camera", + "name": "SmoothPlatformerCamera", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PlatformBehavior::IsJumping" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + }, + { + "type": { + "inverted": true, + "value": "PlatformBehavior::IsFalling" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaBottom" + }, + "parameters": [ + "Object", + "SmoothCamera", + "FloorFollowFreeAreaTop", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaTop" + }, + "parameters": [ + "Object", + "SmoothCamera", + "FloorFollowFreeAreaBottom", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetUpwardSpeed" + }, + "parameters": [ + "Object", + "SmoothCamera", + "FloorUpwardSpeed", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetDownwardSpeed" + }, + "parameters": [ + "Object", + "SmoothCamera", + "FloorDownwardSpeed", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetUpwardSpeedMax" + }, + "parameters": [ + "Object", + "SmoothCamera", + "FloorUpwardSpeedMax", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetDownwardSpeedMax" + }, + "parameters": [ + "Object", + "SmoothCamera", + "FloorDownwardSpeedMax", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "PlatformBehavior::IsJumping" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + }, + { + "type": { + "value": "PlatformBehavior::IsFalling" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaBottom" + }, + "parameters": [ + "Object", + "SmoothCamera", + "AirFollowFreeAreaTop", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetFollowFreeAreaTop" + }, + "parameters": [ + "Object", + "SmoothCamera", + "AirFollowFreeAreaBottom", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetUpwardSpeed" + }, + "parameters": [ + "Object", + "SmoothCamera", + "AirUpwardSpeed", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetDownwardSpeed" + }, + "parameters": [ + "Object", + "SmoothCamera", + "AirDownwardSpeed", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetUpwardSpeedMax" + }, + "parameters": [ + "Object", + "SmoothCamera", + "AirUpwardSpeedMax", + "" + ] + }, + { + "type": { + "value": "SmoothCamera::SmoothCamera::SetDownwardSpeedMax" + }, + "parameters": [ + "Object", + "SmoothCamera", + "AirDownwardSpeedMax", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SmoothCamera::SmoothPlatformerCamera", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Platformer character behavior", + "description": "", + "group": "", + "extraInformation": [ + "PlatformBehavior::PlatformerObjectBehavior" + ], + "name": "PlatformerCharacter" + }, + { + "value": "", + "type": "Behavior", + "label": "Smooth camera behavior", + "description": "", + "group": "", + "extraInformation": [ + "SmoothCamera::SmoothCamera" + ], + "name": "SmoothCamera" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "JumpOriginY" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area top in the air", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "AirFollowFreeAreaTop" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area bottom in the air", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "AirFollowFreeAreaBottom" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area top on the floor", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "FloorFollowFreeAreaTop" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Follow free area bottom on the floor", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "FloorFollowFreeAreaBottom" + }, + { + "value": "0.95", + "type": "Number", + "label": "Upward speed in the air (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "AirUpwardSpeed" + }, + { + "value": "0.95", + "type": "Number", + "label": "Downward speed in the air (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "AirDownwardSpeed" + }, + { + "value": "0.9", + "type": "Number", + "label": "Upward speed on the floor (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "FloorUpwardSpeed" + }, + { + "value": "0.9", + "type": "Number", + "label": "Downward speed on the floor (in ratio per second)", + "description": "", + "group": "Catch-up speed", + "extraInformation": [], + "name": "FloorDownwardSpeed" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Upward maximum speed in the air", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "name": "AirUpwardSpeedMax" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Downward maximum speed in the air", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "name": "AirDownwardSpeedMax" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Upward maximum speed on the floor", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "name": "FloorUpwardSpeedMax" + }, + { + "value": "9000", + "type": "Number", + "unit": "PixelSpeed", + "label": "Downward maximum speed on the floor", + "description": "", + "group": "Maximum speed", + "extraInformation": [], + "name": "FloorDownwardSpeedMax" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Movement", + "extensionNamespace": "", + "fullName": "Hedgehog platformer", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8cGF0aCBkPSJNMTEsMTZjMCwyLjgsMi4yLDUsNSw1czUtMi4yLDUtNXMtMi4yLTUtNS01UzExLDEzLjIsMTEsMTZ6Ii8+DQoJPHBhdGggZD0iTTEyLjIsMTAuOWMwLjEsMCwwLjIsMCwwLjIsMGMwLjUsMCwwLjktMC4zLDEtMC44YzAuMy0xLjMsMC45LTIuNCwxLjktMy4zQzE3LjEsNSwxOS42LDQuNCwyMi4xLDUNCgkJYzAuNSwwLjEsMS4xLTAuMiwxLjItMC43YzAuMS0wLjUtMC4yLTEuMS0wLjctMS4yYy0zLjEtMC44LTYuNCwwLjEtOC43LDIuM2MtMS4yLDEuMi0yLDIuNy0yLjQsNC4zQzExLjQsMTAuMiwxMS43LDEwLjgsMTIuMiwxMC45DQoJCXoiLz4NCgk8cGF0aCBkPSJNOS4yLDE1LjJjMC4yLDAsMC40LDAsMC41LTAuMmMwLjUtMC4zLDAuNi0wLjksMC4zLTEuNGMtMC43LTEuMS0xLTIuNC0xLTMuN2MwLTIuNSwxLjMtNC44LDMuNS02LjENCgkJQzEzLDMuNywxMy4xLDMsMTIuOSwyLjZjLTAuMy0wLjUtMC45LTAuNi0xLjQtMC40QzguNywzLjgsNyw2LjgsNywxMGMwLDEuNywwLjUsMy4zLDEuMyw0LjdDOC41LDE1LDguOSwxNS4yLDkuMiwxNS4yeiIvPg0KCTxwYXRoIGQ9Ik05LjcsMjAuNWMwLjEsMCwwLjIsMCwwLjIsMGMwLjUsMCwwLjktMC4zLDEtMC44YzAuMS0wLjUtMC4yLTEuMS0wLjctMS4yYy0xLjMtMC4zLTIuNC0wLjktMy4zLTEuOUM1LDE0LjksNC40LDEyLjQsNSw5LjkNCgkJYzAuMS0wLjUtMC4yLTEuMS0wLjctMS4yQzMuNyw4LjYsMy4yLDguOSwzLjEsOS40Yy0wLjgsMy4xLDAuMSw2LjQsMi4zLDguN0M2LjYsMTkuMyw4LjEsMjAuMSw5LjcsMjAuNXoiLz4NCgk8cGF0aCBkPSJNMTQuNywyMy43YzAuNS0wLjMsMC42LTAuOSwwLjMtMS40Yy0wLjMtMC41LTAuOS0wLjYtMS40LTAuM2MtMS4xLDAuNy0yLjQsMS0zLjcsMWMtMi41LDAtNC44LTEuMy02LjEtMy41DQoJCUMzLjcsMTksMywxOC45LDIuNiwxOS4xYy0wLjUsMC4zLTAuNiwwLjktMC40LDEuNEMzLjgsMjMuMyw2LjgsMjUsMTAsMjVDMTEuNywyNSwxMy4zLDI0LjUsMTQuNywyMy43eiIvPg0KCTxwYXRoIGQ9Ik0xOS44LDIxLjFjLTAuNS0wLjEtMS4xLDAuMi0xLjIsMC43Yy0wLjMsMS4zLTAuOSwyLjQtMS45LDMuM2MtMS44LDEuOC00LjQsMi41LTYuOCwxLjhjLTAuNS0wLjEtMS4xLDAuMi0xLjIsMC43DQoJCXMwLjIsMS4xLDAuNywxLjJjMC44LDAuMiwxLjUsMC4zLDIuMywwLjNjMi40LDAsNC43LTAuOSw2LjQtMi42YzEuMi0xLjIsMi0yLjcsMi40LTQuM0MyMC42LDIxLjgsMjAuMywyMS4yLDE5LjgsMjEuMXoiLz4NCgk8cGF0aCBkPSJNMjIuMywxNi45Yy0wLjUsMC4zLTAuNiwwLjktMC4zLDEuNGMwLjcsMS4xLDEsMi40LDEsMy43YzAsMi41LTEuMyw0LjgtMy41LDYuMWMtMC41LDAuMy0wLjYsMC45LTAuNCwxLjQNCgkJYzAuMiwwLjMsMC41LDAuNSwwLjksMC41YzAuMiwwLDAuMywwLDAuNS0wLjFjMi44LTEuNiw0LjUtNC42LDQuNS03LjhjMC0xLjctMC41LTMuMy0xLjMtNC43QzIzLjQsMTYuOCwyMi43LDE2LjYsMjIuMywxNi45eiIvPg0KCTxwYXRoIGQ9Ik0yMi4zLDExLjVjLTAuNS0wLjEtMS4xLDAuMi0xLjIsMC43Yy0wLjEsMC41LDAuMiwxLjEsMC43LDEuMmMxLjMsMC4zLDIuNCwwLjksMy4zLDEuOWMxLjgsMS44LDIuNSw0LjQsMS44LDYuOA0KCQljLTAuMSwwLjUsMC4yLDEuMSwwLjcsMS4yYzAuMSwwLDAuMiwwLDAuMywwYzAuNCwwLDAuOC0wLjMsMS0wLjdjMC44LTMuMS0wLjEtNi40LTIuMy04LjdDMjUuNCwxMi43LDIzLjksMTEuOSwyMi4zLDExLjV6Ii8+DQoJPHBhdGggZD0iTTI5LjgsMTEuNUMyOC4yLDguNywyNS4yLDcsMjIsN2MtMS43LDAtMy4zLDAuNS00LjcsMS4zYy0wLjUsMC4zLTAuNiwwLjktMC4zLDEuNGMwLjMsMC41LDAuOSwwLjYsMS40LDAuMw0KCQljMS4xLTAuNywyLjQtMSwzLjctMWMyLjUsMCw0LjgsMS4zLDYuMSwzLjVjMC4yLDAuMywwLjUsMC41LDAuOSwwLjVjMC4yLDAsMC4zLDAsMC41LTAuMUMyOS45LDEyLjYsMzAuMSwxMiwyOS44LDExLjV6Ii8+DQo8L2c+DQo8L3N2Zz4NCg==", + "name": "HedgehogPlatformer", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Space/9ea467d2404c1736b87d763c884e9b9dfb13a401360f69c6a17afc8f5d583d58_Space_warp_galaxy.svg", + "shortDescription": "Jump and run on platforms at 360°.", + "version": "1.0.0", + "description": [ + "A platformer engine for Sonic-like games.", + "", + "A small demo shows how to use this extension ([open the project online](https://editor.gdevelop.io/?project=example://360°-platformer))." + ], + "origin": { + "identifier": "HedgehogPlatformer", + "name": "gdevelop-extension-store" + }, + "tags": [ + "platformer", + "sonic" + ], + "authorIds": [ + "SEnxPnvGuQhQmTXJ3xwZa1lQFdr1", + "StSwcmCyAkXK5vcKCNaIGbmgxjU2", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [ + { + "name": "TimeDelta", + "type": "number", + "value": 1 + }, + { + "folded": true, + "name": "SightRadius", + "type": "number", + "value": 0 + } + ], + "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.__hedgehogPlatformerExtension) {", + " return;", + "}", + "", + "/**", + " * Get the platforms manager of an instance container.", + " * ", + " * @param {gdjs.RuntimeInstanceContainer} instanceContainer", + " */", + "function getManager(instanceContainer) {", + " if (!instanceContainer.hedgehogPlatformsObjectsManager) {", + " //Create the shared manager if necessary.", + " instanceContainer.hedgehogPlatformsObjectsManager = new PlatformObjectsManager(", + " instanceContainer", + " );", + " }", + " return instanceContainer.hedgehogPlatformsObjectsManager;", + "}", + "", + "/**", + " * Manages the common objects shared by objects having a", + " * platform behavior: in particular, the platforms behaviors are required to", + " * declare themselves (see PlatformObjectsManager.addPlatform) to the manager", + " * of their associated container (see PlatformRuntimeBehavior.getManager).", + " */", + "class PlatformObjectsManager {", + " _collisionLayerRBushes;", + " /** Platforms near the object, updated with `_updatePotentialCollidingObjects`.", " * @type {Array}", " */", " _potentialCollidingObjects = [];", @@ -32390,31 +37191,913 @@ "parameters": [ "True" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogPlatform::PropertyPlatformType" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Top-bottom layer toggle marker\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "HedgehogPlatformer::HedgehogPlatform", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Is left-right layer toggle marker", + "functionType": "Condition", + "name": "IsLeftRightLayerToggleMarker", + "private": true, + "sentence": "_PARAM0_ is left-right layer toggle marker", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogPlatform::PropertyPlatformType" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Left-right layer toggle marker\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "HedgehogPlatformer::HedgehogPlatform", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Is top-bottom layer toggle marker", + "functionType": "Condition", + "name": "IsTopButtomLayerToggleMarker", + "private": true, + "sentence": "_PARAM0_ Is top-bottom layer toggle marker", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogPlatform::PropertyPlatformType" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Top-bottom layer toggle marker\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "HedgehogPlatformer::HedgehogPlatform", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "Platform", + "type": "Choice", + "label": "Type", + "description": "", + "group": "", + "extraInformation": [ + "Platform", + "Jumpthru", + "Angle lock marker", + "Left-right layer toggle marker", + "Top-bottom layer toggle marker" + ], + "name": "PlatformType" + }, + { + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "Collision layer", + "description": "Only interacts with characters of the same layer.", + "group": "", + "extraInformation": [], + "name": "CollisionLayer" + }, + { + "value": "true", + "type": "Boolean", + "label": "Snap horizontally", + "description": "Snap movement angle to 0° or 180°.", + "group": "Angle lock", + "extraInformation": [], + "name": "ShouldSnapAngleHorizontally" + }, + { + "value": "true", + "type": "Boolean", + "label": "Snap vertically", + "description": "Snap movement angle to 90° or 270°.", + "group": "Angle lock", + "extraInformation": [], + "name": "ShouldSnapAngleVertically" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Targeted layer", + "description": "The layer given to player on the right or bottom. The marker layer is used for the other side.", + "group": "Layer toggle", + "extraInformation": [], + "name": "TargetedCollisionLayer" + }, + { + "value": "", + "type": "Boolean", + "label": "Only for grounded characters", + "description": "", + "group": "Layer toggle", + "extraInformation": [], + "name": "IsRequiringGrounded" + }, + { + "value": "true", + "type": "Boolean", + "label": "Rotate characters", + "description": "", + "group": "", + "extraInformation": [], + "name": "ShouldRotateCharacters" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Change animations and horizontal flipping of hedgehog characters automatically.", + "fullName": "Hedgehog character animator", + "name": "HedgehogCharacterAnimator", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "LayerTimeScale" + }, + "parameters": [ + "", + "Object.Layer()", + "!=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacter::IsFacingForward" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipX" + }, + "parameters": [ + "Object", + "Flippable", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::IsFacingForward" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipX" + }, + "parameters": [ + "Object", + "Flippable", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetSpeedScale" + }, + "parameters": [ + "Object", + "Animation", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::IsJumping" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "JumpAnimationName" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "FlippableCapability::FlippableBehavior::FlippedX" + }, + "parameters": [ + "Object", + "Flippable" + ] + } + ], + "actions": [ + { + "type": { + "value": "Rotate" + }, + "parameters": [ + "Object", + "JumpRotationSpeed", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlippedX" + }, + "parameters": [ + "Object", + "Flippable" + ] + } + ], + "actions": [ + { + "type": { + "value": "Rotate" + }, + "parameters": [ + "Object", + "-JumpRotationSpeed", + "" + ] + } + ] + } + ] + }, { - "type": { - "value": "HedgehogPlatformer::HedgehogPlatform::PropertyPlatformType" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"Top-bottom layer toggle marker\"" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacter::IsOnFloor" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacter::IsJumping" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "FallAnimationName" + ] + } ] - } - ], - "actions": [ + }, { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::IsOnFloor" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::IsMoving" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacter::IsPushing" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterAnimator::PropertyBrakeAnimationName" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "\"Left\"", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::Speed" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + ">=", + "BrakeMinSpeed", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "BrakeAnimationName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "\"Right\"", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::Speed" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "<=", + "-BrakeMinSpeed", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "BrakeAnimationName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::Name" + }, + "parameters": [ + "Object", + "Animation", + "=", + "BrakeAnimationName" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "\"Left\"", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::Speed" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "<", + "0", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "IdleAnimationName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "\"Right\"", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::Speed" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + ">", + "0", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "IdleAnimationName" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::Name" + }, + "parameters": [ + "Object", + "Animation", + "!=", + "BrakeAnimationName" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterAnimator::PropertyBrakeAnimationName" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"\"" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetSpeedScale" + }, + "parameters": [ + "Object", + "Animation", + "=", + "Object.HedgehogCharacter::Speed() / Object.HedgehogCharacter::MaxSpeed()" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Object.HedgehogCharacter::Speed()", + "<", + "RunMinSpeed" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterAnimator::PropertyRunAnimationName" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"\"" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "WalkAnimationName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Object.HedgehogCharacter::Speed()", + ">=", + "RunMinSpeed" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterAnimator::PropertyWalkAnimationName" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"\"" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "RunAnimationName" + ] + } + ] + } + ] + } + ], + "variables": [ + { + "folded": true, + "name": "IsBreaking", + "type": "boolean", + "value": false + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::IsPushing" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "PushAnimationName" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacter::IsMoving" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "IdleAnimationName" + ] + } + ] + } ] } ] @@ -32429,90 +38112,132 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "HedgehogPlatformer::HedgehogPlatform", + "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterAnimator", "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "Is left-right layer toggle marker", - "functionType": "Condition", - "name": "IsLeftRightLayerToggleMarker", - "private": true, - "sentence": "_PARAM0_ is left-right layer toggle marker", + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogPlatform::PropertyPlatformType" + "value": "LayerTimeScale" }, "parameters": [ - "Object", - "Behavior", - "=", - "\"Left-right layer toggle marker\"" + "", + "Object.Layer()", + "!=", + "0" ] } ], - "actions": [ + "actions": [], + "events": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterAnimator::SetPropertyDirectionKey" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"\"" + ] + } ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "HedgehogPlatformer::HedgehogPlatform", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "Is top-bottom layer toggle marker", - "functionType": "Condition", - "name": "IsTopButtomLayerToggleMarker", - "private": true, - "sentence": "_PARAM0_ Is top-bottom layer toggle marker", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { - "type": { - "value": "HedgehogPlatformer::HedgehogPlatform::PropertyPlatformType" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"Top-bottom layer toggle marker\"" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "\"Left\"", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterAnimator::SetPropertyDirectionKey" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Left\"" + ] + } ] - } - ], - "actions": [ + }, { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "\"Right\"", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterAnimator::SetPropertyDirectionKey" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Right\"" + ] + } ] } ] @@ -32527,7 +38252,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "HedgehogPlatformer::HedgehogPlatform", + "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterAnimator", "type": "behavior" } ], @@ -32536,83 +38261,157 @@ ], "propertyDescriptors": [ { - "value": "Platform", - "type": "Choice", - "label": "Type", + "value": "", + "type": "Behavior", + "label": "Hedgehog platformer character", "description": "", "group": "", "extraInformation": [ - "Platform", - "Jumpthru", - "Angle lock marker", - "Left-right layer toggle marker", - "Top-bottom layer toggle marker" + "HedgehogPlatformer::HedgehogCharacter" ], - "name": "PlatformType" + "name": "HedgehogCharacter" }, { - "value": "0", + "value": "", + "type": "Behavior", + "label": "Animatable capability", + "description": "", + "group": "", + "extraInformation": [ + "AnimatableCapability::AnimatableBehavior" + ], + "name": "Animation" + }, + { + "value": "", + "type": "Behavior", + "label": "Flippable capability", + "description": "", + "group": "", + "extraInformation": [ + "FlippableCapability::FlippableBehavior" + ], + "name": "Flippable" + }, + { + "value": "Idle", + "type": "String", + "label": "Idle", + "description": "", + "group": "", + "extraInformation": [], + "name": "IdleAnimationName" + }, + { + "value": "Walk", + "type": "String", + "label": "Walk", + "description": "", + "group": "", + "extraInformation": [], + "name": "WalkAnimationName" + }, + { + "value": "Run", + "type": "String", + "label": "Run", + "description": "", + "group": "", + "extraInformation": [], + "name": "RunAnimationName" + }, + { + "value": "Jump", + "type": "String", + "label": "Jump", + "description": "", + "group": "", + "extraInformation": [], + "name": "JumpAnimationName" + }, + { + "value": "Fall", + "type": "String", + "label": "Fall", + "description": "", + "group": "", + "extraInformation": [], + "name": "FallAnimationName" + }, + { + "value": "BalanceOnLedge", + "type": "String", + "label": "Balance on ledge", + "description": "", + "group": "", + "extraInformation": [], + "name": "BalanceOnLedgeAnimationName" + }, + { + "value": "360", "type": "Number", - "unit": "Dimensionless", - "label": "Collision layer", - "description": "Only interacts with characters of the same layer.", + "unit": "AngularSpeed", + "label": "Jump rotation speed", + "description": "", "group": "", "extraInformation": [], - "name": "CollisionLayer" + "name": "JumpRotationSpeed" }, { - "value": "true", - "type": "Boolean", - "label": "Snap horizontally", - "description": "Snap movement angle to 0° or 180°.", - "group": "Angle lock", + "value": "Push", + "type": "String", + "label": "Push", + "description": "", + "group": "", "extraInformation": [], - "name": "ShouldSnapAngleHorizontally" + "name": "PushAnimationName" }, { - "value": "true", - "type": "Boolean", - "label": "Snap vertically", - "description": "Snap movement angle to 90° or 270°.", - "group": "Angle lock", + "value": "Brake", + "type": "String", + "label": "Brake", + "description": "", + "group": "", "extraInformation": [], - "name": "ShouldSnapAngleVertically" + "name": "BrakeAnimationName" }, { - "value": "1", + "value": "720", "type": "Number", - "unit": "Dimensionless", - "label": "Targeted layer", - "description": "The layer given to player on the right or bottom. The marker layer is used for the other side.", - "group": "Layer toggle", + "unit": "PixelSpeed", + "label": "Brake animation min speed", + "description": "", + "group": "", "extraInformation": [], - "name": "TargetedCollisionLayer" + "name": "BrakeMinSpeed" }, { - "value": "", - "type": "Boolean", - "label": "Only for grounded characters", + "value": "1080", + "type": "Number", + "unit": "PixelSpeed", + "label": "Run animation min speed", "description": "", - "group": "Layer toggle", + "group": "", "extraInformation": [], - "name": "IsRequiringGrounded" + "name": "RunMinSpeed" }, { - "value": "true", - "type": "Boolean", - "label": "Rotate characters", + "value": "", + "type": "String", + "label": "", "description": "", "group": "", "extraInformation": [], - "name": "ShouldRotateCharacters" + "hidden": true, + "name": "DirectionKey" } ], "sharedPropertyDescriptors": [] }, { - "description": "Change animations and horizontal flipping of hedgehog characters automatically.", - "fullName": "Hedgehog character animator", - "name": "HedgehogCharacterAnimator", + "description": "Toggle rolling mode.", + "fullName": "Hedgehog character rolling", + "name": "HedgehogCharacterRolling", "objectType": "", "eventsFunctions": [ { @@ -32643,123 +38442,149 @@ "conditions": [ { "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacter::IsFacingForward" + "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsCharging" }, "parameters": [ "Object", - "HedgehogCharacter", - "" + "Behavior" ] - } - ], - "actions": [ + }, { "type": { - "value": "FlippableCapability::FlippableBehavior::FlipX" + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsCrouching" }, "parameters": [ "Object", - "Flippable", - "yes" + "Behavior" ] } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + ], + "actions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::IsFacingForward" + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetIsCharging" }, "parameters": [ "Object", - "HedgehogCharacter", + "Behavior", + "no", "" ] - } - ], - "actions": [ + }, { "type": { - "value": "FlippableCapability::FlippableBehavior::FlipX" + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetIsRolling" }, "parameters": [ "Object", - "Flippable", - "no" + "Behavior", + "", + "" ] } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + ], + "events": [ { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::SetSpeedScale" - }, - "parameters": [ - "Object", - "Animation", - "=", - "1" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::IsFacingForward" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::SetSpeed" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "=", + "SpinDashSpeed", + "" + ] + } ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::IsJumping" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacter::IsFacingForward" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::SetSpeed" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "=", + "-SpinDashSpeed", + "" + ] + } ] } - ], - "actions": [ + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "AnimatableCapability::AnimatableBehavior::SetName" + "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsRolling" }, "parameters": [ "Object", - "Animation", - "=", - "JumpAnimationName" + "Behavior" ] } ], + "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": true, - "value": "FlippableCapability::FlippableBehavior::FlippedX" + "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "Object", - "Flippable" + "abs(Object.HedgehogCharacter::Speed())", + ">", + "MaxSpeed" ] } ], "actions": [ { "type": { - "value": "Rotate" + "value": "HedgehogPlatformer::HedgehogCharacter::SetSpeed" }, "parameters": [ "Object", - "JumpRotationSpeed", + "HedgehogCharacter", + "=", + "MaxSpeed * sign(Object.HedgehogCharacter::Speed())", "" ] } @@ -32770,22 +38595,25 @@ "conditions": [ { "type": { - "value": "FlippableCapability::FlippableBehavior::FlippedX" + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacter::IsOnFloor" }, "parameters": [ "Object", - "Flippable" + "HedgehogCharacter", + "" ] } ], "actions": [ { "type": { - "value": "Rotate" + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetIsRolling" }, "parameters": [ "Object", - "-JumpRotationSpeed", + "Behavior", + "no", "" ] } @@ -32798,37 +38626,25 @@ "conditions": [ { "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacter::IsOnFloor" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "" - ] - }, - { - "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacter::IsJumping" + "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "Object", - "HedgehogCharacter", - "" + "abs(Object.HedgehogCharacter::Speed())", + "<", + "MinSpeed" ] } ], "actions": [ { "type": { - "value": "AnimatableCapability::AnimatableBehavior::SetName" + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetIsRolling" }, "parameters": [ "Object", - "Animation", - "=", - "FallAnimationName" + "Behavior", + "no", + "" ] } ] @@ -32838,463 +38654,60 @@ "conditions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::IsOnFloor" + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsCharging" }, "parameters": [ "Object", - "HedgehogCharacter", - "" + "Behavior" + ] + }, + { + "type": { + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsJumpPressed" + }, + "parameters": [ + "Object", + "Behavior" ] } ], - "actions": [], - "events": [ + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::IsMoving" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacter::IsPushing" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterAnimator::PropertyBrakeAnimationName" - }, - "parameters": [ - "Object", - "Behavior", - "!=", - "\"\"" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "\"Left\"", - "" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::Speed" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - ">=", - "BrakeMinSpeed", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::SetName" - }, - "parameters": [ - "Object", - "Animation", - "=", - "BrakeAnimationName" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "\"Right\"", - "" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::Speed" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "<=", - "-BrakeMinSpeed", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::SetName" - }, - "parameters": [ - "Object", - "Animation", - "=", - "BrakeAnimationName" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::Name" - }, - "parameters": [ - "Object", - "Animation", - "=", - "BrakeAnimationName" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "\"Left\"", - "" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::Speed" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "<", - "0", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::SetName" - }, - "parameters": [ - "Object", - "Animation", - "=", - "IdleAnimationName" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "\"Right\"", - "" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::Speed" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - ">", - "0", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::SetName" - }, - "parameters": [ - "Object", - "Animation", - "=", - "IdleAnimationName" - ] - } - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::Name" - }, - "parameters": [ - "Object", - "Animation", - "!=", - "BrakeAnimationName" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterAnimator::PropertyBrakeAnimationName" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"\"" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::SetSpeedScale" - }, - "parameters": [ - "Object", - "Animation", - "=", - "Object.HedgehogCharacter::Speed() / Object.HedgehogCharacter::MaxSpeed()" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.HedgehogCharacter::Speed()", - "<", - "RunMinSpeed" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterAnimator::PropertyRunAnimationName" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"\"" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::SetName" - }, - "parameters": [ - "Object", - "Animation", - "=", - "WalkAnimationName" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.HedgehogCharacter::Speed()", - ">=", - "RunMinSpeed" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterAnimator::PropertyWalkAnimationName" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"\"" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::SetName" - }, - "parameters": [ - "Object", - "Animation", - "=", - "RunAnimationName" - ] - } - ] - } - ] - } - ], - "variables": [ - { - "folded": true, - "name": "IsBreaking", - "type": "boolean", - "value": false - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::IsPushing" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::SetName" - }, - "parameters": [ - "Object", - "Animation", - "=", - "PushAnimationName" - ] - } - ] - } + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyCanJump" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsCrouching" + }, + "parameters": [ + "Object", + "Behavior", + "no" ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacter::IsMoving" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::SetName" - }, - "parameters": [ - "Object", - "Animation", - "=", - "IdleAnimationName" - ] - } + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsJumpPressed" + }, + "parameters": [ + "Object", + "Behavior", + "" ] } ] @@ -33311,30 +38724,31 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterAnimator", + "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterRolling", "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "", + "description": "Simulate a press of the Roll key. When characters stand still, they chouch instead of rolling.", + "fullName": "Simulate roll key press", "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", + "group": "Hedgehog controls", + "name": "SimulateRollKey", + "sentence": "Simulate pressing Roll key for _PARAM0_", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "LayerTimeScale" + "value": "HedgehogPlatformer::HedgehogCharacter::IsOnFloor" }, "parameters": [ - "", - "Object.Layer()", - "!=", - "0" + "Object", + "HedgehogCharacter", + "" ] } ], @@ -33346,13 +38760,12 @@ "actions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogCharacterAnimator::SetPropertyDirectionKey" + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsCrouching" }, "parameters": [ "Object", "Behavior", - "=", - "\"\"" + "yes" ] } ] @@ -33362,81 +38775,27 @@ "conditions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "\"Left\"", - "" - ] - }, - { - "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" + "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "Object", - "HedgehogCharacter", - "\"Right\"", - "" + "abs(Object.HedgehogCharacter::Speed())", + ">=", + "MinSpeed" ] } ], "actions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogCharacterAnimator::SetPropertyDirectionKey" + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetIsRolling" }, "parameters": [ "Object", "Behavior", - "=", - "\"Left\"" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "\"Right\"", - "" - ] - }, - { - "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "\"Left\"", + "", "" ] } - ], - "actions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterAnimator::SetPropertyDirectionKey" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"Right\"" - ] - } ] } ] @@ -33451,464 +38810,346 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterAnimator", + "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterRolling", "type": "behavior" } ], "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "Hedgehog platformer character", - "description": "", - "group": "", - "extraInformation": [ - "HedgehogPlatformer::HedgehogCharacter" - ], - "name": "HedgehogCharacter" }, { - "value": "", - "type": "Behavior", - "label": "Animatable capability", - "description": "", - "group": "", - "extraInformation": [ - "AnimatableCapability::AnimatableBehavior" + "description": "Simulate a press of the spindash key.", + "fullName": "Simulate spindash key press", + "functionType": "Action", + "group": "Hedgehog controls", + "name": "SimulateSpindashKey", + "sentence": "Simulate pressing Spindash key for _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "abs(Object.HedgehogCharacter::Speed())", + "<", + "MinSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetIsCharging" + }, + "parameters": [ + "Object", + "Behavior", + "", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyCanJump" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsCrouching" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } ], - "name": "Animation" - }, - { - "value": "", - "type": "Behavior", - "label": "Flippable capability", - "description": "", - "group": "", - "extraInformation": [ - "FlippableCapability::FlippableBehavior" + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterRolling", + "type": "behavior" + } ], - "name": "Flippable" - }, - { - "value": "Idle", - "type": "String", - "label": "Idle", - "description": "", - "group": "", - "extraInformation": [], - "name": "IdleAnimationName" - }, - { - "value": "Walk", - "type": "String", - "label": "Walk", - "description": "", - "group": "", - "extraInformation": [], - "name": "WalkAnimationName" - }, - { - "value": "Run", - "type": "String", - "label": "Run", - "description": "", - "group": "", - "extraInformation": [], - "name": "RunAnimationName" - }, - { - "value": "Jump", - "type": "String", - "label": "Jump", - "description": "", - "group": "", - "extraInformation": [], - "name": "JumpAnimationName" - }, - { - "value": "Fall", - "type": "String", - "label": "Fall", - "description": "", - "group": "", - "extraInformation": [], - "name": "FallAnimationName" - }, - { - "value": "BalanceOnLedge", - "type": "String", - "label": "Balance on ledge", - "description": "", - "group": "", - "extraInformation": [], - "name": "BalanceOnLedgeAnimationName" - }, - { - "value": "360", - "type": "Number", - "unit": "AngularSpeed", - "label": "Jump rotation speed", - "description": "", - "group": "", - "extraInformation": [], - "name": "JumpRotationSpeed" - }, - { - "value": "Push", - "type": "String", - "label": "Push", - "description": "", - "group": "", - "extraInformation": [], - "name": "PushAnimationName" - }, - { - "value": "Brake", - "type": "String", - "label": "Brake", - "description": "", - "group": "", - "extraInformation": [], - "name": "BrakeAnimationName" - }, - { - "value": "720", - "type": "Number", - "unit": "PixelSpeed", - "label": "Brake animation min speed", - "description": "", - "group": "", - "extraInformation": [], - "name": "BrakeMinSpeed" + "objectGroups": [] }, { - "value": "1080", - "type": "Number", - "unit": "PixelSpeed", - "label": "Run animation min speed", - "description": "", - "group": "", - "extraInformation": [], - "name": "RunMinSpeed" + "description": "Simulate a press of the Spindash key when the character is crouching or the jump key otherwise.", + "fullName": "Simulate spindash or jump key press", + "functionType": "Action", + "group": "Hedgehog controls", + "name": "SimulateSpindashOrJumpKey", + "sentence": "Simulate pressing Spindash or Jump key for _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BehaviorActivated" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::SimulateJumpKey" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsJumpPressed" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::IsCrouching" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetIsCharging" + }, + "parameters": [ + "Object", + "Behavior", + "", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyCanJump" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacterRolling::IsCrouching" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyCanJump" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::SimulateJumpKey" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterRolling", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "value": "", - "type": "String", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "DirectionKey" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Toggle rolling mode.", - "fullName": "Hedgehog character rolling", - "name": "HedgehogCharacterRolling", - "objectType": "", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", + "description": "Check if the character is crouching.", + "fullName": "Is crouching", + "functionType": "Condition", + "group": "Hedgehog rolling", + "name": "IsCrouching", + "sentence": "_PARAM0_ is crouching", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "LayerTimeScale" + "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsCrouching" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsRolling" }, "parameters": [ - "", - "Object.Layer()", - "!=", - "0" + "Object", + "Behavior" ] - } - ], - "actions": [], - "events": [ + }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsCharging" - }, - "parameters": [ - "Object", - "Behavior" - ] - }, - { - "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsCrouching" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetIsCharging" - }, - "parameters": [ - "Object", - "Behavior", - "no", - "" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetIsRolling" - }, - "parameters": [ - "Object", - "Behavior", - "", - "" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::IsFacingForward" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetSpeed" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "=", - "SpinDashSpeed", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacter::IsFacingForward" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetSpeed" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "=", - "-SpinDashSpeed", - "" - ] - } - ] - } + "type": { + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "\"Left\"", + "" ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsRolling" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "abs(Object.HedgehogCharacter::Speed())", - ">", - "MaxSpeed" - ] - } - ], - "actions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetSpeed" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "=", - "MaxSpeed * sign(Object.HedgehogCharacter::Speed())", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacter::IsOnFloor" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetIsRolling" - }, - "parameters": [ - "Object", - "Behavior", - "no", - "" - ] - } - ] - } + "type": { + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "\"Right\"", + "" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "abs(Object.HedgehogCharacter::Speed())", - "<", - "MinSpeed" - ] - } - ], - "actions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetIsRolling" - }, - "parameters": [ - "Object", - "Behavior", - "no", - "" - ] - } + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" ] - }, + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterRolling", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the character is rolling.", + "fullName": "Is rolling", + "functionType": "Condition", + "group": "Hedgehog rolling", + "name": "IsRolling", + "sentence": "_PARAM0_ is rolling", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsCharging" - }, - "parameters": [ - "Object", - "Behavior" - ] - }, - { - "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsJumpPressed" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyCanJump" - }, - "parameters": [ - "Object", - "Behavior", - "yes" - ] - } + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsRolling" + }, + "parameters": [ + "Object", + "Behavior" ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsCrouching" - }, - "parameters": [ - "Object", - "Behavior", - "no" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsJumpPressed" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "abs(Object.HedgehogCharacter::Speed())", + ">=", + "MinSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" ] } ] @@ -33930,143 +39171,290 @@ "objectGroups": [] }, { - "description": "Simulate a press of the Roll key. When characters stand still, they chouch instead of rolling.", - "fullName": "Simulate roll key press", + "description": "Enable or disable rolling mode for the character.", + "fullName": "Enable rolling", "functionType": "Action", - "group": "Hedgehog controls", - "name": "SimulateRollKey", - "sentence": "Simulate pressing Roll key for _PARAM0_", + "group": "Hedgehog rolling", + "name": "SetIsRolling", + "private": true, + "sentence": "Enable rolling for _PARAM0_ : _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::IsOnFloor" + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + }, + { + "type": { + "inverted": true, + "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsRolling" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsRolling" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyOriginalDownSlopeFactor" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.HedgehogCharacter::DownSlopeFactor()" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyOriginalUpSlopeFactor" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.HedgehogCharacter::UpSlopeFactor()" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyOriginalFriction" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.HedgehogCharacter::Friction()" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyOriginalDeceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.HedgehogCharacter::Deceleration()" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyOriginalAcceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.HedgehogCharacter::GroundedAcceleration()" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyOriginalStandMaxAngle" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.HedgehogCharacter::StandMaxAngle()" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::SetDownSlopeFactor" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "=", + "DownSlopeFactor", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::SetUpSlopeFactor" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "=", + "UpSlopeFactor", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::SetFriction" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "=", + "Friction", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::SetDeceleration" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "=", + "Deceleration", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::SetGroundedAcceleration" }, "parameters": [ "Object", "HedgehogCharacter", + "=", + "0", "" ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsCrouching" - }, - "parameters": [ - "Object", - "Behavior", - "yes" - ] - } - ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "abs(Object.HedgehogCharacter::Speed())", - ">=", - "MinSpeed" - ] - } - ], - "actions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetIsRolling" - }, - "parameters": [ - "Object", - "Behavior", - "", - "" - ] - } + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::SetStandMaxAngle" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "=", + "-1", + "" ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterRolling", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Simulate a press of the spindash key.", - "fullName": "Simulate spindash key press", - "functionType": "Action", - "group": "Hedgehog controls", - "name": "SimulateSpindashKey", - "sentence": "Simulate pressing Spindash key for _PARAM0_", - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" + "inverted": true, + "value": "GetArgumentAsBoolean" }, "parameters": [ - "abs(Object.HedgehogCharacter::Speed())", - "<", - "MinSpeed" + "\"Value\"" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsRolling" + }, + "parameters": [ + "Object", + "Behavior" ] } ], "actions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetIsCharging" + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsRolling" }, "parameters": [ "Object", "Behavior", - "", + "no" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::SetDownSlopeFactor" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "=", + "OriginalDownSlopeFactor", "" ] }, { "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyCanJump" + "value": "HedgehogPlatformer::HedgehogCharacter::SetUpSlopeFactor" }, "parameters": [ "Object", - "Behavior", + "HedgehogCharacter", + "=", + "OriginalUpSlopeFactor", "" ] }, { "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsCrouching" + "value": "HedgehogPlatformer::HedgehogCharacter::SetFriction" }, "parameters": [ "Object", - "Behavior", - "yes" + "HedgehogCharacter", + "=", + "OriginalFriction", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::SetDeceleration" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "=", + "OriginalDeceleration", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::SetGroundedAcceleration" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "=", + "OriginalAcceleration", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::HedgehogCharacter::SetStandMaxAngle" + }, + "parameters": [ + "Object", + "HedgehogCharacter", + "=", + "OriginalStandMaxAngle", + "" ] } ] @@ -34083,25 +39471,31 @@ "name": "Behavior", "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterRolling", "type": "behavior" + }, + { + "defaultValue": "yes", + "description": "IsRolling", + "name": "Value", + "optional": true, + "type": "yesorno" } ], "objectGroups": [] }, { - "description": "Simulate a press of the Spindash key when the character is crouching or the jump key otherwise.", - "fullName": "Simulate spindash or jump key press", - "functionType": "Action", - "group": "Hedgehog controls", - "name": "SimulateSpindashOrJumpKey", - "sentence": "Simulate pressing Spindash or Jump key for _PARAM0_", + "description": "Check if the character is charging a spindash.", + "fullName": "Is charging a spindash", + "functionType": "Condition", + "group": "Hedgehog rolling", + "name": "IsCharging", + "sentence": "_PARAM0_ is charging a spindash", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": true, - "value": "BehaviorActivated" + "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsCharging" }, "parameters": [ "Object", @@ -34112,65 +39506,72 @@ "actions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SimulateJumpKey" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "HedgehogCharacter", - "" + "True" ] } ] - }, + } + ], + "parameters": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsJumpPressed" - }, - "parameters": [ - "Object", - "Behavior", - "yes" - ] - } - ] + "description": "Object", + "name": "Object", + "type": "object" }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterRolling", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change if the character is charging a spindash.", + "fullName": "Is charging", + "functionType": "Action", + "group": "Hedgehog rolling", + "name": "SetIsCharging", + "private": true, + "sentence": "_PARAM0_ is charging a spindash: _PARAM2_", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::IsCrouching" + "inverted": true, + "value": "GetArgumentAsBoolean" }, "parameters": [ - "Object", - "Behavior", - "" + "\"Value\"" ] } ], "actions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetIsCharging" + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsCharging" }, "parameters": [ "Object", "Behavior", - "", - "" + "no" ] }, { "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyCanJump" + "value": "HedgehogPlatformer::HedgehogCharacter::SetRunningLockRemainingDuration" }, "parameters": [ "Object", - "Behavior", + "HedgehogCharacter", + "=", + "0", "" ] } @@ -34181,33 +39582,33 @@ "conditions": [ { "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacterRolling::IsCrouching" + "value": "GetArgumentAsBoolean" }, "parameters": [ - "Object", - "Behavior", - "" + "\"Value\"" ] - }, + } + ], + "actions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyCanJump" + "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsCharging" }, "parameters": [ "Object", - "Behavior" + "Behavior", + "yes" ] - } - ], - "actions": [ + }, { "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SimulateJumpKey" + "value": "HedgehogPlatformer::HedgehogCharacter::SetRunningLockRemainingDuration" }, "parameters": [ "Object", "HedgehogCharacter", + "=", + "123456789", "" ] } @@ -34225,61 +39626,271 @@ "name": "Behavior", "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterRolling", "type": "behavior" + }, + { + "defaultValue": "yes", + "description": "IsCharging", + "name": "Value", + "optional": true, + "type": "yesorno" } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Hedgehog platformer character", + "description": "", + "group": "", + "extraInformation": [ + "HedgehogPlatformer::HedgehogCharacter" + ], + "name": "HedgehogCharacter" }, { - "description": "Check if the character is crouching.", - "fullName": "Is crouching", + "value": "843.75", + "type": "Number", + "unit": "PixelAcceleration", + "label": "Downwards slope factor", + "description": "Speed gain when moving downwards.", + "group": "Ground", + "extraInformation": [], + "name": "DownSlopeFactor" + }, + { + "value": "3375", + "type": "Number", + "unit": "PixelAcceleration", + "label": "Upwards slope factor", + "description": "Speed loss when moving upwards.", + "group": "Ground", + "extraInformation": [], + "name": "UpSlopeFactor" + }, + { + "value": "253.125", + "type": "Number", + "unit": "PixelAcceleration", + "label": "Friction", + "description": "When there is no input.", + "group": "Speed", + "extraInformation": [], + "name": "Friction" + }, + { + "value": "1350", + "type": "Number", + "unit": "PixelAcceleration", + "label": "Deceleration", + "description": "When changing of direction on the ground.", + "group": "Speed", + "extraInformation": [], + "name": "Deceleration" + }, + { + "value": "2880", + "type": "Number", + "unit": "PixelSpeed", + "label": "Max speed", + "description": "", + "group": "Speed", + "extraInformation": [], + "name": "MaxSpeed" + }, + { + "value": "180", + "type": "Number", + "unit": "PixelSpeed", + "label": "Min speed", + "description": "The minimal speed to be able to start rolling.", + "group": "Speed", + "extraInformation": [], + "name": "MinSpeed" + }, + { + "value": "1440", + "type": "Number", + "unit": "PixelSpeed", + "label": "Spindash speed", + "description": "", + "group": "Spindash", + "extraInformation": [], + "name": "SpinDashSpeed" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsRolling" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsCrouching" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsCharging" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "OriginalDownSlopeFactor" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "OriginalUpSlopeFactor" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "OriginalFriction" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "OriginalDeceleration" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "OriginalAcceleration" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "OriginalStandMaxAngle" + }, + { + "value": "true", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CanJump" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsJumpPressed" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Push hedgehog characters.", + "fullName": "Hedgehog spring", + "name": "Spring", + "objectType": "", + "eventsFunctions": [ + { + "description": "Check if the spring can push the character.", + "fullName": "Can push", "functionType": "Condition", - "group": "Hedgehog rolling", - "name": "IsCrouching", - "sentence": "_PARAM0_ is crouching", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsCrouching" - }, - "parameters": [ - "Object", - "Behavior" - ] - }, - { - "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsRolling" - }, - "parameters": [ - "Object", - "Behavior" - ] - }, + "name": "CanPush", + "sentence": "_PARAM0_ can push _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "Object", - "HedgehogCharacter", - "\"Left\"", - "" + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "HedgehogPlatformer::IsAngleAround" + }, + "parameters": [ + "Object", + "Object.Behavior::Angle()", + "0", + "45", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::IsAngleAround" + }, + "parameters": [ + "Object", + "Object.Behavior::Angle()", + "180", + "45", + "" + ] + } ] }, { "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacter::IsUsingControl" + "value": "HedgehogPlatformer::IsCharacterPushingPlatform" }, "parameters": [ - "Object", + "", + "Character", "HedgehogCharacter", - "\"Right\"", + "Object", + "", "" ] } @@ -34294,51 +39905,47 @@ ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterRolling", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the character is rolling.", - "fullName": "Is rolling", - "functionType": "Condition", - "group": "Hedgehog rolling", - "name": "IsRolling", - "sentence": "_PARAM0_ is rolling", - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsRolling" + "inverted": true, + "value": "HedgehogPlatformer::IsAngleAround" }, "parameters": [ "Object", - "Behavior" + "Object.Behavior::Angle()", + "0", + "15", + "" ] }, { "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" + "inverted": true, + "value": "HedgehogPlatformer::IsAngleAround" }, "parameters": [ - "abs(Object.HedgehogCharacter::Speed())", - ">=", - "MinSpeed" + "Object", + "Object.Behavior::Angle()", + "180", + "15", + "" + ] + }, + { + "type": { + "value": "HedgehogPlatformer::IsCharacterOnPlatform" + }, + "parameters": [ + "", + "Character", + "HedgehogCharacter", + "Object", + "", + "" ] } ], @@ -34363,298 +39970,129 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterRolling", + "supplementaryInformation": "HedgehogPlatformer::Spring", + "type": "behavior" + }, + { + "description": "Character", + "name": "Character", + "type": "objectList" + }, + { + "description": "Hedgehog platformer character", + "name": "HedgehogCharacter", + "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacter", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Enable or disable rolling mode for the character.", - "fullName": "Enable rolling", + "description": "Make the spring push the character.", + "fullName": "Push character", "functionType": "Action", - "group": "Hedgehog rolling", - "name": "SetIsRolling", - "private": true, - "sentence": "Enable rolling for _PARAM0_ : _PARAM2_", + "name": "Push", + "sentence": "_PARAM0_ push _PARAM2_", "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Project the character speed on the spring tangente (-unitY, unitX) to get the lateral speed.\nOnly keep this lateral speed and \"replace\" the speed in the spring direction with the push speed value.\n\nFor instance, for vertical springs, this allows to keep the speed on X while setting the speed on Y no matter what was the character Y speed before.\nThe formula is a generalization to this for any spring angle." + }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"Value\"" - ] - }, - { - "type": { - "inverted": true, - "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsRolling" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsRolling" - }, - "parameters": [ - "Object", - "Behavior", - "yes" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyOriginalDownSlopeFactor" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.HedgehogCharacter::DownSlopeFactor()" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyOriginalUpSlopeFactor" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.HedgehogCharacter::UpSlopeFactor()" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyOriginalFriction" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.HedgehogCharacter::Friction()" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyOriginalDeceleration" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.HedgehogCharacter::Deceleration()" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyOriginalAcceleration" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.HedgehogCharacter::GroundedAcceleration()" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyOriginalStandMaxAngle" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.HedgehogCharacter::StandMaxAngle()" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetDownSlopeFactor" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "HedgehogCharacter", + "unitX", "=", - "DownSlopeFactor", - "" + "cos(ToRad(Object.Angle()))" ] }, { "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetUpSlopeFactor" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "HedgehogCharacter", + "unitY", "=", - "UpSlopeFactor", - "" + "sin(ToRad(Object.Angle()))" ] }, { "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetFriction" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "HedgehogCharacter", + "LateralSpeed", "=", - "Friction", - "" + "- Character.HedgehogCharacter::SpeedX() * unitY + Character.HedgehogCharacter::SpeedY() * unitX" ] }, { "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetDeceleration" + "value": "HedgehogPlatformer::HedgehogCharacter::SetSpeedX" }, "parameters": [ - "Object", + "Character", "HedgehogCharacter", "=", - "Deceleration", + "-LateralSpeed * unitY + PushSpeed * unitX", "" ] }, { "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetGroundedAcceleration" + "value": "HedgehogPlatformer::HedgehogCharacter::SetSpeedY" }, "parameters": [ - "Object", + "Character", "HedgehogCharacter", "=", - "0", + "LateralSpeed * unitX + PushSpeed * unitY", "" ] }, { "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetStandMaxAngle" + "value": "HedgehogPlatformer::HedgehogCharacter::SetRunningLockRemainingDuration" }, "parameters": [ - "Object", + "Character", "HedgehogCharacter", "=", - "-1", + "CharacterRunningLockDuration", "" ] } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"Value\"" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsRolling" - }, - "parameters": [ - "Object", - "Behavior" - ] - } ], - "actions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsRolling" - }, - "parameters": [ - "Object", - "Behavior", - "no" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetDownSlopeFactor" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "=", - "OriginalDownSlopeFactor", - "" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetUpSlopeFactor" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "=", - "OriginalUpSlopeFactor", - "" - ] - }, - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetFriction" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "=", - "OriginalFriction", - "" - ] - }, + "variables": [ { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetDeceleration" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "=", - "OriginalDeceleration", - "" - ] + "name": "unitX", + "type": "number", + "value": 0 }, { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetGroundedAcceleration" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "=", - "OriginalAcceleration", - "" - ] + "name": "unitY", + "type": "number", + "value": 0 }, { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetStandMaxAngle" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "=", - "OriginalStandMaxAngle", - "" - ] + "folded": true, + "name": "LateralSpeed", + "type": "number", + "value": 0 } ] } @@ -34668,152 +40106,126 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterRolling", + "supplementaryInformation": "HedgehogPlatformer::Spring", "type": "behavior" }, { - "defaultValue": "yes", - "description": "IsRolling", - "name": "Value", - "optional": true, - "type": "yesorno" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the character is charging a spindash.", - "fullName": "Is charging a spindash", - "functionType": "Condition", - "group": "Hedgehog rolling", - "name": "IsCharging", - "sentence": "_PARAM0_ is charging a spindash", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::PropertyIsCharging" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" + "description": "Character", + "name": "Character", + "type": "objectList" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterRolling", + "description": "Hedgehog platformer character", + "name": "HedgehogCharacter", + "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacter", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Change if the character is charging a spindash.", - "fullName": "Is charging", - "functionType": "Action", - "group": "Hedgehog rolling", - "name": "SetIsCharging", + "fullName": "", + "functionType": "Expression", + "name": "Angle", "private": true, - "sentence": "_PARAM0_ is charging a spindash: _PARAM2_", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "SetNumberVariable" }, "parameters": [ - "\"Value\"" + "Angle", + "=", + "Object.Angle()" ] } ], - "actions": [ + "events": [ { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsCharging" - }, - "parameters": [ - "Object", - "Behavior", - "no" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlippedX" + }, + "parameters": [ + "Object", + "Flip" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Angle", + "=", + "180 - Angle" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlippedY" + }, + "parameters": [ + "Object", + "Flip" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Angle", + "=", + "-Angle" + ] + } ] }, { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetRunningLockRemainingDuration" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "=", - "0", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"Value\"" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Angle" + ] + } ] } ], - "actions": [ - { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacterRolling::SetPropertyIsCharging" - }, - "parameters": [ - "Object", - "Behavior", - "yes" - ] - }, + "variables": [ { - "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetRunningLockRemainingDuration" - }, - "parameters": [ - "Object", - "HedgehogCharacter", - "=", - "123456789", - "" - ] + "folded": true, + "name": "Angle", + "type": "number", + "value": 0 } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -34823,15 +40235,8 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacterRolling", + "supplementaryInformation": "HedgehogPlatformer::Spring", "type": "behavior" - }, - { - "defaultValue": "yes", - "description": "IsCharging", - "name": "Value", - "optional": true, - "type": "yesorno" } ], "objectGroups": [] @@ -34841,210 +40246,332 @@ { "value": "", "type": "Behavior", - "label": "Hedgehog platformer character", + "label": "Hedgehog platform", "description": "", "group": "", "extraInformation": [ - "HedgehogPlatformer::HedgehogCharacter" + "HedgehogPlatformer::HedgehogPlatform" ], - "name": "HedgehogCharacter" - }, - { - "value": "843.75", - "type": "Number", - "unit": "PixelAcceleration", - "label": "Downwards slope factor", - "description": "Speed gain when moving downwards.", - "group": "Ground", - "extraInformation": [], - "name": "DownSlopeFactor" - }, - { - "value": "3375", - "type": "Number", - "unit": "PixelAcceleration", - "label": "Upwards slope factor", - "description": "Speed loss when moving upwards.", - "group": "Ground", - "extraInformation": [], - "name": "UpSlopeFactor" - }, - { - "value": "253.125", - "type": "Number", - "unit": "PixelAcceleration", - "label": "Friction", - "description": "When there is no input.", - "group": "Speed", - "extraInformation": [], - "name": "Friction" - }, - { - "value": "1350", - "type": "Number", - "unit": "PixelAcceleration", - "label": "Deceleration", - "description": "When changing of direction on the ground.", - "group": "Speed", - "extraInformation": [], - "name": "Deceleration" - }, - { - "value": "2880", - "type": "Number", - "unit": "PixelSpeed", - "label": "Max speed", - "description": "", - "group": "Speed", - "extraInformation": [], - "name": "MaxSpeed" - }, - { - "value": "180", - "type": "Number", - "unit": "PixelSpeed", - "label": "Min speed", - "description": "The minimal speed to be able to start rolling.", - "group": "Speed", - "extraInformation": [], - "name": "MinSpeed" - }, - { - "value": "1440", - "type": "Number", - "unit": "PixelSpeed", - "label": "Spindash speed", - "description": "", - "group": "Spindash", - "extraInformation": [], - "name": "SpinDashSpeed" - }, - { - "value": "", - "type": "Boolean", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "IsRolling" - }, - { - "value": "", - "type": "Boolean", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "IsCrouching" + "name": "HedgehogPlatform" }, { "value": "", - "type": "Boolean", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "IsCharging" - }, - { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "OriginalDownSlopeFactor" - }, - { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "OriginalUpSlopeFactor" - }, - { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "OriginalFriction" - }, - { - "value": "0", - "type": "Number", - "label": "", + "type": "Behavior", + "label": "Flippable capability", "description": "", "group": "", - "extraInformation": [], - "hidden": true, - "name": "OriginalDeceleration" + "extraInformation": [ + "FlippableCapability::FlippableBehavior" + ], + "name": "Flip" }, { - "value": "0", + "value": "1800", "type": "Number", - "label": "", + "unit": "PixelSpeed", + "label": "Push speed", "description": "", "group": "", "extraInformation": [], - "hidden": true, - "name": "OriginalAcceleration" + "name": "PushSpeed" }, { - "value": "0", + "value": "0.267", "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "OriginalStandMaxAngle" - }, - { - "value": "true", - "type": "Boolean", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "CanJump" - }, - { - "value": "", - "type": "Boolean", - "label": "", + "unit": "Second", + "label": "Character running lock duration", "description": "", "group": "", "extraInformation": [], - "hidden": true, - "name": "IsJumpPressed" + "name": "CharacterRunningLockDuration" } ], "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Input", + "extensionNamespace": "", + "fullName": "Screen Orientation Checker", + "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.0.2", + "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": [ + { + "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": [] }, { - "description": "Push hedgehog characters.", - "fullName": "Hedgehog spring", - "name": "Spring", - "objectType": "", + "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", "eventsFunctions": [ { - "description": "Check if the spring can push the character.", - "fullName": "Can push", - "functionType": "Condition", - "name": "CanPush", - "sentence": "_PARAM0_ can push _PARAM2_", + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", "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": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "!=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + } + ] + }, + { + "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": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + } + ] + } + ] + }, + { + "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": [ @@ -35056,51 +40583,53 @@ "subInstructions": [ { "type": { - "value": "HedgehogPlatformer::IsAngleAround" - }, - "parameters": [ - "Object", - "Object.Behavior::Angle()", - "0", - "45", - "" + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsShown" + }, + "parameters": [ + "Object" ] }, { "type": { - "value": "HedgehogPlatformer::IsAngleAround" + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" }, "parameters": [ - "Object", - "Object.Behavior::Angle()", - "180", - "45", - "" + "Object" ] } ] + } + ], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::FillColor" + }, + "parameters": [ + "BackgroundPainter", + "BackgroundColor" + ] }, { "type": { - "value": "HedgehogPlatformer::IsCharacterPushingPlatform" + "value": "PrimitiveDrawing::RoundedRectangle" }, "parameters": [ - "", - "Character", - "HedgehogCharacter", - "Object", - "", - "" + "BackgroundPainter", + "Padding", + "Padding", + "Object.Width()-Padding", + "Object.Height()-Padding", + "CornerRadius" ] - } - ], - "actions": [ + }, { "type": { - "value": "SetReturnBoolean" + "value": "Montre" }, "parameters": [ - "True" + "Object", + "" ] } ] @@ -35111,88 +40640,49 @@ { "type": { "inverted": true, - "value": "HedgehogPlatformer::IsAngleAround" + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsShown" }, "parameters": [ - "Object", - "Object.Behavior::Angle()", - "0", - "15", - "" + "Object" ] }, { "type": { "inverted": true, - "value": "HedgehogPlatformer::IsAngleAround" + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" }, "parameters": [ - "Object", - "Object.Behavior::Angle()", - "180", - "15", - "" + "Object" ] - }, + } + ], + "actions": [ { "type": { - "value": "HedgehogPlatformer::IsCharacterOnPlatform" + "value": "Cache" }, "parameters": [ - "", - "Character", - "HedgehogCharacter", - "Object", - "", - "" + "Object" ] } - ], + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "MettreY" }, "parameters": [ - "True" + "Icon", + "=", + "Text.Y() - 100" ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "HedgehogPlatformer::Spring", - "type": "behavior" - }, - { - "description": "Character", - "name": "Character", - "type": "objectList" }, - { - "description": "Hedgehog platformer character", - "name": "HedgehogCharacter", - "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacter", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Make the spring push the character.", - "fullName": "Push character", - "functionType": "Action", - "name": "Push", - "sentence": "_PARAM0_ push _PARAM2_", - "events": [ { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -35203,95 +40693,130 @@ "textG": 0, "textR": 0 }, - "comment": "Project the character speed on the spring tangente (-unitY, unitX) to get the lateral speed.\nOnly keep this lateral speed and \"replace\" the speed in the spring direction with the push speed value.\n\nFor instance, for vertical springs, this allows to keep the speed on X while setting the speed on Y no matter what was the character Y speed before.\nThe formula is a generalization to this for any spring angle." + "comment": "Animate the icon" }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SetNumberVariable" + "inverted": true, + "value": "Tween::Exists" }, "parameters": [ - "unitX", - "=", - "cos(ToRad(Object.Angle()))" + "Icon", + "Tween", + "\"Rotate\"" ] }, { "type": { - "value": "SetNumberVariable" + "inverted": true, + "value": "Tween::Exists" }, "parameters": [ - "unitY", - "=", - "sin(ToRad(Object.Angle()))" + "Icon", + "Tween", + "\"RotateBack\"" ] - }, + } + ], + "actions": [ { "type": { - "value": "SetNumberVariable" + "value": "Tween::TweenBehavior::AddObjectAngleTween2" }, "parameters": [ - "LateralSpeed", - "=", - "- Character.HedgehogCharacter::SpeedX() * unitY + Character.HedgehogCharacter::SpeedY() * unitX" + "Icon", + "Tween", + "\"Rotate\"", + "8", + "\"easeInOutQuad\"", + "2", + "" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetSpeedX" + "value": "Tween::HasFinished" }, "parameters": [ - "Character", - "HedgehogCharacter", - "=", - "-LateralSpeed * unitY + PushSpeed * unitX", - "" + "Icon", + "Tween", + "\"RotateBack\"" ] - }, + } + ], + "actions": [ { "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetSpeedY" + "value": "Tween::TweenBehavior::AddObjectAngleTween2" }, "parameters": [ - "Character", - "HedgehogCharacter", - "=", - "LateralSpeed * unitX + PushSpeed * unitY", + "Icon", + "Tween", + "\"Rotate\"", + "8", + "\"easeInOutQuad\"", + "2", "" ] }, { "type": { - "value": "HedgehogPlatformer::HedgehogCharacter::SetRunningLockRemainingDuration" + "value": "Tween::RemoveTween" }, "parameters": [ - "Character", - "HedgehogCharacter", - "=", - "CharacterRunningLockDuration", - "" + "Icon", + "Tween", + "\"RotateBack\"" ] } - ], - "variables": [ + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "name": "unitX", - "type": "number", - "value": 0 - }, + "type": { + "value": "Tween::HasFinished" + }, + "parameters": [ + "Icon", + "Tween", + "\"Rotate\"" + ] + } + ], + "actions": [ { - "name": "unitY", - "type": "number", - "value": 0 + "type": { + "value": "Tween::TweenBehavior::AddObjectAngleTween2" + }, + "parameters": [ + "Icon", + "Tween", + "\"RotateBack\"", + "-8", + "\"easeInOutQuad\"", + "2", + "" + ] }, { - "folded": true, - "name": "LateralSpeed", - "type": "number", - "value": 0 + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Icon", + "Tween", + "\"Rotate\"" + ] } ] } @@ -35300,142 +40825,125 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "HedgehogPlatformer::Spring", - "type": "behavior" - }, - { - "description": "Character", - "name": "Character", - "type": "objectList" - }, - { - "description": "Hedgehog platformer character", - "name": "HedgehogCharacter", - "supplementaryInformation": "HedgehogPlatformer::HedgehogCharacter", - "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "", - "functionType": "Expression", - "name": "Angle", - "private": true, - "sentence": "", + "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", + "group": "Screen Orientation Checker configuration", + "name": "IsForceShown", + "sentence": "_PARAM0_ is forced to be shown", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SetNumberVariable" + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" }, "parameters": [ - "Angle", - "=", - "Object.Angle()" + "Object" ] } ], - "events": [ + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "FlippableCapability::FlippableBehavior::FlippedX" - }, - "parameters": [ - "Object", - "Flip" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Angle", - "=", - "180 - Angle" - ] - } + "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", + "group": "Screen Orientation Checker configuration", + "name": "SetIsForceShown", + "sentence": "Force _PARAM0_ to be shown: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "FlippableCapability::FlippableBehavior::FlippedY" - }, - "parameters": [ - "Object", - "Flip" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Angle", - "=", - "-Angle" - ] - } + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Angle" - ] - } + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsForceShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" ] } ], - "variables": [ + "actions": [ { - "folded": true, - "name": "Angle", - "type": "number", - "value": 0 + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsForceShown" + }, + "parameters": [ + "Object", + "yes" + ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "HedgehogPlatformer::Spring", - "type": "behavior" + "defaultValue": "yes", + "description": "Force show the screen?", + "name": "Value", + "optional": true, + "type": "yesorno" } ], "objectGroups": [] @@ -35444,51 +40952,309 @@ "propertyDescriptors": [ { "value": "", - "type": "Behavior", - "label": "Hedgehog platform", + "type": "Boolean", + "label": "", "description": "", "group": "", - "extraInformation": [ - "HedgehogPlatformer::HedgehogPlatform" - ], - "name": "HedgehogPlatform" + "extraInformation": [], + "hidden": true, + "name": "IsShown" }, { "value": "", - "type": "Behavior", - "label": "Flippable capability", - "description": "", + "type": "Boolean", + "label": "Force show the screen", + "description": "Use this to test the screen in your game", "group": "", - "extraInformation": [ - "FlippableCapability::FlippableBehavior" - ], - "name": "Flip" + "extraInformation": [], + "name": "IsForceShown" }, { - "value": "1800", + "value": "5", "type": "Number", - "unit": "PixelSpeed", - "label": "Push speed", + "unit": "Pixel", + "label": "Padding", "description": "", - "group": "", + "group": "Appearance", "extraInformation": [], - "name": "PushSpeed" + "name": "Padding" }, { - "value": "0.267", + "value": "10", "type": "Number", - "unit": "Second", - "label": "Character running lock duration", + "unit": "Pixel", + "label": "Corner radius", + "description": "Corner radius for the background", + "group": "Appearance", + "extraInformation": [], + "name": "CornerRadius" + }, + { + "value": "0;0;0", + "type": "Color", + "label": "Background color", "description": "", - "group": "", + "group": "Appearance", "extraInformation": [], - "name": "CharacterRunningLockDuration" + "name": "BackgroundColor" } ], - "sharedPropertyDescriptors": [] + "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, + "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": [] + } + ] } - ], - "eventsBasedObjects": [] + ] } ], "externalLayouts": [ @@ -35503,7 +41269,7 @@ "height": 160, "keepRatio": true, "layer": "TouchControls", - "name": "TopArrowButton", + "name": "JumpButton", "persistentUuid": "781da2a6-e2cd-4270-b845-6b4de5eebb68", "width": 160, "x": 1080, @@ -35520,7 +41286,7 @@ "height": 240, "keepRatio": true, "layer": "TouchControls", - "name": "FlatDarkJoystick", + "name": "WalkJoystick", "persistentUuid": "18990dd3-deb2-43d4-bc2c-5fd03ccb3445", "width": 240, "x": 200, @@ -35529,6 +41295,23 @@ "numberProperties": [], "stringProperties": [], "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 720, + "keepRatio": true, + "layer": "TouchControls", + "name": "ScreenOrientationChecker", + "persistentUuid": "d420474c-591f-4445-ae1b-2086004eb8c3", + "width": 1280, + "x": 0, + "y": 0, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] } ], "editionSettings": { @@ -35545,6 +41328,5 @@ "windowMask": false } } - ], - "externalSourceFiles": [] + ] } \ No newline at end of file diff --git "a/examples/360\302\260-platformer/assets/rotate-screen-icon.png" "b/examples/360\302\260-platformer/assets/rotate-screen-icon.png" new file mode 100644 index 000000000..a7726dee3 Binary files /dev/null and "b/examples/360\302\260-platformer/assets/rotate-screen-icon.png" differ 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 37bfd4639..590465591 100644 --- a/examples/3d-car-coin-hunt/3d-car-coin-hunt.json +++ b/examples/3d-car-coin-hunt/3d-car-coin-hunt.json @@ -622,6 +622,18 @@ "name": "rotate-screen-icon.png", "smoothed": true, "userAdded": false + }, + { + "file": "assets/rotate-screen-icon2.png", + "kind": "image", + "metadata": "", + "name": "rotate-screen-icon.png2", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Mobile Layouts/assets/6a8102ce3340bf9f62300ee1a81ef0b2327b2c6e8d62d7dda68d547f5e2b5969_rotate-screen-icon.png", + "name": "rotate-screen-icon.png" + } } ], "resourceFolders": [] @@ -1218,38 +1230,6 @@ "stringProperties": [], "initialVariables": [] }, - { - "angle": 0, - "customSize": true, - "depth": 32, - "height": 160, - "layer": "MobileControls", - "name": "SteeringJoystick", - "persistentUuid": "e7a38e33-5747-430c-a64d-48abea077533", - "width": 160, - "x": 112, - "y": 592, - "zOrder": 25, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 32, - "height": 160, - "layer": "MobileControls", - "name": "PedalJoystick", - "persistentUuid": "9ba6ad16-9ad5-46b5-b696-e0d27e639c61", - "width": 160, - "x": 1168, - "y": 592, - "zOrder": 26, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, { "angle": 0, "customSize": true, @@ -1763,7 +1743,8 @@ "Physics2": "Physics2", "ShakeModel3D": "ShakeModel3D", "GripFactor": 1, - "GripRatioMin": 0.075 + "GripRatioMin": 0.075, + "GrassGripRatioFactor": 0.5 }, { "name": "Physics2", @@ -2354,6 +2335,141 @@ ] } } + }, + { + "assetStoreId": "e5919fb86a559b00001678c710efe55f4e9f2e032a9ff9610087370f998d57de", + "name": "ScreenOrientationChecker", + "type": "ScreenOrientationChecker::ScreenOrientationChecker", + "variables": [], + "effects": [], + "behaviors": [ + { + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "name": "Anchor", + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "type": "AnchorBehavior::AnchorBehavior", + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "IsForceShown": false, + "BackgroundColor": "24;24;24", + "CornerRadius": 8, + "Padding": 5 + }, + "childrenContent": { + "BackgroundPainter": { + "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 + } + }, + "Icon": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "rotate-screen-icon.png2", + "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 + } + ] + ] + } + ] + } + ] + } + ] + }, + "Text": { + "bold": true, + "italic": false, + "smoothed": true, + "underlined": false, + "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, + "color": "255;255;255" + } + } + } } ], "objectsFolderStructure": { @@ -2393,6 +2509,9 @@ { "objectName": "SteeringJoystick" }, + { + "objectName": "ScreenOrientationChecker" + }, { "objectName": "TutorialText" }, @@ -2887,61 +3006,153 @@ "conditions": [ { "type": { - "value": "DepartScene" + "value": "SystemInfo::HasTouchScreen" }, "parameters": [ "" ] } ], - "actions": [ + "actions": [], + "events": [ { - "type": { - "value": "Cache" - }, - "parameters": [ - "SteeringJoystick" + "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": [ + "SteeringJoystick" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "PedalJoystick" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "SteeringJoystick", + "", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "PedalJoystick", + "", + "" + ] + } + ] + } ] }, { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" - }, - "parameters": [ - "SteeringJoystick", - "", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "SteeringJoystick", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "SteeringJoystick", + "CursorX(\"UI\")", + "CursorY(\"UI\")", + "" + ] + } ] }, { - "type": { - "value": "Cache" - }, - "parameters": [ - "PedalJoystick" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "PedalJoystick", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "PedalJoystick", + "CursorX(\"UI\")", + "CursorY(\"UI\")", + "" + ] + } ] }, - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" - }, - "parameters": [ - "PedalJoystick", - "", - "" - ] - } - ], - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": true, - "value": "SystemInfo::HasTouchScreen" + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" }, "parameters": [ + "PedalJoystick", "" ] } @@ -2949,19 +3160,39 @@ "actions": [ { "type": { - "value": "Delete" + "value": "PhysicsCar::PhysicsCar::SimulateAccelerationStick" + }, + "parameters": [ + "Player", + "PhysicsCar", + "-PedalJoystick.StickForceY()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" }, "parameters": [ "SteeringJoystick", "" ] - }, + } + ], + "actions": [ { "type": { - "value": "Delete" + "value": "PhysicsCar::PhysicsCar::SimulateSteeringStick" }, "parameters": [ - "PedalJoystick", + "Player", + "PhysicsCar", + "SteeringJoystick.StickForceX()", "" ] } @@ -2969,118 +3200,6 @@ } ] }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" - }, - "parameters": [ - "", - "SteeringJoystick", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" - }, - "parameters": [ - "SteeringJoystick", - "CursorX(\"UI\")", - "CursorY(\"UI\")", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" - }, - "parameters": [ - "", - "PedalJoystick", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" - }, - "parameters": [ - "PedalJoystick", - "CursorX(\"UI\")", - "CursorY(\"UI\")", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" - }, - "parameters": [ - "PedalJoystick", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PhysicsCar::PhysicsCar::SimulateAccelerationStick" - }, - "parameters": [ - "Player", - "PhysicsCar", - "-PedalJoystick.StickForceY()", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" - }, - "parameters": [ - "SteeringJoystick", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PhysicsCar::PhysicsCar::SimulateSteeringStick" - }, - "parameters": [ - "Player", - "PhysicsCar", - "SteeringJoystick.StickForceX()", - "" - ] - } - ] - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], @@ -3112,6 +3231,17 @@ "True", "" ] + }, + { + "type": { + "value": "AdvancedWheelGrip::AdvancedWheelGrip::SetSurface" + }, + "parameters": [ + "Player", + "AdvancedWheelGrip", + "\"Asphalt\"", + "" + ] } ] }, @@ -3685,23 +3815,6 @@ } ] }, - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 0.1, - "cameraType": "perspective", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "MobileControls", - "renderingType": "2d", - "visibility": true, - "cameras": [], - "effects": [] - }, { "ambientLightColorB": 200, "ambientLightColorG": 200, @@ -3732,6 +3845,23 @@ } ] }, + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "MobileControls", + "renderingType": "2d", + "visibility": true, + "cameras": [], + "effects": [] + }, { "ambientLightColorB": 200, "ambientLightColorG": 200, @@ -3771,6 +3901,10 @@ "name": "AdvancedWheelGrip", "type": "AdvancedWheelGrip::AdvancedWheelGrip" }, + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior" + }, { "name": "Animation", "type": "AnimatableCapability::AnimatableBehavior" @@ -4399,9 +4533,13 @@ "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 screen asking the user to rotate their phone/tablet if not in the right orientation.", - "version": "0.0.1", - "description": "Display a screen asking the user to rotate their phone/tablet if not in the right orientation.", + "shortDescription": "Display a customizable screen asking the user to rotate their phone/tablet if not in the right orientation.", + "version": "0.0.2", + "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" @@ -4477,7 +4615,7 @@ "areaMinY": 0, "areaMinZ": 0, "defaultName": "", - "description": "Automatically display a black screen asking the player to rotate their screen if needed - on mobile phones and tablets only. Put this at position 0;0 on a UI layer (or a layer where the camera is not moving).", + "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, @@ -4698,25 +4836,24 @@ "actions": [ { "type": { - "value": "ResizableCapability::ResizableBehavior::SetSize" + "value": "PrimitiveDrawing::FillColor" }, "parameters": [ - "Object", - "Resizable", - "ScreenWidth()", - "ScreenHeight()" + "BackgroundPainter", + "BackgroundColor" ] }, { "type": { - "value": "PrimitiveDrawing::Rectangle" + "value": "PrimitiveDrawing::RoundedRectangle" }, "parameters": [ "BackgroundPainter", - "0", - "0", - "SceneWindowWidth()", - "SceneWindowHeight()" + "Padding", + "Padding", + "Object.Width()-Padding", + "Object.Height()-Padding", + "CornerRadius" ] }, { @@ -4774,7 +4911,7 @@ "parameters": [ "Icon", "=", - "Text.Y() - 150" + "Text.Y() - 100" ] } ] @@ -4928,7 +5065,7 @@ "objectGroups": [] }, { - "description": "Check if the screen should be forced to be shown. Use this to test the screen in your game", + "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", "group": "Screen Orientation Checker configuration", @@ -4970,7 +5107,7 @@ "objectGroups": [] }, { - "description": "Change if the screen should be forced to be shown. Use this to test the screen in your game", + "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", "group": "Screen Orientation Checker configuration", @@ -5064,6 +5201,35 @@ "group": "", "extraInformation": [], "name": "IsForceShown" + }, + { + "value": "5", + "type": "Number", + "unit": "Pixel", + "label": "Padding", + "description": "", + "group": "Appearance", + "extraInformation": [], + "name": "Padding" + }, + { + "value": "10", + "type": "Number", + "unit": "Pixel", + "label": "Corner radius", + "description": "Corner radius for the background", + "group": "Appearance", + "extraInformation": [], + "name": "CornerRadius" + }, + { + "value": "0;0;0", + "type": "Color", + "label": "Background color", + "description": "", + "group": "Appearance", + "extraInformation": [], + "name": "BackgroundColor" } ], "objects": [ @@ -5132,7 +5298,7 @@ "effects": [], "behaviors": [], "fillOpacity": 255, - "outlineSize": 1, + "outlineSize": 0, "outlineOpacity": 255, "absoluteCoordinates": true, "clearBetweenFrames": true, @@ -5162,9 +5328,9 @@ "type": "AnchorBehavior::AnchorBehavior", "bottomEdgeAnchor": 0, "leftEdgeAnchor": 4, + "topEdgeAnchor": 4, "relativeToOriginalWindowSize": true, "rightEdgeAnchor": 0, - "topEdgeAnchor": 0, "useLegacyBottomAndRightAnchors": false }, { @@ -5312,8 +5478,8 @@ "name": "Icon", "persistentUuid": "39cbfc66-13f4-43dc-b6ef-2bda83153277", "width": 0, - "x": 198, - "y": 62, + "x": 204, + "y": 64, "zOrder": 16, "numberProperties": [], "stringProperties": [], @@ -46134,6 +46300,73 @@ "zoomFactor": 0.20220707303602042, "windowMask": false } + }, + { + "associatedLayout": "Game", + "name": "Touch controls", + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 32, + "height": 160, + "layer": "MobileControls", + "name": "SteeringJoystick", + "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": "PedalJoystick", + "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, + "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 + } } ] } \ No newline at end of file diff --git a/examples/3d-car-coin-hunt/assets/rotate-screen-icon2.png b/examples/3d-car-coin-hunt/assets/rotate-screen-icon2.png new file mode 100644 index 000000000..a7726dee3 Binary files /dev/null and b/examples/3d-car-coin-hunt/assets/rotate-screen-icon2.png differ diff --git a/examples/3d-first-person/3d-first-person.json b/examples/3d-first-person/3d-first-person.json index 3910ffd66..dd0cbba5f 100644 --- a/examples/3d-first-person/3d-first-person.json +++ b/examples/3d-first-person/3d-first-person.json @@ -11,7 +11,7 @@ "antialiasingMode": "MSAA", "antialisingEnabledOnMobile": false, "folderProject": false, - "orientation": "default", + "orientation": "landscape", "packageName": "com.example.firstperson3d", "pixelsRounding": false, "projectUuid": "df6e4793-47c9-4ab9-af06-e31eecacbe56", @@ -410,6 +410,18 @@ "name": "assets\\Line light joystick border.png", "smoothed": true, "userAdded": false + }, + { + "file": "assets/rotate-screen-icon.png", + "kind": "image", + "metadata": "", + "name": "rotate-screen-icon.png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Mobile Layouts/assets/6a8102ce3340bf9f62300ee1a81ef0b2327b2c6e8d62d7dda68d547f5e2b5969_rotate-screen-icon.png", + "name": "rotate-screen-icon.png" + } } ], "resourceFolders": [] @@ -1703,6 +1715,141 @@ ] } ] + }, + { + "assetStoreId": "e5919fb86a559b00001678c710efe55f4e9f2e032a9ff9610087370f998d57de", + "name": "ScreenOrientationChecker", + "type": "ScreenOrientationChecker::ScreenOrientationChecker", + "variables": [], + "effects": [], + "behaviors": [ + { + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "name": "Anchor", + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "type": "AnchorBehavior::AnchorBehavior", + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "IsForceShown": false, + "BackgroundColor": "24;24;24", + "CornerRadius": 8, + "Padding": 5 + }, + "childrenContent": { + "BackgroundPainter": { + "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 + } + }, + "Icon": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "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 + } + ] + ] + } + ] + } + ] + } + ] + }, + "Text": { + "bold": true, + "italic": false, + "smoothed": true, + "underlined": false, + "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, + "color": "255;255;255" + } + } + } } ], "objectsFolderStructure": { @@ -1716,6 +1863,12 @@ }, { "objectName": "WalkJoystick" + }, + { + "objectName": "JumpButton" + }, + { + "objectName": "ScreenOrientationChecker" } ] }, @@ -1741,9 +1894,6 @@ }, { "objectName": "SelectionParticleEmitter" - }, - { - "objectName": "JumpButton" } ] }, @@ -2169,23 +2319,6 @@ } ] }, - { - "ambientLightColorB": 8908016, - "ambientLightColorG": 0, - "ambientLightColorR": 6071712, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 0.1, - "cameraType": "perspective", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "MobileUI", - "renderingType": "", - "visibility": true, - "cameras": [], - "effects": [] - }, { "ambientLightColorB": 200, "ambientLightColorG": 200, @@ -2218,6 +2351,23 @@ "booleanParameters": {} } ] + }, + { + "ambientLightColorB": 8908016, + "ambientLightColorG": 0, + "ambientLightColorR": 6071712, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "MobileUI", + "renderingType": "", + "visibility": true, + "cameras": [], + "effects": [] } ], "behaviorsSharedData": [ @@ -31850,42 +32000,1023 @@ ], "eventsBasedBehaviors": [], "eventsBasedObjects": [] - } - ], - "externalLayouts": [ + }, { - "associatedLayout": "GameScene", - "name": "TouchControls", - "instances": [ + "author": "", + "category": "Input", + "extensionNamespace": "", + "fullName": "Screen Orientation Checker", + "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.0.2", + "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": true, - "depth": 48, - "height": 200, - "layer": "MobileUI", - "name": "WalkJoystick", - "persistentUuid": "bd321905-a3f3-4994-9737-fbd87e6ed993", - "width": 200, - "x": 200, - "y": 520, - "zOrder": 6, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "name": "TargetOrientation", + "type": "string", + "value": "" + } + ], + "sceneVariables": [], + "eventsFunctions": [ + { + "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": 0, - "customSize": true, - "depth": 0, - "height": 160, - "keepRatio": true, - "layer": "MobileUI", - "name": "JumpButton", - "persistentUuid": "72dd11a7-9e01-4323-bcd5-37e3cb16247b", - "width": 160, - "x": 1143, - "y": 580, - "zOrder": 8, + "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", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "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": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "!=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + } + ] + }, + { + "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": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + } + ] + } + ] + }, + { + "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": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsShown" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::FillColor" + }, + "parameters": [ + "BackgroundPainter", + "BackgroundColor" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::RoundedRectangle" + }, + "parameters": [ + "BackgroundPainter", + "Padding", + "Padding", + "Object.Width()-Padding", + "Object.Height()-Padding", + "CornerRadius" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsShown" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "inverted": true, + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" + ] + } + ], + "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": "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", + "group": "Screen Orientation Checker configuration", + "name": "IsForceShown", + "sentence": "_PARAM0_ is forced to be shown", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" + ] + } + ], + "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", + "group": "Screen Orientation Checker configuration", + "name": "SetIsForceShown", + "sentence": "Force _PARAM0_ to be shown: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsForceShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsForceShown" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + }, + { + "defaultValue": "yes", + "description": "Force show the screen?", + "name": "Value", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsShown" + }, + { + "value": "", + "type": "Boolean", + "label": "Force show the screen", + "description": "Use this to test the screen in your game", + "group": "", + "extraInformation": [], + "name": "IsForceShown" + }, + { + "value": "5", + "type": "Number", + "unit": "Pixel", + "label": "Padding", + "description": "", + "group": "Appearance", + "extraInformation": [], + "name": "Padding" + }, + { + "value": "10", + "type": "Number", + "unit": "Pixel", + "label": "Corner radius", + "description": "Corner radius for the background", + "group": "Appearance", + "extraInformation": [], + "name": "CornerRadius" + }, + { + "value": "0;0;0", + "type": "Color", + "label": "Background color", + "description": "", + "group": "Appearance", + "extraInformation": [], + "name": "BackgroundColor" + } + ], + "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, + "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": [] + } + ] + } + ] + } + ], + "externalLayouts": [ + { + "associatedLayout": "GameScene", + "name": "TouchControls", + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 48, + "height": 200, + "layer": "MobileUI", + "name": "WalkJoystick", + "persistentUuid": "bd321905-a3f3-4994-9737-fbd87e6ed993", + "width": 200, + "x": 200, + "y": 520, + "zOrder": 6, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 160, + "keepRatio": true, + "layer": "MobileUI", + "name": "JumpButton", + "persistentUuid": "72dd11a7-9e01-4323-bcd5-37e3cb16247b", + "width": 160, + "x": 1070, + "y": 510, + "zOrder": 8, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 720, + "layer": "MobileUI", + "name": "ScreenOrientationChecker", + "persistentUuid": "8e7d6106-3bdf-4ad5-ab81-7cacf52e5c61", + "width": 1280, + "x": 0, + "y": 0, + "zOrder": 9, "numberProperties": [], "stringProperties": [], "initialVariables": [] diff --git a/examples/3d-first-person/assets/rotate-screen-icon.png b/examples/3d-first-person/assets/rotate-screen-icon.png new file mode 100644 index 000000000..a7726dee3 Binary files /dev/null and b/examples/3d-first-person/assets/rotate-screen-icon.png differ diff --git a/examples/3d-platformer/3d-platformer.json b/examples/3d-platformer/3d-platformer.json index bfe6233e8..54dc254b3 100644 --- a/examples/3d-platformer/3d-platformer.json +++ b/examples/3d-platformer/3d-platformer.json @@ -11,7 +11,7 @@ "antialiasingMode": "MSAA", "antialisingEnabledOnMobile": false, "folderProject": false, - "orientation": "default", + "orientation": "landscape", "packageName": "com.example.gamename", "pixelsRounding": false, "projectUuid": "701be25e-75ee-4938-a0b8-482129fc0350", @@ -380,6 +380,18 @@ "name": "assets\\Line dark joystick border.png", "smoothed": true, "userAdded": false + }, + { + "file": "assets/rotate-screen-icon.png", + "kind": "image", + "metadata": "", + "name": "rotate-screen-icon.png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Mobile Layouts/assets/6a8102ce3340bf9f62300ee1a81ef0b2327b2c6e8d62d7dda68d547f5e2b5969_rotate-screen-icon.png", + "name": "rotate-screen-icon.png" + } } ], "resourceFolders": [] @@ -2533,12 +2545,12 @@ "effects": [], "behaviors": [ { + "leftEdgeAnchor": 0, "name": "Anchor", + "rightEdgeAnchor": 2, "type": "AnchorBehavior::AnchorBehavior", "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 2, "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 0, "topEdgeAnchor": 0, "useLegacyBottomAndRightAnchors": false }, @@ -3478,6 +3490,141 @@ ] } } + }, + { + "assetStoreId": "e5919fb86a559b00001678c710efe55f4e9f2e032a9ff9610087370f998d57de", + "name": "ScreenOrientationChecker", + "type": "ScreenOrientationChecker::ScreenOrientationChecker", + "variables": [], + "effects": [], + "behaviors": [ + { + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "name": "Anchor", + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "type": "AnchorBehavior::AnchorBehavior", + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "IsForceShown": false, + "BackgroundColor": "24;24;24", + "CornerRadius": 8, + "Padding": 5 + }, + "childrenContent": { + "BackgroundPainter": { + "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 + } + }, + "Icon": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "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 + } + ] + ] + } + ] + } + ] + } + ] + }, + "Text": { + "bold": true, + "italic": false, + "smoothed": true, + "underlined": false, + "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, + "color": "255;255;255" + } + } + } } ], "objectsFolderStructure": { @@ -3503,6 +3650,9 @@ { "objectName": "LookJoystick" }, + { + "objectName": "ScreenOrientationChecker" + }, { "objectName": "JumpButton" } @@ -4912,39 +5062,6 @@ "visibility": true, "cameras": [], "effects": [] - }, - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 0.1, - "cameraType": "perspective", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "Crosshair", - "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": [ @@ -53421,6 +53538,971 @@ } ], "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Input", + "extensionNamespace": "", + "fullName": "Screen Orientation Checker", + "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.0.2", + "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": [ + { + "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", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "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": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "!=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + } + ] + }, + { + "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": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + } + ] + } + ] + }, + { + "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": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsShown" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::FillColor" + }, + "parameters": [ + "BackgroundPainter", + "BackgroundColor" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::RoundedRectangle" + }, + "parameters": [ + "BackgroundPainter", + "Padding", + "Padding", + "Object.Width()-Padding", + "Object.Height()-Padding", + "CornerRadius" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsShown" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "inverted": true, + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" + ] + } + ], + "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": "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", + "group": "Screen Orientation Checker configuration", + "name": "IsForceShown", + "sentence": "_PARAM0_ is forced to be shown", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" + ] + } + ], + "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", + "group": "Screen Orientation Checker configuration", + "name": "SetIsForceShown", + "sentence": "Force _PARAM0_ to be shown: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsForceShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsForceShown" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + }, + { + "defaultValue": "yes", + "description": "Force show the screen?", + "name": "Value", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsShown" + }, + { + "value": "", + "type": "Boolean", + "label": "Force show the screen", + "description": "Use this to test the screen in your game", + "group": "", + "extraInformation": [], + "name": "IsForceShown" + }, + { + "value": "5", + "type": "Number", + "unit": "Pixel", + "label": "Padding", + "description": "", + "group": "Appearance", + "extraInformation": [], + "name": "Padding" + }, + { + "value": "10", + "type": "Number", + "unit": "Pixel", + "label": "Corner radius", + "description": "Corner radius for the background", + "group": "Appearance", + "extraInformation": [], + "name": "CornerRadius" + }, + { + "value": "0;0;0", + "type": "Color", + "label": "Background color", + "description": "", + "group": "Appearance", + "extraInformation": [], + "name": "BackgroundColor" + } + ], + "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, + "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": [] + } + ] + } + ] } ], "externalLayouts": [ @@ -53436,8 +54518,8 @@ "name": "WalkJoystick", "persistentUuid": "b8623baa-218d-49cf-a5bf-38c1b956e2e8", "width": 200, - "x": 150, - "y": 575, + "x": 200, + "y": 525, "zOrder": 6, "numberProperties": [], "stringProperties": [], @@ -53452,12 +54534,28 @@ "name": "JumpButton", "persistentUuid": "d2c5f4e2-d0f4-4b0d-8a43-e2ec39e2fba4", "width": 180, - "x": 1040, - "y": 485, + "x": 990, + "y": 435, "zOrder": 25, "numberProperties": [], "stringProperties": [], "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 720, + "layer": "MobileUI", + "name": "ScreenOrientationChecker", + "persistentUuid": "449da419-5569-4265-8eb1-0f3bc83e1113", + "width": 1280, + "x": 0, + "y": 0, + "zOrder": 26, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] } ], "editionSettings": { diff --git a/examples/3d-platformer/assets/rotate-screen-icon.png b/examples/3d-platformer/assets/rotate-screen-icon.png new file mode 100644 index 000000000..a7726dee3 Binary files /dev/null and b/examples/3d-platformer/assets/rotate-screen-icon.png differ diff --git a/examples/3d-shark-frenzy/3d-shark-frenzy.json b/examples/3d-shark-frenzy/3d-shark-frenzy.json index f14c89834..dc1bbce6c 100644 --- a/examples/3d-shark-frenzy/3d-shark-frenzy.json +++ b/examples/3d-shark-frenzy/3d-shark-frenzy.json @@ -1,9 +1,9 @@ { "firstLayout": "Menu", "gdVersion": { - "build": 217, + "build": 221, "major": 5, - "minor": 4, + "minor": 5, "revision": 0 }, "properties": { @@ -18,7 +18,6 @@ "scaleMode": "linear", "sizeOnStartupMode": "adaptWidth", "templateSlug": "", - "useExternalSourceFiles": false, "version": "1.0.0", "name": "Shark Frenzy", "description": "Controls:\nPC:\n- Arrow keys to move\n- Left shift to sprint\nMobile:\n- Joystick for movement\n- Button for sprint", @@ -134,7 +133,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/ExplosionTexture1.png", "kind": "image", "metadata": "", @@ -147,7 +145,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/tiled_Summer Tile Water.png", "kind": "image", "metadata": "", @@ -160,7 +157,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/tiled_Sky Background.png", "kind": "image", "metadata": "", @@ -173,7 +169,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Line light joystick border.png", "kind": "image", "metadata": "", @@ -186,7 +181,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Line light joystick thumb.png", "kind": "image", "metadata": "", @@ -199,7 +193,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Red.png", "kind": "image", "metadata": "{\"extension\":\".png\",\"pskl\":{}}", @@ -252,7 +245,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Metal Bar Border.png", "kind": "image", "metadata": "", @@ -265,7 +257,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Pixel Red Fill Bar.png", "kind": "image", "metadata": "", @@ -278,7 +269,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Fire round button.png", "kind": "image", "metadata": "", @@ -291,7 +281,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Shaded Blue Fill Bar.png", "kind": "image", "metadata": "", @@ -326,7 +315,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Black.png", "kind": "image", "metadata": "{\"extension\":\".png\"}", @@ -335,7 +323,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Blue Button With Shadow_Hovered.png", "kind": "image", "metadata": "", @@ -348,7 +335,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Blue Button With Shadow_Idle.png", "kind": "image", "metadata": "", @@ -361,7 +347,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Blue Button With Shadow_Pressed.png", "kind": "image", "metadata": "", @@ -441,7 +426,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Square Blue Slider Border.png", "kind": "image", "metadata": "", @@ -454,7 +438,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Square Blue Slider Fill Bar.png", "kind": "image", "metadata": "", @@ -467,7 +450,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Square Blue Slider Thumb.png", "kind": "image", "metadata": "", @@ -480,7 +462,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Yellow.png", "kind": "image", "metadata": "{\"extension\":\".png\",\"pskl\":{}}", @@ -500,7 +481,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/LightGlow.png", "kind": "image", "metadata": "", @@ -549,7 +529,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Transperent.png", "kind": "image", "metadata": "{\"extension\":\".png\",\"pskl\":{}}", @@ -558,7 +537,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/boundary.png", "kind": "image", "metadata": "", @@ -571,7 +549,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Poison_Bubbles_2.png", "kind": "image", "metadata": "{\"localFilePath\":\"assets/Poison_Bubbles_2.png\",\"extension\":\".png\"}", @@ -584,7 +561,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/thumbnail-game.png", "kind": "image", "metadata": "", @@ -593,7 +569,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/rotate-screen-icon.png", "kind": "image", "metadata": "", @@ -840,8 +815,8 @@ "behaviors": [ { "name": "Anchor", - "rightEdgeAnchor": 0, "type": "AnchorBehavior::AnchorBehavior", + "rightEdgeAnchor": 0, "bottomEdgeAnchor": 0, "leftEdgeAnchor": 4, "relativeToOriginalWindowSize": true, @@ -935,8 +910,8 @@ "behaviors": [ { "name": "Anchor", - "rightEdgeAnchor": 0, "type": "AnchorBehavior::AnchorBehavior", + "rightEdgeAnchor": 0, "bottomEdgeAnchor": 0, "leftEdgeAnchor": 4, "relativeToOriginalWindowSize": true, @@ -984,8 +959,8 @@ "behaviors": [ { "name": "Anchor", - "rightEdgeAnchor": 0, "type": "AnchorBehavior::AnchorBehavior", + "rightEdgeAnchor": 0, "bottomEdgeAnchor": 0, "leftEdgeAnchor": 4, "relativeToOriginalWindowSize": true, @@ -1079,8 +1054,8 @@ "behaviors": [ { "name": "Anchor", - "rightEdgeAnchor": 0, "type": "AnchorBehavior::AnchorBehavior", + "rightEdgeAnchor": 0, "bottomEdgeAnchor": 0, "leftEdgeAnchor": 4, "relativeToOriginalWindowSize": true, @@ -1245,13 +1220,13 @@ "effects": [], "behaviors": [ { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", "bottomEdgeAnchor": 0, "leftEdgeAnchor": 4, - "name": "Anchor", "relativeToOriginalWindowSize": true, "rightEdgeAnchor": 0, "topEdgeAnchor": 0, - "type": "AnchorBehavior::AnchorBehavior", "useLegacyBottomAndRightAnchors": false } ], @@ -1340,13 +1315,13 @@ "effects": [], "behaviors": [ { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", "bottomEdgeAnchor": 0, "leftEdgeAnchor": 4, - "name": "Anchor", "relativeToOriginalWindowSize": true, "rightEdgeAnchor": 0, "topEdgeAnchor": 0, - "type": "AnchorBehavior::AnchorBehavior", "useLegacyBottomAndRightAnchors": false } ], @@ -1439,13 +1414,13 @@ "effects": [], "behaviors": [ { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", "bottomEdgeAnchor": 0, "leftEdgeAnchor": 4, - "name": "Anchor", "relativeToOriginalWindowSize": true, "rightEdgeAnchor": 0, "topEdgeAnchor": 0, - "type": "AnchorBehavior::AnchorBehavior", "useLegacyBottomAndRightAnchors": false } ], @@ -1492,10 +1467,10 @@ "effects": [], "behaviors": [ { - "leftEdgeAnchor": 1, "name": "Anchor", - "rightEdgeAnchor": 2, "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "rightEdgeAnchor": 2, "bottomEdgeAnchor": 0, "relativeToOriginalWindowSize": true, "topEdgeAnchor": 0, @@ -2207,7 +2182,7 @@ "persistentUuid": "0323ca9b-ab3a-4734-ad65-15d1ee47cbb4", "width": 0, "x": 200, - "y": 600, + "y": 548, "zOrder": 16, "numberProperties": [], "stringProperties": [], @@ -2257,7 +2232,7 @@ "persistentUuid": "0afe5fb3-ccde-43a8-a3ff-4cc30a042321", "width": 107, "x": 1064, - "y": 565, + "y": 513, "zOrder": 19, "numberProperties": [], "stringProperties": [], @@ -3431,7 +3406,8 @@ "ButtonIdentifier": "FastSwim", "TouchId": 0, "TouchIndex": 2.0247e-320, - "IsReleased": false + "IsReleased": false, + "Radius": 200 } ], "animations": [ @@ -5212,6 +5188,57 @@ ] } ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "MoveJoystick" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "MoveJoystick", + "", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "MoveJoystick", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "MoveJoystick", + "CursorX(\"UI\")" + ] } ] }, @@ -8569,7 +8596,7 @@ "name": "Tween3D", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/30bc03f9cf5f2f42960246a605352a6937ae6b603f0177396a83193849a4724a_tennis-ball.svg", "shortDescription": "Smoothly squash, strentch, tint and wobble 3D models.", - "version": "0.2.0", + "version": "0.2.1", "description": [ "Change 3D models proportions over time to make smooth animations like wobbling.", "", @@ -9315,7 +9342,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "exp(Tween::Ease(GetArgumentAsString(\"Easing\"), log(GetArgumentAsNumber(\"InitialValue\")), log(GetArgumentAsNumber(\"TargetedValue\")), GetArgumentAsNumber(\"Weighting\")))" + "exp(Tween::Ease(Easing, log(InitialValue), log(TargetedValue), Weighting))" ] } ] @@ -9474,7 +9501,7 @@ "Object", "Object3D", "=", - "pow(Variable(_Tween3D.Volume) * GetArgumentAsNumber(\"Value\") * GetArgumentAsNumber(\"Value\"), 1/3)" + "pow(Variable(_Tween3D.Volume) * Value * Value, 1/3)" ] }, { @@ -9619,7 +9646,7 @@ "Object", "Scale", "=", - "pow(Variable(_Tween3D.Volume) * GetArgumentAsNumber(\"Value\") * GetArgumentAsNumber(\"Value\"), 1/3)" + "pow(Variable(_Tween3D.Volume) * Value * Value, 1/3)" ] }, { @@ -9753,7 +9780,7 @@ "parameters": [ "_Tween3D.Ratio", "=", - "pow(GetArgumentAsNumber(\"Value\") / Object.Behavior::ScaleVolume(), 1 / 3)" + "pow(Value / Object.Behavior::ScaleVolume(), 1 / 3)" ] }, { @@ -9881,207 +9908,6 @@ "group": "Size", "name": "TweenStretchZ", "sentence": "Tween the stretch Z of _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Tween3D::Tween3D::StartTween" - }, - "parameters": [ - "Object", - "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", - "GetArgumentAsNumber(\"TargetedValue\")", - "GetArgumentAsNumber(\"Duration\")", - "GetArgumentAsString(\"Easing\")", - "\"StretchZ\"", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Tween3D::Tween3D", - "type": "behavior" - }, - { - "description": "Tween identifier", - "name": "TweenIdentifier", - "supplementaryInformation": "objectTween3D", - "type": "identifier" - }, - { - "description": "Stretch on Z axis", - "name": "TargetedValue", - "type": "expression" - }, - { - "description": "Duration (in seconds)", - "name": "Duration", - "type": "expression" - }, - { - "description": "Easing", - "name": "Easing", - "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Tweens an object stretch Y from its current value to a new one. The stretch can never be 0 or less.", - "fullName": "Tween stretch Y", - "functionType": "Action", - "group": "Size", - "name": "TweenStretchY", - "sentence": "Tween the stretch Y of _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Tween3D::Tween3D::StartTween" - }, - "parameters": [ - "Object", - "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", - "GetArgumentAsNumber(\"TargetedValue\")", - "GetArgumentAsNumber(\"Duration\")", - "GetArgumentAsString(\"Easing\")", - "\"StretchY\"", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Tween3D::Tween3D", - "type": "behavior" - }, - { - "description": "Tween identifier", - "name": "TweenIdentifier", - "supplementaryInformation": "objectTween3D", - "type": "identifier" - }, - { - "description": "Stretch on Y axis", - "name": "TargetedValue", - "type": "expression" - }, - { - "description": "Duration (in seconds)", - "name": "Duration", - "type": "expression" - }, - { - "description": "Easing", - "name": "Easing", - "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Tweens an object scale volume from its current value to a new one. The scale volume can never be 0 or less.", - "fullName": "Tween scale volume", - "functionType": "Action", - "group": "Size", - "name": "TweenScaleVolume", - "sentence": "Tween the scale volume of _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Tween3D::Tween3D::StartTween" - }, - "parameters": [ - "Object", - "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", - "GetArgumentAsNumber(\"TargetedValue\")", - "GetArgumentAsNumber(\"Duration\")", - "GetArgumentAsString(\"Easing\")", - "\"ScaleVolume\"", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Tween3D::Tween3D", - "type": "behavior" - }, - { - "description": "Tween identifier", - "name": "TweenIdentifier", - "supplementaryInformation": "objectTween3D", - "type": "identifier" - }, - { - "description": "Scale volume", - "name": "TargetedValue", - "type": "expression" - }, - { - "description": "Duration (in seconds)", - "name": "Duration", - "type": "expression" - }, - { - "description": "Easing", - "name": "Easing", - "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Tweens the object color from its current value to a new one.", - "fullName": "Tween object color", - "functionType": "Action", - "group": "Color", - "name": "TweenTint", - "sentence": "Tween the color of _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -10095,10 +9921,211 @@ "Object", "Behavior", "TweenIdentifier", - "Tween3D::RgbToNumber(TargetedValue)", + "TargetedValue", "Duration", "Easing", - "\"Tint\"", + "\"StretchZ\"", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Stretch on Z axis", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object stretch Y from its current value to a new one. The stretch can never be 0 or less.", + "fullName": "Tween stretch Y", + "functionType": "Action", + "group": "Size", + "name": "TweenStretchY", + "sentence": "Tween the stretch Y of _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::StartTween" + }, + "parameters": [ + "Object", + "Behavior", + "TweenIdentifier", + "TargetedValue", + "Duration", + "Easing", + "\"StretchY\"", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Stretch on Y axis", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens an object scale volume from its current value to a new one. The scale volume can never be 0 or less.", + "fullName": "Tween scale volume", + "functionType": "Action", + "group": "Size", + "name": "TweenScaleVolume", + "sentence": "Tween the scale volume of _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::StartTween" + }, + "parameters": [ + "Object", + "Behavior", + "TweenIdentifier", + "TargetedValue", + "Duration", + "Easing", + "\"ScaleVolume\"", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + }, + { + "description": "Scale volume", + "name": "TargetedValue", + "type": "expression" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Tweens the object color from its current value to a new one.", + "fullName": "Tween object color", + "functionType": "Action", + "group": "Color", + "name": "TweenTint", + "sentence": "Tween the color of _PARAM0_ to _PARAM3_ over _PARAM4_ seconds with easing _PARAM5_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween3D::Tween3D::StartTween" + }, + "parameters": [ + "Object", + "Behavior", + "TweenIdentifier", + "Tween3D::RgbToNumber(TargetedValue)", + "Duration", + "Easing", + "\"Tint\"", "" ] } @@ -10163,10 +10190,10 @@ "Object", "Tween", "Object3D", - "GetArgumentAsString(\"TweenIdentifier\")", - "GetArgumentAsNumber(\"TargetedValue\")", - "GetArgumentAsString(\"Easing\")", - "GetArgumentAsNumber(\"Duration\")", + "TweenIdentifier", + "TargetedValue", + "Easing", + "Duration", "" ] } @@ -10231,10 +10258,10 @@ "Object", "Tween", "Object3D", - "GetArgumentAsString(\"TweenIdentifier\")", - "GetArgumentAsNumber(\"TargetedValue\")", - "GetArgumentAsString(\"Easing\")", - "GetArgumentAsNumber(\"Duration\")", + "TweenIdentifier", + "TargetedValue", + "Easing", + "Duration", "" ] } @@ -10299,10 +10326,10 @@ "Object", "Tween", "Object3D", - "GetArgumentAsString(\"TweenIdentifier\")", - "GetArgumentAsNumber(\"TargetedValue\")", - "GetArgumentAsString(\"Easing\")", - "GetArgumentAsNumber(\"Duration\")", + "TweenIdentifier", + "TargetedValue", + "Easing", + "Duration", "" ] } @@ -10367,10 +10394,10 @@ "Object", "Tween", "Object3D", - "GetArgumentAsString(\"TweenIdentifier\")", - "GetArgumentAsNumber(\"TargetedValue\")", - "GetArgumentAsString(\"Easing\")", - "GetArgumentAsNumber(\"Duration\")", + "TweenIdentifier", + "TargetedValue", + "Easing", + "Duration", "" ] } @@ -11076,7 +11103,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.VariableString(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Type)" + "Object.VariableString(_Tween3D.Tweens[TweenIdentifier].Type)" ] } ] @@ -11124,9 +11151,9 @@ }, "parameters": [ "Object", - "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Type", + "_Tween3D.Tweens[TweenIdentifier].Type", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -11170,7 +11197,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Variable(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Time)" + "Object.Variable(_Tween3D.Tweens[TweenIdentifier].Time)" ] } ] @@ -11218,9 +11245,9 @@ }, "parameters": [ "Object", - "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Time", + "_Tween3D.Tweens[TweenIdentifier].Time", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -11264,7 +11291,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Variable(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Duration)" + "Object.Variable(_Tween3D.Tweens[TweenIdentifier].Duration)" ] } ] @@ -11312,9 +11339,9 @@ }, "parameters": [ "Object", - "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Duration", + "_Tween3D.Tweens[TweenIdentifier].Duration", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -11358,7 +11385,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.VariableString(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Easing)" + "Object.VariableString(_Tween3D.Tweens[TweenIdentifier].Easing)" ] } ] @@ -11406,101 +11433,101 @@ }, "parameters": [ "Object", - "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Easing", - "=", - "GetArgumentAsString(\"Value\")" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Tween3D::Tween3D", - "type": "behavior" - }, - { - "description": "Tween identifier", - "name": "TweenIdentifier", - "supplementaryInformation": "objectTween3D", - "type": "identifier" - } - ], - "objectGroups": [] - }, - { - "description": "the tween initial value", - "fullName": "Initial value", - "functionType": "ExpressionAndCondition", - "name": "InitialValue", - "private": true, - "sentence": "the initial value of tween _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Variable(_Tween3D.Tweens[TweenIdentifier].InitialValue)" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Tween3D::Tween3D", - "type": "behavior" - }, - { - "description": "Tween identifier", - "name": "TweenIdentifier", - "supplementaryInformation": "objectTween3D", - "type": "identifier" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "InitialValue", - "name": "SetInitialValue", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "_Tween3D.Tweens[TweenIdentifier].InitialValue", + "_Tween3D.Tweens[TweenIdentifier].Easing", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "description": "the tween initial value", + "fullName": "Initial value", + "functionType": "ExpressionAndCondition", + "name": "InitialValue", + "private": true, + "sentence": "the initial value of tween _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Variable(_Tween3D.Tweens[TweenIdentifier].InitialValue)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Tween3D::Tween3D", + "type": "behavior" + }, + { + "description": "Tween identifier", + "name": "TweenIdentifier", + "supplementaryInformation": "objectTween3D", + "type": "identifier" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "InitialValue", + "name": "SetInitialValue", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "_Tween3D.Tweens[TweenIdentifier].InitialValue", "=", "Value" ] @@ -11640,7 +11667,7 @@ }, "parameters": [ "Object", - "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].IsPaused", + "_Tween3D.Tweens[TweenIdentifier].IsPaused", "True" ] } @@ -11705,7 +11732,7 @@ }, "parameters": [ "Object", - "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].IsPaused", + "_Tween3D.Tweens[TweenIdentifier].IsPaused", "True" ] } @@ -11731,7 +11758,7 @@ }, "parameters": [ "Object", - "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].IsPaused", + "_Tween3D.Tweens[TweenIdentifier].IsPaused", "False" ] } @@ -11781,7 +11808,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] } @@ -11795,8 +11822,8 @@ "Object", "Behavior", "=", - "Object.Behavior::Duration(GetArgumentAsString(\"TweenIdentifier\"))", - "GetArgumentAsString(\"TweenIdentifier\")", + "Object.Behavior::Duration(TweenIdentifier)", + "TweenIdentifier", "" ] } @@ -11862,7 +11889,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] } @@ -11875,7 +11902,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "yes", "" ] @@ -11921,7 +11948,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] } @@ -11934,7 +11961,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "no", "" ] @@ -11980,7 +12007,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] } @@ -11993,7 +12020,7 @@ "parameters": [ "Object", "_Tween3D.Tweens", - "GetArgumentAsString(\"TweenIdentifier\")" + "TweenIdentifier" ] }, { @@ -12047,7 +12074,7 @@ "parameters": [ "Object", "_Tween3D.Tweens", - "GetArgumentAsString(\"TweenIdentifier\")" + "TweenIdentifier" ] } ], @@ -12101,7 +12128,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] }, @@ -12113,7 +12140,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] }, @@ -12125,7 +12152,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] } @@ -12182,7 +12209,7 @@ "Behavior", ">=", "1", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] } @@ -12237,7 +12264,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] } @@ -12248,7 +12275,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::Time(GetArgumentAsString(\"TweenIdentifier\")) / Object.Behavior::Duration(GetArgumentAsString(\"TweenIdentifier\"))" + "Object.Behavior::Time(TweenIdentifier) / Object.Behavior::Duration(TweenIdentifier)" ] } ] @@ -12484,7 +12511,7 @@ "Object", "Behavior", "<", - "Object.Behavior::PropertyScaleMinTweenDuration()" + "ScaleMinTweenDuration" ] } ], @@ -12508,7 +12535,7 @@ "Object", "Behavior", "=", - "Tween3D::EaseExp(Object.Behavior::PropertyScaleMinTweenEasing(), Object.Behavior::PropertyScaleMinTweenInitialValue(), Object.Behavior::PropertyScaleMinTweenTarget(), Object.Behavior::PropertyScaleMinTweenTime() / Object.Behavior::PropertyScaleMinTweenDuration())" + "Tween3D::EaseExp(ScaleMinTweenEasing, ScaleMinTweenInitialValue, ScaleMinTweenTarget, ScaleMinTweenTime / ScaleMinTweenDuration)" ] } ], @@ -12524,7 +12551,7 @@ "Object", "Behavior", ">=", - "Object.Behavior::PropertyScaleMinTweenDuration()" + "ScaleMinTweenDuration" ] } ], @@ -12537,7 +12564,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyScaleMinTweenTarget()" + "ScaleMinTweenTarget" ] } ] @@ -12555,7 +12582,7 @@ "Object", "Behavior", "<", - "Object.Behavior::PropertyScaleMaxTweenDuration()" + "ScaleMaxTweenDuration" ] } ], @@ -12579,7 +12606,7 @@ "Object", "Behavior", "=", - "Tween3D::EaseExp(Object.Behavior::PropertyScaleMaxTweenEasing(), Object.Behavior::PropertyScaleMaxTweenInitialValue(), Object.Behavior::PropertyScaleMaxTweenTarget(), Object.Behavior::PropertyScaleMaxTweenTime() / Object.Behavior::PropertyScaleMaxTweenDuration())" + "Tween3D::EaseExp(ScaleMaxTweenEasing, ScaleMaxTweenInitialValue, ScaleMaxTweenTarget, ScaleMaxTweenTime / ScaleMaxTweenDuration)" ] } ], @@ -12595,7 +12622,7 @@ "Object", "Behavior", ">=", - "Object.Behavior::PropertyScaleMaxTweenDuration()" + "ScaleMaxTweenDuration" ] } ], @@ -12608,7 +12635,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyScaleMinTweenTarget()" + "ScaleMinTweenTarget" ] } ] @@ -12665,7 +12692,7 @@ "Object", "Behavior", "+", - "mod(Object.Behavior::TimeDelta() * 2 * Pi()\n / Object.Behavior::PropertyPeriodDuration(), 2 * Pi())" + "mod(Object.Behavior::TimeDelta() * 2 * Pi()\n / PeriodDuration, 2 * Pi())" ] } ] @@ -12706,7 +12733,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyScaleMin()" + "ScaleMin" ] } ] @@ -12749,7 +12776,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -12787,7 +12814,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyScaleMax()" + "ScaleMax" ] } ] @@ -12830,7 +12857,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -12893,7 +12920,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"TargetedValue\")" + "TargetedValue" ] }, { @@ -12904,7 +12931,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -12915,7 +12942,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Easing\")" + "Easing" ] } ] @@ -12994,7 +13021,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"TargetedValue\")" + "TargetedValue" ] }, { @@ -13005,7 +13032,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -13016,7 +13043,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Easing\")" + "Easing" ] } ] @@ -13112,7 +13139,7 @@ "Object", "Tween3D", "=", - "exp(log(Object.Behavior::PropertyScaleMin()) + (log(Object.Behavior::PropertyScaleMax()) - log(Object.Behavior::PropertyScaleMin())) * sin(Object.Behavior::PropertyAngle() + Object.Behavior::PropertyScalePeriodOffset() / Object.Behavior::PropertyPeriodDuration() * 2 * Pi()))", + "exp(log(ScaleMin) + (log(ScaleMax) - log(ScaleMin)) * sin(Angle + ScalePeriodOffset / PeriodDuration * 2 * Pi()))", "Object3D" ] } @@ -13165,7 +13192,7 @@ "Object", "Tween3D", "=", - "exp(log(Object.Behavior::PropertyStretchMin()) + (log(Object.Behavior::PropertyStretchMax()) - log(Object.Behavior::PropertyStretchMin())) * sin(Object.Behavior::PropertyAngle() + Object.Behavior::PropertyStretchPeriodOffset() / Object.Behavior::PropertyPeriodDuration() * 2 * Pi()))", + "exp(log(StretchMin) + (log(StretchMax) - log(StretchMin)) * sin(Angle + StretchPeriodOffset / PeriodDuration * 2 * Pi()))", "Object3D" ] } @@ -13195,7 +13222,7 @@ "Object", "Tween3D", "=", - "exp(log(Object.Behavior::PropertyStretchMin()) + (log(Object.Behavior::PropertyStretchMax()) - log(Object.Behavior::PropertyStretchMin())) * sin(Object.Behavior::PropertyAngle() + Object.Behavior::PropertyStretchPeriodOffset() / Object.Behavior::PropertyPeriodDuration() * 2 * Pi()))", + "exp(log(StretchMin) + (log(StretchMax) - log(StretchMin)) * sin(Angle + StretchPeriodOffset / PeriodDuration * 2 * Pi()))", "Object3D" ] } @@ -13234,7 +13261,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPeriodDuration()" + "PeriodDuration" ] } ] @@ -13277,7 +13304,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -13315,7 +13342,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyScalePeriodOffset()" + "ScalePeriodOffset" ] } ] @@ -13358,7 +13385,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -13396,7 +13423,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyStretchMin()" + "StretchMin" ] } ] @@ -13439,7 +13466,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -13477,7 +13504,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyStretchMax()" + "StretchMax" ] } ] @@ -13520,7 +13547,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -13558,7 +13585,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyStretchPeriodOffset()" + "StretchPeriodOffset" ] } ] @@ -13601,7 +13628,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -17338,7 +17365,7 @@ "name": "CameraShake", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/vector-difference-ab.svg", "shortDescription": "Shake layer cameras.", - "version": "3.1.1", + "version": "3.1.2", "description": [ "Shake layer cameras with translation, rotation and zoom.", "", @@ -18597,7 +18624,7 @@ "parameters": [ "", "", - "GetArgumentAsString(\"Layer\")", + "Layer", "" ] } @@ -18624,7 +18651,7 @@ "parameters": [ "Layer", "=", - "GetArgumentAsString(\"Layer\")" + "Layer" ] }, { @@ -18634,7 +18661,7 @@ "parameters": [ "Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -18654,7 +18681,7 @@ "parameters": [ "StopEaseDuration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -18664,7 +18691,7 @@ "parameters": [ "DefaultAmplitudeX", "=", - "abs(GetArgumentAsNumber(\"AmplitudeX\"))" + "abs(AmplitudeX)" ] }, { @@ -18674,7 +18701,7 @@ "parameters": [ "DefaultAmplitudeY", "=", - "abs(GetArgumentAsNumber(\"AmplitudeY\"))" + "abs(AmplitudeY)" ] }, { @@ -18684,7 +18711,7 @@ "parameters": [ "DefaultAmplitudeAngle", "=", - "GetArgumentAsNumber(\"AmplitudeAngle\")" + "AmplitudeAngle" ] }, { @@ -18694,7 +18721,7 @@ "parameters": [ "DefaultAmplitudeZoom", "=", - "1 + GetArgumentAsNumber(\"AmplitudeZoom\") / 100" + "1 + AmplitudeZoom / 100" ] } ], @@ -18707,7 +18734,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "GetArgumentAsNumber(\"ShakePeriod\")", + "ShakePeriod", "!=", "0" ] @@ -18721,7 +18748,7 @@ "parameters": [ "DefaultFrequency", "=", - "1 / GetArgumentAsNumber(\"ShakePeriod\")" + "1 / ShakePeriod" ] } ] @@ -18734,7 +18761,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "GetArgumentAsNumber(\"ShakePeriod\")", + "ShakePeriod", "=", "0" ] @@ -21043,7 +21070,7 @@ "name": "PanelSpriteSlider", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/UI Essentials/1678c39a3b2bd3df4f82a8a293770db4986a6bcfd3f78e738ddfc86e39176423_UI Essentials_sliders_options.svg", "shortDescription": "A draggable slider that users can move to select a numerical value.", - "version": "1.4.2", + "version": "1.4.4", "description": [ "A draggable slider that users can move to select a numerical value. The slider can be customized with sprites.", "", @@ -21091,7 +21118,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyValue()" + "Value" ] } ] @@ -21146,7 +21173,7 @@ "Object", "Behavior", "=", - "clamp(GetArgumentAsNumber(\"Value\"), Object.Behavior::PropertyMinValue(), Object.Behavior::PropertyMaxValue())" + "clamp(Value, MinValue, MaxValue)" ] } ] @@ -21175,7 +21202,7 @@ "Object", "Behavior", "=", - "clamp(round(GetArgumentAsNumber(\"Value\") / Object.Behavior::PropertyStepSize()) * Object.Behavior::PropertyStepSize(), Object.Behavior::PropertyMinValue(), Object.Behavior::PropertyMaxValue())" + "clamp(round(Value / StepSize) * StepSize, MinValue, MaxValue)" ] } ] @@ -21213,7 +21240,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMinValue()" + "MinValue" ] } ] @@ -21256,7 +21283,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -21306,7 +21333,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxValue()" + "MaxValue" ] } ] @@ -21349,7 +21376,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -21439,7 +21466,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyStepSize()" + "StepSize" ] } ] @@ -21482,7 +21509,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -21740,8 +21767,8 @@ }, "parameters": [ "Object", - "TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)", - "TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)" + "TouchX(TouchId, Object.Layer(), 0)", + "TouchY(TouchId, Object.Layer(), 0)" ] } ], @@ -21811,8 +21838,8 @@ }, "parameters": [ "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)" + "TouchX(StartedTouchOrMouseId(Index), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Index), Object.Layer(), 0)" ] } ], @@ -21825,7 +21852,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { @@ -22098,7 +22125,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -22597,7 +22624,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -23388,66 +23415,83 @@ ] } ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Background", - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Background", - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "PanelSpriteSlider::PanelSpriteSlider::Scale" - }, - "parameters": [ - "Object", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Background.Variable(Width)" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Background.Variable(Height)" - ] - }, + "actions": [], + "events": [ { - "type": { - "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateLayout" - }, - "parameters": [ - "Object", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Width", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Height", + "=", + "Object.Height()" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::Scale" + }, + "parameters": [ + "Object", + "=", + "1" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Background", + "=", + "Width" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Background", + "=", + "Height" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "variables": [ + { + "name": "Width", + "type": "number", + "value": 0 + }, + { + "name": "Height", + "type": "number", + "value": 0 + } ] } ] @@ -23634,7 +23678,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -23721,7 +23765,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -23817,7 +23861,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -23913,7 +23957,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -24893,7 +24937,7 @@ "name": "PanelSpriteButton", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg", "shortDescription": "A button that can be customized.", - "version": "1.4.4", + "version": "1.4.6", "description": [ "The button can be customized with a background for each state and a label. It handles user interactions and a simple condition can be used to check if it is clicked.", "", @@ -25099,8 +25143,8 @@ }, "parameters": [ "Object", - "TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)", - "TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)" + "TouchX(TouchId, Object.Layer(), 0)", + "TouchY(TouchId, Object.Layer(), 0)" ] } ], @@ -25170,8 +25214,8 @@ }, "parameters": [ "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)" + "TouchX(StartedTouchOrMouseId(Index), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Index), Object.Layer(), 0)" ] } ], @@ -25184,7 +25228,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { @@ -25457,7 +25501,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -25996,7 +26040,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -26732,66 +26776,83 @@ ] } ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Idle", - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Idle", - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "PanelSpriteButton::Scale" - }, - "parameters": [ - "Object", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Idle.Variable(Width)" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Idle.Variable(Height)" - ] - }, + "actions": [], + "events": [ { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" - }, - "parameters": [ - "Object", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Width", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Height", + "=", + "Object.Height()" + ] + }, + { + "type": { + "value": "PanelSpriteButton::Scale" + }, + "parameters": [ + "Object", + "=", + "1" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Background", + "=", + "Width" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Background", + "=", + "Height" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "variables": [ + { + "name": "Width", + "type": "number", + "value": 0 + }, + { + "name": "Height", + "type": "number", + "value": 0 + } ] } ] @@ -27058,7 +27119,7 @@ "parameters": [ "Label", "=", - "GetArgumentAsString(\"LabelText\")" + "LabelText" ] }, { @@ -27628,7 +27689,7 @@ "name": "Health", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/heart-half-full.svg", "shortDescription": "Manage health (life) points, shield and armor.", - "version": "0.3.1", + "version": "0.3.2", "description": [ "Manage health (life) points, shield and armor. ", "", @@ -27701,7 +27762,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyHealth()", + "Health", "" ] } @@ -27792,7 +27853,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", ">", - "Object.Behavior::PropertyHealthRegenDelay()" + "HealthRegenDelay" ] } ], @@ -27805,7 +27866,7 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyHealthRegenRate() * TimeDelta()" + "HealthRegenRate * TimeDelta()" ] } ], @@ -27846,7 +27907,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyMaxHealth()" + "MaxHealth" ] } ] @@ -27959,7 +28020,7 @@ "Object", "Behavior", "<", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] }, { @@ -27970,7 +28031,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", ">", - "Object.Behavior::PropertyShieldRegenDelay()" + "ShieldRegenDelay" ] } ], @@ -28016,7 +28077,7 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyShieldRegenRate() * TimeDelta()" + "ShieldRegenRate * TimeDelta()" ] } ] @@ -28044,7 +28105,7 @@ "Object", "Behavior", ">", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ], @@ -28057,7 +28118,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ] @@ -28214,7 +28275,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"DamageValue\")" + "DamageValue" ] } ], @@ -28250,7 +28311,7 @@ "parameters": [ "RandomFloatInRange(0,1)", "<", - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ], @@ -28336,7 +28397,7 @@ "Object", "Behavior", "=", - "max(0,Object.Behavior::PropertyDamageToBeApplied() - Object.Behavior::PropertyFlatDamageReduction())" + "max(0,DamageToBeApplied - FlatDamageReduction)" ] } ] @@ -28388,7 +28449,7 @@ "Object", "Behavior", "*", - "1 - min(1, Object.Behavior::PropertyPercentDamageReduction())" + "1 - min(1, PercentDamageReduction)" ] } ] @@ -28501,7 +28562,7 @@ "Object", "Behavior", "<=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -28514,7 +28575,7 @@ "Object", "Behavior", "-", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { @@ -28525,7 +28586,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { @@ -28564,7 +28625,7 @@ "Object", "Behavior", ">", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -28577,7 +28638,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -28655,7 +28716,7 @@ "Object", "Behavior", "-", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] }, { @@ -28737,7 +28798,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyCurrentHealth() - Object.Behavior::PropertyDamageToBeApplied()", + "CurrentHealth - DamageToBeApplied", "" ] } @@ -28805,7 +28866,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCurrentHealth()" + "CurrentHealth" ] } ] @@ -28849,7 +28910,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28890,7 +28951,7 @@ "Object", "Behavior", "=", - "min(Object.Behavior::PropertyCurrentHealth(), Object.Behavior::PropertyMaxHealth())" + "min(CurrentHealth, MaxHealth)" ] } ] @@ -28936,7 +28997,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -29016,7 +29077,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"HealValue\")" + "HealValue" ] } ] @@ -29067,7 +29128,7 @@ "Object", "Behavior", "=", - "min(GetArgumentAsNumber(\"HealValue\"),Object.Behavior::PropertyMaxHealth() - Object.Behavior::PropertyCurrentHealth())" + "min(HealValue,MaxHealth - CurrentHealth)" ] } ] @@ -29096,7 +29157,7 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyHealToBeApplied()" + "HealToBeApplied" ] } ] @@ -29170,7 +29231,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxHealth()" + "MaxHealth" ] } ] @@ -29213,7 +29274,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29301,7 +29362,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -29345,7 +29406,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenRate()" + "HealthRegenRate" ] } ] @@ -29388,7 +29449,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29435,7 +29496,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -29479,7 +29540,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDamageCooldown()" + "DamageCooldown" ] } ] @@ -29522,7 +29583,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29569,7 +29630,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -29613,7 +29674,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenDelay()" + "HealthRegenDelay" ] } ] @@ -29656,7 +29717,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29703,7 +29764,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -29747,7 +29808,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ] @@ -29790,7 +29851,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29837,7 +29898,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -29881,7 +29942,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFlatDamageReduction()" + "FlatDamageReduction" ] } ] @@ -29924,7 +29985,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29971,7 +30032,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -30015,7 +30076,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPercentDamageReduction()" + "PercentDamageReduction" ] } ] @@ -30058,7 +30119,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -30105,7 +30166,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -30676,7 +30737,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", "<", - "Object.Behavior::PropertyDamageCooldown()" + "DamageCooldown" ] } ], @@ -30749,7 +30810,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::PropertyDamageCooldown() - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" + "max(0,DamageCooldown - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" ] } ] @@ -30895,7 +30956,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] } ] @@ -30936,7 +30997,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ] @@ -30979,7 +31040,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -31026,7 +31087,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -31074,7 +31135,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -31118,7 +31179,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ] @@ -31161,7 +31222,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -31208,7 +31269,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -31252,7 +31313,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenRate()" + "ShieldRegenRate" ] } ] @@ -31295,7 +31356,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -31342,7 +31403,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -31386,7 +31447,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenDelay()" + "ShieldRegenDelay" ] } ] @@ -31429,7 +31490,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -31476,7 +31537,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -31520,7 +31581,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDuration()" + "ShieldDuration" ] } ] @@ -31563,7 +31624,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -31610,7 +31671,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -31696,7 +31757,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"ShieldPoints\")" + "ShieldPoints" ] } ] @@ -31725,7 +31786,7 @@ "Object", "Behavior", "=", - "min(GetArgumentAsNumber(\"ShieldPoints\"),Object.Behavior::MaxShield())" + "min(ShieldPoints,Object.Behavior::MaxShield())" ] } ] @@ -32088,7 +32149,7 @@ "Object", "\"__Health.ShieldDuration\"", "<", - "Object.Behavior::PropertyShieldDuration()" + "ShieldDuration" ] } ], @@ -32164,7 +32225,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::PropertyShieldDuration() - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" + "max(0,ShieldDuration - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" ] } ] @@ -32205,7 +32266,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDamageTaken()" + "ShieldDamageTaken" ] } ] @@ -32246,7 +32307,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealToBeApplied()" + "HealToBeApplied" ] } ] @@ -32529,7 +32590,7 @@ "name": "PanelSpriteContinuousBar", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Interface Elements/ea06363a57846caab544f536b78a952234b68d4941d41c1577852a1d61aefec3_Interface Elements_interface_ui_loading_progress_bar.svg", "shortDescription": "A bar that represents a resource in the game (health, mana, ammo, etc).", - "version": "1.1.1", + "version": "1.1.3", "description": [ "A bar that represents a resource in the game (health, mana, ammo, etc).", "", @@ -32596,7 +32657,7 @@ "Object", "\"__ResourceBar.LastValueChange\"", "<=", - "Object.Behavior::PropertyPreviousHighValueDuration()" + "PreviousHighValueDuration" ] } ], @@ -32645,7 +32706,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyValue()" + "Value" ] } ] @@ -32688,7 +32749,7 @@ "Object", "Behavior", "=", - "clamp(GetArgumentAsNumber(\"Value\"), 0, Object.Behavior::MaxValue())" + "clamp(Value, 0, Object.Behavior::MaxValue())" ] } ] @@ -32731,7 +32792,7 @@ "Object", "Behavior", ">=", - "Object.Behavior::PropertyPreviousHighValue()" + "PreviousHighValue" ] } ], @@ -32781,7 +32842,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxValue()" + "MaxValue" ] } ] @@ -32824,7 +32885,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -32912,7 +32973,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyMaxValue()" + "MaxValue" ] } ], @@ -32959,7 +33020,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPreviousHighValue()" + "PreviousHighValue" ] } ] @@ -33002,7 +33063,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyValue()" + "Value" ] } ] @@ -33040,7 +33101,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPreviousHighValueDuration()" + "PreviousHighValueDuration" ] } ] @@ -33083,7 +33144,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -33122,7 +33183,7 @@ "Object", "Behavior", "!=", - "Object.Behavior::PropertyValue()", + "Value", "" ] }, @@ -33134,7 +33195,7 @@ "Object", "\"__ResourceBar.LastValueChange\"", "<=", - "Object.Behavior::PropertyPreviousHighValueDuration()" + "PreviousHighValueDuration" ] } ], @@ -33698,66 +33759,83 @@ ] } ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Background", - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Background", - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::Scale" - }, - "parameters": [ - "Object", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Background.Variable(Width)" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Background.Variable(Height)" - ] - }, + "actions": [], + "events": [ { - "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLayout" - }, - "parameters": [ - "Object", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Width", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Height", + "=", + "Object.Height()" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::Scale" + }, + "parameters": [ + "Object", + "=", + "1" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Background", + "=", + "Width" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Background", + "=", + "Height" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "variables": [ + { + "name": "Width", + "type": "number", + "value": 0 + }, + { + "name": "Height", + "type": "number", + "value": 0 + } ] } ] @@ -34062,7 +34140,7 @@ "FillBar", "ResourceBar", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -34240,7 +34318,7 @@ "FillBar", "ResourceBar", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -34424,7 +34502,7 @@ "FillBar", "ResourceBar", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -36045,7 +36123,7 @@ "name": "SpriteMultitouchJoystick", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Videogames/Videogames_controller_joystick_arrows_direction.svg", "shortDescription": "Joysticks or buttons for touchscreens.", - "version": "1.3.0", + "version": "1.6.1", "description": [ "Multitouch joysticks can be used the same way as physical gamepads:", "- 4 or 8 directions", @@ -36080,8 +36158,458 @@ ], "dependencies": [], "globalVariables": [], - "sceneVariables": [], + "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": [ + { + "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": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"TargetedSpeed\"", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(0, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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 is pressed on a gamepad.", "fullName": "Multitouch controller button pressed", @@ -36094,10 +36622,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Pressed\"" ] @@ -36142,10 +36670,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Released\"" ] @@ -36192,10 +36720,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Buttons[Button].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "ButtonState" ] @@ -36237,10 +36765,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", "=", "DeadZoneRadius" ] @@ -36285,7 +36813,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone" ] } ] @@ -36325,7 +36853,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 4 / 360), 4)" + "mod(round(Angle * 4 / 360), 4)" ] } ] @@ -36360,7 +36888,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 8 / 360), 8)" + "mod(round(Angle * 8 / 360), 8)" ] } ] @@ -36394,7 +36922,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -36407,7 +36935,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36431,7 +36959,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -36444,7 +36972,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36468,7 +36996,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -36481,7 +37009,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36505,7 +37033,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -36518,7 +37046,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36566,7 +37094,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -36579,7 +37107,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36603,7 +37131,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownRight\"" ] @@ -36616,7 +37144,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36640,7 +37168,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -36653,7 +37181,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36677,7 +37205,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownLeft\"" ] @@ -36690,7 +37218,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36714,7 +37242,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -36727,7 +37255,7 @@ "", "=", "4", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36751,7 +37279,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpLeft\"" ] @@ -36764,7 +37292,7 @@ "", "=", "5", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36788,7 +37316,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -36801,7 +37329,7 @@ "", "=", "6", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36825,7 +37353,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpRight\"" ] @@ -36838,7 +37366,7 @@ "", "=", "7", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -37067,6 +37595,11 @@ "name": "JoystickIdentifier", "supplementaryInformation": "[\"Primary\",\"Secondary\"]", "type": "stringWithSelector" + }, + { + "description": "", + "name": "Coucou", + "type": "expression" } ], "objectGroups": [] @@ -37087,7 +37620,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0, Variable(__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force) - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier)) / (1 - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier))" + "max(0, Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier)) / (1 - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -37125,10 +37658,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", "=", "Value" ] @@ -37172,7 +37705,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -37212,7 +37745,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle" ] } ] @@ -37250,12 +37783,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -37296,7 +37829,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::JoystickForce(ControllerIdentifier, JoystickIdentifier) * cos(ToRad(SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)))" + "XFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -37336,7 +37869,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::JoystickForce(ControllerIdentifier, JoystickIdentifier) * sin(ToRad(SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)))" + "YFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -37359,352 +37892,138 @@ } ], "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ + }, { - "description": "Joystick that can be controlled by interacting with a touchscreen.", - "fullName": "Multitouch Joystick", - "name": "MultitouchJoystick", - "objectType": "", - "private": true, - "eventsFunctions": [ + "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": [ { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::SetDeadZone" + "value": "CompareArgumentAsString" }, "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyDeadZoneRadius()", - "" + "\"Side\"", + "=", + "\"Left\"" ] }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + "value": "TouchX" }, "parameters": [ - "Object", - "Behavior", + "", + "StartedTouchOrMouseId(0)", + "<", + "CameraCenterX(Object.Layer())", + "Object.Layer()", "" ] } - ] - } - ], - "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" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "Behavior", - "" + "True" ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "HasGameJustResumed" + "value": "CompareArgumentAsString" }, "parameters": [ - "" + "\"Side\"", + "=", + "\"Right\"" ] - } - ], - "actions": [ + }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + "value": "TouchX" }, "parameters": [ - "Object", - "Behavior", + "", + "StartedTouchOrMouseId(0)", + ">=", + "CameraCenterX(Object.Layer())", + "Object.Layer()", "" ] } - ] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Manage touches", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HasAnyTouchOrMouseStarted" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "StartedTouchOrMouseCount()", - "conditions": [], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - }, - { - "type": { - "value": "CollisionPoint" - }, - "parameters": [ - "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "1" - ] - } - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Move thumb back to center when not being pressed (acts like a spring on a real controller)" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HasTouchEnded" - }, - "parameters": [ - "", - "Object.Behavior::PropertyTouchId()" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Update joystick position", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" - }, - "parameters": [ - "Object", - "Behavior", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickAngle" - }, - "parameters": [ - "Object", - "Behavior", - "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))", - "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickForce" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "clamp(2 * DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)) / Object.Width(), 0, 1)", - "" - ] - } + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" ] } - ], - "parameters": [] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" + ] } - ], - "objectGroups": [] + ] + } + ], + "parameters": [ + { + "description": "Multitouch joystick", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "objectList" }, { - "description": "the joystick force (from 0 to 1).", - "fullName": "Joystick force", - "functionType": "ExpressionAndCondition", - "name": "JoystickForce", - "sentence": "the joystick force", + "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", @@ -37712,18 +38031,29 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::SetDeadZone" }, "parameters": [ - "max(0, JoystickForce - DeadZoneRadius) / (1 - DeadZoneRadius)" + "", + "ControllerIdentifier", + "JoystickIdentifier", + "DeadZoneRadius", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -37741,10 +38071,8 @@ }, { "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "JoystickForce", - "name": "SetJoystickForce", - "private": true, + "functionType": "Action", + "name": "onDeActivate", "sentence": "", "events": [ { @@ -37753,24 +38081,11 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickForce" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" }, "parameters": [ "Object", "Behavior", - "=", - "Value" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SetJoystickForce" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "JoystickForce", "" ] } @@ -37792,6 +38107,346 @@ ], "objectGroups": [] }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasGameJustResumed" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Manage touches", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StartedTouchOrMouseCount()", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StartedTouchOrMouseId(TouchIndex)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Move thumb back to center when not being pressed (acts like a spring on a real controller)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasTouchEnded" + }, + "parameters": [ + "", + "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": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "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": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SetJoystickForce" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickForce", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, + { + "description": "", + "name": "Parameter", + "type": "objectList" + } + ], + "objectGroups": [] + }, { "description": "Return the angle the joystick is pointing towards (Range: -180 to 180).", "fullName": "Joystick angle", @@ -37852,7 +38507,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -37861,9 +38516,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickAngle()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickAngle", "" ] } @@ -38223,7 +38878,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyControllerIdentifier()" + "ControllerIdentifier" ] } ] @@ -38266,7 +38921,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -38304,7 +38959,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyJoystickIdentifier()" + "JoystickIdentifier" ] } ] @@ -38347,7 +39002,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -38430,6 +39085,58 @@ "=", "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": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] } ] } @@ -38445,6 +39152,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "Touch identifier", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -38619,12 +39331,31 @@ "conditions": [ { "type": { - "value": "CollisionPoint" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)" + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer())", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer())" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyRadius" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer()), TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer()))" + ] + } ] } ], @@ -38637,7 +39368,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] }, { @@ -38693,7 +39424,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -38721,18 +39452,1206 @@ }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if button is released.", + "fullName": "Button released", + "functionType": "Condition", + "name": "IsReleased", + "sentence": "Button _PARAM0_ is released", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyIsReleased" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if button is pressed.", + "fullName": "Button pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Button _PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Button state", + "functionType": "Action", + "name": "SetButtonState", + "private": true, + "sentence": "Mark the button _PARAM0_ as _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SetButtonState" + }, + "parameters": [ + "", + "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\",\"Pressed\",\"Released\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Button identifier", + "description": "", + "group": "", + "extraInformation": [], + "name": "ButtonIdentifier" + }, + { + "value": "0", + "type": "Number", + "label": "TouchID", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchId" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchIndex" + }, + { + "value": "", + "type": "Boolean", + "label": "Button released", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsReleased" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Triggering circle radius", + "description": "This circle adds up to the object collision mask.", + "group": "", + "extraInformation": [], + "name": "Radius" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a platformer character with a multitouch controller.", + "fullName": "Platformer multitouch controller mapper", + "name": "PlatformerMultitouchMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "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", + "description": "", + "group": "", + "extraInformation": [ + "PlatformBehavior::PlatformerObjectBehavior" + ], + "name": "Property" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D platformer multitouch controller mapper", + "name": "Platformer3DMultitouchMapper", + "objectType": "", + "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", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D shooter multitouch controller mapper", + "name": "Shooter3DMultitouchMapper", + "objectType": "", + "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", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control camera rotations with a multitouch controller.", + "fullName": "First person camera multitouch controller mapper", + "name": "FirstPersonMultitouchMapper", + "objectType": "", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyCurrentRotationSpeedZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedZ, SpriteMultitouchJoystick::StickForceX(ControllerIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "CurrentRotationSpeedZ * TimeDelta()" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyCurrentRotationSpeedY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationAcceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationDeceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": [ - "Object", - "Behavior", - "=", - "0" + "VerticalRotationSpeedMax" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -38742,44 +40661,78 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if button is released.", - "fullName": "Button released", - "functionType": "Condition", - "name": "IsReleased", - "sentence": "Button _PARAM0_ is released", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationSpeedMax", + "name": "SetVerticalRotationSpeedMax", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyIsReleased" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationSpeedMax" }, "parameters": [ "Object", - "Behavior" + "Behavior", + "=", + "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": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "VerticalRotationAcceleration" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -38789,41 +40742,32 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if button is pressed.", - "fullName": "Button pressed", - "functionType": "Condition", - "name": "IsPressed", - "sentence": "Button _PARAM0_ is pressed", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationAcceleration", + "name": "SetVerticalRotationAcceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyTouchId" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationAcceleration" }, "parameters": [ "Object", "Behavior", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "=", + "Value" ] } ] @@ -38838,18 +40782,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "Button state", - "functionType": "Action", - "name": "SetButtonState", - "private": true, - "sentence": "Mark the button _PARAM0_ as _PARAM2_", + "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", @@ -38857,19 +40802,18 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::SetButtonState" + "value": "SetReturnNumber" }, "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyButtonIdentifier()", - "GetArgumentAsString(\"ButtonState\")", - "" + "VerticalRotationDeceleration" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -38879,227 +40823,275 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" - }, - { - "description": "Button state", - "name": "ButtonState", - "supplementaryInformation": "[\"Idle\",\"Pressed\",\"Released\"]", - "type": "stringWithSelector" } ], "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "1", - "type": "Number", - "label": "Multitouch controller identifier (1, 2, 3, 4...)", - "description": "", - "group": "", - "extraInformation": [], - "name": "ControllerIdentifier" - }, - { - "value": "A", - "type": "String", - "label": "Button identifier", - "description": "", - "group": "", - "extraInformation": [], - "name": "ButtonIdentifier" - }, - { - "value": "0", - "type": "Number", - "label": "TouchID", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "TouchId" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "TouchIndex" }, - { - "value": "", - "type": "Boolean", - "label": "Button released", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "IsReleased" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Control a platformer character with a multitouch controller.", - "fullName": "Platformer multitouch controller mapper", - "name": "PlatformerMultitouchMapper", - "objectType": "", - "eventsFunctions": [ { "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationDeceleration", + "name": "SetVerticalRotationDeceleration", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Left\"", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "PlatformBehavior::SimulateLeftKey" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationDeceleration" }, "parameters": [ "Object", - "Property" + "Behavior", + "=", + "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": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Right\"", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "PlatformBehavior::SimulateRightKey" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Property" + "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": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Up\"", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "PlatformBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "Property" - ] - }, - { - "type": { - "value": "PlatformBehavior::SimulateLadderKey" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMin" }, "parameters": [ "Object", - "Property" + "Behavior", + "=", + "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": [ + "conditions": [], + "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + "value": "SetReturnNumber" }, "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Down\"", - "" + "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": "PlatformBehavior::SimulateDownKey" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMax" }, "parameters": [ "Object", - "Property" + "Behavior", + "=", + "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": [ + "conditions": [], + "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::IsButtonPressed" + "value": "SetReturnNumber" }, "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJumpButton()", - "\"Down\"" + "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": "PlatformBehavior::SimulateJumpKey" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyOffsetZ" }, "parameters": [ "Object", - "Property" + "Behavior", + "=", + "Value" ] } ] @@ -39114,7 +41106,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::PlatformerMultitouchMapper", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], @@ -39125,13 +41117,13 @@ { "value": "", "type": "Behavior", - "label": "Platform character behavior", + "label": "3D capability", "description": "", "group": "", "extraInformation": [ - "PlatformBehavior::PlatformerObjectBehavior" + "Scene3D::Base3DBehavior" ], - "name": "Property" + "name": "Object3D" }, { "value": "1", @@ -39143,25 +41135,124 @@ "name": "ControllerIdentifier" }, { - "value": "Primary", + "value": "Secondary", "type": "Choice", - "label": "Joystick name", + "label": "Camera joystick", "description": "", "group": "Controls", "extraInformation": [ "Primary", "Secondary" ], - "name": "JoystickIdentifier" + "name": "CameraStick" }, { - "value": "A", - "type": "String", - "label": "Jump button name", + "value": "180", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", "description": "", - "group": "Controls", + "group": "Horizontal rotation", "extraInformation": [], - "name": "JumpButton" + "name": "HorizontalRotationSpeedMax" + }, + { + "value": "360", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationAcceleration" + }, + { + "value": "720", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationDeceleration" + }, + { + "value": "120", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationSpeedMax" + }, + { + "value": "240", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationAcceleration" + }, + { + "value": "480", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationDeceleration" + }, + { + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Minimum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMin" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Maximum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z position offset", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Z", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Y", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedY" } ], "sharedPropertyDescriptors": [] @@ -39201,8 +41292,8 @@ "parameters": [ "Object", "TopDownMovement", - "SpriteMultitouchJoystick::StickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", - "SpriteMultitouchJoystick::StickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())" + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -39230,8 +41321,8 @@ "parameters": [ "Object", "TopDownMovement", - "SpriteMultitouchJoystick::StickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", - "sign(SpriteMultitouchJoystick::StickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier()))" + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "sign(SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -39278,8 +41369,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -39306,8 +41397,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -39334,8 +41425,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -39362,8 +41453,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -39407,8 +41498,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -39435,8 +41526,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -39463,8 +41554,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -39491,8 +41582,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -39519,8 +41610,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"UpLeft\"", "" ] @@ -39556,8 +41647,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"UpRight\"", "" ] @@ -39593,8 +41684,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"DownLeft\"", "" ] @@ -39630,8 +41721,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"DownRight\"", "" ] @@ -39874,6 +41965,49 @@ ] } ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::PropertyShouldBeHiddenWhenReleased" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Object", + "no", + "" + ] + } + ] } ], "parameters": [ @@ -39938,7 +42072,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyControllerIdentifier()", + "ControllerIdentifier", "" ] }, @@ -39950,7 +42084,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyJoystickIdentifier()", + "JoystickIdentifier", "" ] }, @@ -39962,7 +42096,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyDeadZoneRadius()", + "DeadZoneRadius", "" ] } @@ -39979,6 +42113,176 @@ ], "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": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::SetPropertyShouldBeHiddenWhenReleased" + }, + "parameters": [ + "Object", + "yes" + ] + }, + { + "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", @@ -40463,7 +42767,7 @@ "Border", "MultitouchJoystick", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -40535,7 +42839,7 @@ "Border", "MultitouchJoystick", "=", - "GetArgumentAsString(\"Value\")", + "Value", "" ] } @@ -40607,7 +42911,7 @@ "Border", "MultitouchJoystick", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -40699,6 +43003,16 @@ "extraInformation": [], "hidden": true, "name": "ParentOrigin" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShouldBeHiddenWhenReleased" } ], "objects": [ @@ -40818,7 +43132,7 @@ "name": "ParticleEmitter3D", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/f2e5a34bf465f781866677762d385d6c8e9e8d203383f2df9a3b7e0fad6a2cb5_fire.svg", "shortDescription": "Display a large number of particles to create visual effects.", - "version": "2.0.2", + "version": "2.0.5", "description": [ "Particle emitters can be used to display:", "- Fire", @@ -41103,6 +43417,9 @@ " * 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();", @@ -45721,27 +48038,34 @@ " });", " this.geometry.instanceCount = index;", " if (index > 0) {", - " this.offsetBuffer.updateRange.count = index * 3;", + " this.offsetBuffer.clearUpdateRanges();", + " this.offsetBuffer.addUpdateRange(0, index * 3);", " this.offsetBuffer.needsUpdate = true;", - " this.sizeBuffer.updateRange.count = index;", + " this.sizeBuffer.clearUpdateRanges();", + " this.sizeBuffer.addUpdateRange(0, index);", " this.sizeBuffer.needsUpdate = true;", - " this.colorBuffer.updateRange.count = index * 4;", + " this.colorBuffer.clearUpdateRanges();", + " this.colorBuffer.addUpdateRange(0, index * 4);", " this.colorBuffer.needsUpdate = true;", - " this.uvTileBuffer.updateRange.count = index;", + " this.uvTileBuffer.clearUpdateRanges();", + " this.uvTileBuffer.addUpdateRange(0, index);", " this.uvTileBuffer.needsUpdate = true;", " if (this.settings.renderMode === RenderMode.StretchedBillBoard && this.velocityBuffer) {", - " this.velocityBuffer.updateRange.count = index * 4;", + " this.velocityBuffer.clearUpdateRanges();", + " this.velocityBuffer.addUpdateRange(0, index * 4);", " this.velocityBuffer.needsUpdate = true;", " }", " if (this.settings.renderMode === RenderMode.Mesh) {", - " this.rotationBuffer.updateRange.count = index * 4;", + " 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.updateRange.count = index;", + " this.rotationBuffer.clearUpdateRanges();", + " this.rotationBuffer.addUpdateRange(0, index);", " this.rotationBuffer.needsUpdate = true;", " }", " }", @@ -46084,21 +48408,29 @@ " }", " }", " });", - " this.positionBuffer.updateRange.count = index * 3;", + " this.positionBuffer.clearUpdateRanges();", + " this.positionBuffer.addUpdateRange(0, index * 3);", " this.positionBuffer.needsUpdate = true;", - " this.previousBuffer.updateRange.count = index * 3;", + " this.previousBuffer.clearUpdateRanges();", + " this.previousBuffer.addUpdateRange(0, index * 3);", " this.previousBuffer.needsUpdate = true;", - " this.nextBuffer.updateRange.count = index * 3;", + " this.nextBuffer.clearUpdateRanges();", + " this.nextBuffer.addUpdateRange(0, index * 3);", " this.nextBuffer.needsUpdate = true;", - " this.sideBuffer.updateRange.count = index;", + " this.sideBuffer.clearUpdateRanges();", + " this.sideBuffer.addUpdateRange(0, index);", " this.sideBuffer.needsUpdate = true;", - " this.widthBuffer.updateRange.count = index;", + " this.widthBuffer.clearUpdateRanges();", + " this.widthBuffer.addUpdateRange(0, index);", " this.widthBuffer.needsUpdate = true;", - " this.uvBuffer.updateRange.count = index * 2;", + " this.uvBuffer.clearUpdateRanges();", + " this.uvBuffer.addUpdateRange(0, index * 2);", " this.uvBuffer.needsUpdate = true;", - " this.colorBuffer.updateRange.count = index * 4;", + " this.colorBuffer.clearUpdateRanges();", + " this.colorBuffer.addUpdateRange(0, index * 4);", " this.colorBuffer.needsUpdate = true;", - " this.indexBuffer.updateRange.count = triangles * 3;", + " this.indexBuffer.clearUpdateRanges();", + " this.indexBuffer.addUpdateRange(0, triangles * 3);", " this.indexBuffer.needsUpdate = true;", " this.geometry.setDrawRange(0, triangles * 3);", " }", @@ -48456,7 +50788,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -48528,7 +50860,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -48611,7 +50943,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -48692,7 +51024,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -48774,7 +51106,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -48856,7 +51188,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -48938,7 +51270,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49020,7 +51352,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49103,7 +51435,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49185,7 +51517,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49268,7 +51600,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49351,7 +51683,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49433,7 +51765,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49515,7 +51847,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49598,7 +51930,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49681,7 +52013,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49894,7 +52226,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49979,7 +52311,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -50063,7 +52395,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -50146,7 +52478,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -50608,7 +52940,7 @@ "name": "SmoothCamera", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Computers and Hardware/Computers and Hardware_camcoder_gopro_go_pro_camera.svg", "shortDescription": "Smoothly scroll to follow an object.", - "version": "0.3.1", + "version": "0.3.3", "description": [ "The camera follows an object according to:", "- a frame rate independent catch-up speed to make the scrolling from smooth to strong", @@ -50675,7 +53007,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyLeftwardSpeed()", + "LeftwardSpeed", "log(1 - )" ] }, @@ -50686,7 +53018,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyRightwardSpeed()", + "RightwardSpeed", "log(1 - )" ] }, @@ -50697,7 +53029,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyUpwardSpeed()", + "UpwardSpeed", "log(1 - )" ] }, @@ -50708,7 +53040,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyDownwardSpeed()", + "DownwardSpeed", "log(1 - )" ] }, @@ -50719,7 +53051,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyLeftwardSpeedMax()", + "LeftwardSpeedMax", "log(1 - )" ] }, @@ -50730,7 +53062,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyRightwardSpeedMax()", + "RightwardSpeedMax", "log(1 - )" ] }, @@ -50741,7 +53073,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyUpwardSpeedMax()", + "UpwardSpeedMax", "log(1 - )" ] }, @@ -50752,7 +53084,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyDownwardSpeedMax()", + "DownwardSpeedMax", "log(1 - )" ] }, @@ -50763,7 +53095,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaLeft()", + "FollowFreeAreaLeft", "log(1 - )" ] }, @@ -50774,7 +53106,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaRight()", + "FollowFreeAreaRight", "log(1 - )" ] }, @@ -50785,7 +53117,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaTop()", + "FollowFreeAreaTop", "log(1 - )" ] }, @@ -50796,7 +53128,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaBottom()", + "FollowFreeAreaBottom", "log(1 - )" ] }, @@ -50808,7 +53140,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyCameraDelay()" + "CameraDelay" ] } ] @@ -51048,7 +53380,7 @@ "parameters": [ "", "=", - "Object.Behavior::FreeAreaRight()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaRight())\n* exp(TimeDelta() * Object.Behavior::PropertyLogLeftwardSpeed())", + "Object.Behavior::FreeAreaRight()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaRight())\n* exp(TimeDelta() * LogLeftwardSpeed)", "Object.Layer()", "0" ] @@ -51065,7 +53397,7 @@ "parameters": [ "", "<", - "Object.Behavior::PropertyOldX() - Object.Behavior::PropertyLeftwardSpeedMax() * TimeDelta()", + "OldX - LeftwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51079,7 +53411,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldX() - Object.Behavior::PropertyLeftwardSpeedMax() * TimeDelta()", + "OldX - LeftwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51112,7 +53444,7 @@ "parameters": [ "", "=", - "Object.Behavior::FreeAreaLeft()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaLeft())\n* exp(TimeDelta() * Object.Behavior::PropertyLogRightwardSpeed())", + "Object.Behavior::FreeAreaLeft()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaLeft())\n* exp(TimeDelta() * LogRightwardSpeed)", "Object.Layer()", "0" ] @@ -51129,7 +53461,7 @@ "parameters": [ "", ">", - "Object.Behavior::PropertyOldX() + Object.Behavior::PropertyRightwardSpeedMax() * TimeDelta()", + "OldX + RightwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51143,7 +53475,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldX() + Object.Behavior::PropertyRightwardSpeedMax() * TimeDelta()", + "OldX + RightwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51205,7 +53537,7 @@ "parameters": [ "", "=", - "Object.Behavior::FreeAreaBottom()\n+ (CameraY(Object.Layer(), 0) - Object.Behavior::FreeAreaBottom())\n* exp(TimeDelta() * Object.Behavior::PropertyLogUpwardSpeed())", + "Object.Behavior::FreeAreaBottom()\n+ (CameraY(Object.Layer(), 0) - Object.Behavior::FreeAreaBottom())\n* exp(TimeDelta() * LogUpwardSpeed)", "Object.Layer()", "0" ] @@ -51222,7 +53554,7 @@ "parameters": [ "", "<", - "Object.Behavior::PropertyOldY() - Object.Behavior::PropertyUpwardSpeedMax() * TimeDelta()", + "OldY - UpwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51236,7 +53568,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldY() - Object.Behavior::PropertyUpwardSpeedMax() * TimeDelta()", + "OldY - UpwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51269,7 +53601,7 @@ "parameters": [ "", "=", - "Object.Behavior::FreeAreaTop()\n+ (CameraY(Object.Layer(), 0) - Object.Behavior::FreeAreaTop())\n* exp(TimeDelta() * Object.Behavior::PropertyLogDownwardSpeed())", + "Object.Behavior::FreeAreaTop()\n+ (CameraY(Object.Layer(), 0) - Object.Behavior::FreeAreaTop())\n* exp(TimeDelta() * LogDownwardSpeed)", "Object.Layer()", "0" ] @@ -51286,7 +53618,7 @@ "parameters": [ "", ">", - "Object.Behavior::PropertyOldY() + Object.Behavior::PropertyDownwardSpeedMax() * TimeDelta()", + "OldY + DownwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51300,7 +53632,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldY() + Object.Behavior::PropertyDownwardSpeedMax() * TimeDelta()", + "OldY + DownwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51358,7 +53690,7 @@ "Object", "Behavior", "=", - "TimeFromStart() + GetArgumentAsNumber(\"WaitingDuration\")" + "TimeFromStart() + NewWaitingDuration" ] }, { @@ -51369,7 +53701,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"WaitingSpeedXMax\")" + "NewWaitingSpeedXMax" ] }, { @@ -51380,7 +53712,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"WaitingSpeedYMax\")" + "NewWaitingSpeedYMax" ] }, { @@ -51391,7 +53723,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"CatchUpDuration\")" + "NewCatchUpDuration" ] } ] @@ -51428,22 +53760,22 @@ }, { "description": "Waiting duration (in seconds)", - "name": "WaitingDuration", + "name": "NewWaitingDuration", "type": "expression" }, { "description": "Waiting maximum camera target speed X", - "name": "WaitingSpeedXMax", + "name": "NewWaitingSpeedXMax", "type": "expression" }, { "description": "Waiting maximum camera target speed Y", - "name": "WaitingSpeedYMax", + "name": "NewWaitingSpeedYMax", "type": "expression" }, { "description": "Catch up duration (in seconds)", - "name": "CatchUpDuration", + "name": "NewCatchUpDuration", "type": "expression" } ], @@ -51539,8 +53871,8 @@ }, "parameters": [ "ShapePainter", - "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()])", - "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()])" + "Object.Variable(__SmoothCamera.ForecastHistoryX[Index])", + "Object.Variable(__SmoothCamera.ForecastHistoryY[Index])" ] }, { @@ -51695,10 +54027,10 @@ }, "parameters": [ "ShapePainter", - "Object.Behavior::PropertyProjectedOldestX()", - "Object.Behavior::PropertyProjectedOldestY()", - "Object.Behavior::PropertyProjectedNewestX()", - "Object.Behavior::PropertyProjectedNewestY()", + "ProjectedOldestX", + "ProjectedOldestY", + "ProjectedNewestX", + "ProjectedNewestY", "1" ] } @@ -51726,8 +54058,8 @@ }, "parameters": [ "ShapePainter", - "Object.Behavior::PropertyForecastedX()", - "Object.Behavior::PropertyForecastedY()", + "ForecastedX", + "ForecastedY", "3" ] }, @@ -51816,7 +54148,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"FollowOnX\"" + "\"Value\"" ] } ], @@ -51848,7 +54180,7 @@ }, { "description": "Follow on X axis", - "name": "FollowOnX", + "name": "Value", "type": "yesorno" } ], @@ -51886,7 +54218,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"FollowOnY\"" + "\"Value\"" ] } ], @@ -51918,7 +54250,7 @@ }, { "description": "Follow on Y axis", - "name": "FollowOnY", + "name": "Value", "type": "yesorno" } ], @@ -51944,7 +54276,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaRight\"))" + "max(0, Value)" ] } ] @@ -51964,7 +54296,7 @@ }, { "description": "Follow free area right border", - "name": "SetFollowFreeAreaRight", + "name": "Value", "type": "expression" } ], @@ -51990,7 +54322,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaLeft\"))" + "max(0, Value)" ] } ] @@ -52010,7 +54342,7 @@ }, { "description": "Follow free area left border", - "name": "SetFollowFreeAreaLeft", + "name": "Value", "type": "expression" } ], @@ -52036,7 +54368,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"FollowFreeAreaTop\"))" + "max(0, Value)" ] } ] @@ -52056,7 +54388,7 @@ }, { "description": "Follow free area top border", - "name": "FollowFreeAreaTop", + "name": "Value", "type": "expression" } ], @@ -52082,7 +54414,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaBottom\"))" + "max(0, Value)" ] } ] @@ -52102,7 +54434,7 @@ }, { "description": "Follow free area bottom border", - "name": "SetFollowFreeAreaBottom", + "name": "Value", "type": "expression" } ], @@ -52128,7 +54460,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -52148,7 +54480,7 @@ }, { "description": "Leftward maximum speed (in ratio per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -52174,7 +54506,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -52194,7 +54526,7 @@ }, { "description": "Rightward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -52220,7 +54552,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -52240,7 +54572,7 @@ }, { "description": "Upward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -52266,7 +54598,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -52286,7 +54618,7 @@ }, { "description": "Downward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -52312,7 +54644,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"LeftwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -52323,7 +54655,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyLeftwardSpeed())" + "log(1 - Value)" ] } ] @@ -52343,7 +54675,7 @@ }, { "description": "Leftward catch-up speed (in ratio per second)", - "name": "LeftwardSpeed", + "name": "Value", "type": "expression" } ], @@ -52369,7 +54701,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"RightwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -52380,7 +54712,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyRightwardSpeed())" + "log(1 - Value)" ] } ] @@ -52400,7 +54732,7 @@ }, { "description": "Rightward catch-up speed (in ratio per second)", - "name": "RightwardSpeed", + "name": "Value", "type": "expression" } ], @@ -52426,7 +54758,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"DownwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -52437,7 +54769,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyDownwardSpeed())" + "log(1 - Value)" ] } ] @@ -52457,7 +54789,7 @@ }, { "description": "Downward catch-up speed (in ratio per second)", - "name": "DownwardSpeed", + "name": "Value", "type": "expression" } ], @@ -52483,7 +54815,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"UpwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -52494,7 +54826,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyUpwardSpeed())" + "log(1 - Value)" ] } ] @@ -52514,7 +54846,7 @@ }, { "description": "Upward catch-up speed (in ratio per second)", - "name": "UpwardSpeed", + "name": "Value", "type": "expression" } ], @@ -52537,7 +54869,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCameraOffsetX()" + "CameraOffsetX" ] } ] @@ -52580,7 +54912,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -52634,7 +54966,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"CameraOffsetX\")", + "Value", "" ] } @@ -52655,7 +54987,7 @@ }, { "description": "Camera offset X", - "name": "CameraOffsetX", + "name": "Value", "type": "expression" } ], @@ -52678,7 +55010,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCameraOffsetY()" + "CameraOffsetY" ] } ] @@ -52733,7 +55065,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -52775,7 +55107,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"CameraOffsetY\")", + "CameraOffsetY", "" ] } @@ -52822,7 +55154,7 @@ "Object", "Behavior", "=", - "min(0, GetArgumentAsNumber(\"ForecastTime\"))" + "min(0, Value)" ] } ] @@ -52842,7 +55174,7 @@ }, { "description": "Forecast time", - "name": "ForecastTime", + "name": "Value", "type": "expression" } ], @@ -52868,7 +55200,7 @@ "Object", "Behavior", "=", - "min(0, GetArgumentAsNumber(\"CameraDelay\"))" + "min(0, Value)" ] } ] @@ -52888,7 +55220,7 @@ }, { "description": "Camera delay", - "name": "CameraDelay", + "name": "Value", "type": "expression" } ], @@ -52912,7 +55244,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedX() + Object.Behavior::PropertyCameraOffsetX() - Object.Behavior::PropertyFollowFreeAreaLeft()" + "ForecastedX + CameraOffsetX - FollowFreeAreaLeft" ] } ] @@ -52954,7 +55286,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedX() + Object.Behavior::PropertyCameraOffsetX() + Object.Behavior::PropertyFollowFreeAreaRight()" + "ForecastedX + CameraOffsetX + FollowFreeAreaRight" ] } ] @@ -52996,7 +55328,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedY() + Object.Behavior::PropertyCameraOffsetY() + Object.Behavior::PropertyFollowFreeAreaBottom()" + "ForecastedY + CameraOffsetY + FollowFreeAreaBottom" ] } ] @@ -53038,7 +55370,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedY() + Object.Behavior::PropertyCameraOffsetY() - Object.Behavior::PropertyFollowFreeAreaTop()" + "ForecastedY + CameraOffsetY - FollowFreeAreaTop" ] } ] @@ -53125,7 +55457,7 @@ "parameters": [ "Object", "__SmoothCamera.ObjectX", - "Object.Behavior::PropertyDelayedCenterX()" + "DelayedCenterX" ] }, { @@ -53135,7 +55467,7 @@ "parameters": [ "Object", "__SmoothCamera.ObjectY", - "Object.Behavior::PropertyDelayedCenterY()" + "DelayedCenterY" ] } ] @@ -53463,7 +55795,7 @@ "Object", "Behavior", "+", - "max(0, TimeDelta() * (1 - min(Object.Behavior::PropertyWaitingSpeedXMax() * abs(Object.Variable(__SmoothCamera.ObjectX[1]) - Object.Variable(__SmoothCamera.ObjectX[0])), Object.Behavior::PropertyWaitingSpeedYMax() * abs(Object.Variable(__SmoothCamera.ObjectY[1]) - Object.Variable(__SmoothCamera.ObjectY[0]))) / (Object.Variable(__SmoothCamera.ObjectTime[1]) - Object.Variable(__SmoothCamera.ObjectTime[0]))))" + "max(0, TimeDelta() * (1 - min(WaitingSpeedXMax * abs(Object.Variable(__SmoothCamera.ObjectX[1]) - Object.Variable(__SmoothCamera.ObjectX[0])), WaitingSpeedYMax * abs(Object.Variable(__SmoothCamera.ObjectY[1]) - Object.Variable(__SmoothCamera.ObjectY[0]))) / (Object.Variable(__SmoothCamera.ObjectTime[1]) - Object.Variable(__SmoothCamera.ObjectTime[0]))))" ] } ], @@ -53478,7 +55810,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Extra delay: \" + ToString(Object.Behavior::PropertyCameraExtraDelay())", + "\"Extra delay: \" + ToString(CameraExtraDelay)", "\"info\"", "\"SmoothCamera\"" ] @@ -53617,7 +55949,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyCameraExtraDelay() / Object.Behavior::PropertyCameraDelayCatchUpDuration()" + "CameraExtraDelay / CameraDelayCatchUpDuration" ] } ], @@ -53676,7 +56008,7 @@ "Object", "Behavior", "=", - "max(0, Object.Behavior::PropertyCameraExtraDelay() -Object.Behavior::PropertyCameraDelayCatchUpSpeed() * TimeDelta())" + "max(0, CameraExtraDelay -CameraDelayCatchUpSpeed * TimeDelta())" ] } ], @@ -53691,7 +56023,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Catching up delay: \" + ToString(Object.Behavior::PropertyCameraExtraDelay())", + "\"Catching up delay: \" + ToString(CameraExtraDelay)", "\"info\"", "\"SmoothCamera\"" ] @@ -53782,7 +56114,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCameraDelay() + Object.Behavior::PropertyCameraExtraDelay()" + "CameraDelay + CameraExtraDelay" ] } ] @@ -53907,7 +56239,7 @@ "parameters": [ "Object", "__SmoothCamera.ForecastHistoryTime", - "GetArgumentAsNumber(\"Time\")" + "Time" ] }, { @@ -53917,7 +56249,7 @@ "parameters": [ "Object", "__SmoothCamera.ForecastHistoryX", - "GetArgumentAsNumber(\"ObjectX\")" + "ObjectX" ] }, { @@ -53927,7 +56259,7 @@ "parameters": [ "Object", "__SmoothCamera.ForecastHistoryY", - "GetArgumentAsNumber(\"ObjectY\")" + "ObjectY" ] } ], @@ -53966,7 +56298,7 @@ "Object", "__SmoothCamera.ForecastHistoryTime[0]", "<", - "TimeFromStart() - Object.Behavior::PropertyCameraDelay() - Object.Behavior::PropertyCameraExtraDelay() - Object.Behavior::PropertyForecastHistoryDuration()" + "TimeFromStart() - CameraDelay - CameraExtraDelay - ForecastHistoryDuration" ] } ], @@ -54058,7 +56390,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterX()" + "DelayedCenterX" ] }, { @@ -54069,7 +56401,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterY()" + "DelayedCenterY" ] } ] @@ -54182,7 +56514,7 @@ "Object", "Behavior", "+", - "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()])" + "Object.Variable(__SmoothCamera.ForecastHistoryX[Index])" ] }, { @@ -54268,7 +56600,7 @@ "Object", "Behavior", "+", - "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()])" + "Object.Variable(__SmoothCamera.ForecastHistoryY[Index])" ] }, { @@ -54311,7 +56643,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Mean: \" + ToString(Object.Behavior::PropertyForecastHistoryMeanX()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryMeanY())", + "\"Mean: \" + ToString(ForecastHistoryMeanX) + \" \" + ToString(ForecastHistoryMeanY)", "", "" ] @@ -54405,7 +56737,7 @@ "Object", "Behavior", "+", - "pow(Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanX(), 2)" + "pow(Object.Variable(__SmoothCamera.ForecastHistoryX[Index]) - ForecastHistoryMeanX, 2)" ] }, { @@ -54416,7 +56748,7 @@ "Object", "Behavior", "+", - "pow(Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanY(), 2)" + "pow(Object.Variable(__SmoothCamera.ForecastHistoryY[Index]) - ForecastHistoryMeanY, 2)" ] }, { @@ -54427,7 +56759,7 @@ "Object", "Behavior", "+", - "(Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanX())\n*\n(Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanY())" + "(Object.Variable(__SmoothCamera.ForecastHistoryX[Index]) - ForecastHistoryMeanX)\n*\n(Object.Variable(__SmoothCamera.ForecastHistoryY[Index]) - ForecastHistoryMeanY)" ] }, { @@ -54453,7 +56785,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Variances: \" + ToString(Object.Behavior::PropertyForecastHistoryVarianceX()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryVarianceY()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryCovariance())", + "\"Variances: \" + ToString(ForecastHistoryVarianceX) + \" \" + ToString(ForecastHistoryVarianceY) + \" \" + ToString(ForecastHistoryCovariance)", "\"info\"", "\"SmoothCamera\"" ] @@ -54468,7 +56800,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", "<", "1" ] @@ -54478,7 +56810,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())", + "abs(ForecastHistoryVarianceY)", "<", "1" ] @@ -54493,7 +56825,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterX()" + "DelayedCenterX" ] }, { @@ -54504,7 +56836,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterY()" + "DelayedCenterY" ] } ] @@ -54523,7 +56855,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", ">=", "1" ] @@ -54533,7 +56865,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())", + "abs(ForecastHistoryVarianceY)", ">=", "1" ] @@ -54572,9 +56904,9 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", ">=", - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())" + "abs(ForecastHistoryVarianceY)" ] } ], @@ -54587,7 +56919,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryCovariance() / Object.Behavior::PropertyForecastHistoryVarianceX()" + "ForecastHistoryCovariance / ForecastHistoryVarianceX" ] }, { @@ -54598,7 +56930,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryMeanY() - Object.Behavior::PropertyForecastHistoryLinearA() * Object.Behavior::PropertyForecastHistoryMeanX()" + "ForecastHistoryMeanY - ForecastHistoryLinearA * ForecastHistoryMeanX" ] } ], @@ -54613,7 +56945,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Linear: \" + ToString(Object.Behavior::PropertyForecastHistoryLinearA()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryLinearB())", + "\"Linear: \" + ToString(ForecastHistoryLinearA) + \" \" + ToString(ForecastHistoryLinearB)", "\"info\"", "\"SmoothCamera\"" ] @@ -54674,9 +57006,9 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", "<", - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())" + "abs(ForecastHistoryVarianceY)" ] } ], @@ -54689,7 +57021,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryCovariance() / Object.Behavior::PropertyForecastHistoryVarianceY()" + "ForecastHistoryCovariance / ForecastHistoryVarianceY" ] }, { @@ -54700,7 +57032,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryMeanX() - Object.Behavior::PropertyForecastHistoryLinearA() * Object.Behavior::PropertyForecastHistoryMeanY()" + "ForecastHistoryMeanX - ForecastHistoryLinearA * ForecastHistoryMeanY" ] } ], @@ -54715,7 +57047,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Linear: \" + ToString(Object.Behavior::PropertyForecastHistoryLinearA()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryLinearB())", + "\"Linear: \" + ToString(ForecastHistoryLinearA) + \" \" + ToString(ForecastHistoryLinearB)", "\"info\"", "\"SmoothCamera\"" ] @@ -54775,7 +57107,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedOldestX()" + "ProjectedOldestX" ] }, { @@ -54786,7 +57118,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedOldestY()" + "ProjectedOldestY" ] }, { @@ -54797,7 +57129,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyIndex()" + "Index" ] } ] @@ -54814,7 +57146,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestX()" + "ProjectedNewestX" ] }, { @@ -54825,7 +57157,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestY()" + "ProjectedNewestY" ] }, { @@ -54836,7 +57168,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyIndex()" + "Index" ] } ] @@ -54854,7 +57186,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Oldest: \" + ToString(Object.Behavior::PropertyProjectedOldestX()) + \" \" + ToString(Object.Behavior::PropertyProjectedOldestY())", + "\"Oldest: \" + ToString(ProjectedOldestX) + \" \" + ToString(ProjectedOldestY)", "\"info\"", "\"SmoothCamera\"" ] @@ -54871,7 +57203,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Newest: \" + ToString(Object.Behavior::PropertyProjectedNewestX()) + \" \" + ToString(Object.Behavior::PropertyProjectedNewestY())", + "\"Newest: \" + ToString(ProjectedNewestX) + \" \" + ToString(ProjectedNewestY)", "\"info\"", "\"SmoothCamera\"" ] @@ -54901,7 +57233,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestX() + ( Object.Behavior::PropertyProjectedNewestX() - Object.Behavior::PropertyProjectedOldestX()) * Object.Behavior::ForecastTimeRatio()" + "ProjectedNewestX + ( ProjectedNewestX - ProjectedOldestX) * Object.Behavior::ForecastTimeRatio()" ] }, { @@ -54912,7 +57244,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestY() + ( Object.Behavior::PropertyProjectedNewestY() - Object.Behavior::PropertyProjectedOldestY()) * Object.Behavior::ForecastTimeRatio()" + "ProjectedNewestY + ( ProjectedNewestY - ProjectedOldestY) * Object.Behavior::ForecastTimeRatio()" ] } ] @@ -54927,7 +57259,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Forecasted: \" + ToString(Object.Behavior::PropertyForecastedX()) + \" \" + ToString(Object.Behavior::PropertyForecastedY())", + "\"Forecasted: \" + ToString(ForecastedX) + \" \" + ToString(ForecastedY)", "\"info\"", "\"SmoothCamera\"" ] @@ -54996,7 +57328,7 @@ "Object", "Behavior", "=", - "(GetArgumentAsNumber(\"NewestX\") + (GetArgumentAsNumber(\"NewestY\") - Object.Behavior::PropertyForecastHistoryLinearB()) * Object.Behavior::PropertyForecastHistoryLinearA()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + "(NewestX + (NewestY - ForecastHistoryLinearB) * ForecastHistoryLinearA) / (1 + pow(ForecastHistoryLinearA, 2))" ] }, { @@ -55007,7 +57339,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"NewestY\") + (GetArgumentAsNumber(\"NewestX\") * Object.Behavior::PropertyForecastHistoryLinearA() - GetArgumentAsNumber(\"NewestY\") \n+ Object.Behavior::PropertyForecastHistoryLinearB()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + "NewestY + (NewestX * ForecastHistoryLinearA - NewestY \n+ ForecastHistoryLinearB) / (1 + pow(ForecastHistoryLinearA, 2))" ] } ] @@ -55024,7 +57356,7 @@ "Object", "Behavior", "=", - "(GetArgumentAsNumber(\"OldestX\") + (GetArgumentAsNumber(\"OldestY\") - Object.Behavior::PropertyForecastHistoryLinearB()) * Object.Behavior::PropertyForecastHistoryLinearA()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + "(OldestX + (OldestY - ForecastHistoryLinearB) * ForecastHistoryLinearA) / (1 + pow(ForecastHistoryLinearA, 2))" ] }, { @@ -55035,7 +57367,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"OldestY\") + (GetArgumentAsNumber(\"OldestX\") * Object.Behavior::PropertyForecastHistoryLinearA() - GetArgumentAsNumber(\"OldestY\") \n+ Object.Behavior::PropertyForecastHistoryLinearB()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + "OldestY + (OldestX * ForecastHistoryLinearA - OldestY \n+ ForecastHistoryLinearB) / (1 + pow(ForecastHistoryLinearA, 2))" ] } ] @@ -55094,7 +57426,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "- Object.Behavior::PropertyForecastTime() / (Object.Variable(__SmoothCamera.ForecastHistoryTime[0]) - Object.Variable(__SmoothCamera.ForecastHistoryTime[Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime) - 1]))" + "- ForecastTime / (Object.Variable(__SmoothCamera.ForecastHistoryTime[0]) - Object.Variable(__SmoothCamera.ForecastHistoryTime[Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime) - 1]))" ] } ] @@ -55654,7 +57986,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorFollowFreeAreaTop()", + "FloorFollowFreeAreaTop", "" ] }, @@ -55665,7 +57997,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorFollowFreeAreaBottom()", + "FloorFollowFreeAreaBottom", "" ] }, @@ -55676,7 +58008,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorUpwardSpeed()", + "FloorUpwardSpeed", "" ] }, @@ -55687,7 +58019,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorDownwardSpeed()", + "FloorDownwardSpeed", "" ] }, @@ -55698,7 +58030,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorUpwardSpeedMax()", + "FloorUpwardSpeedMax", "" ] }, @@ -55709,7 +58041,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorDownwardSpeedMax()", + "FloorDownwardSpeedMax", "" ] } @@ -55753,7 +58085,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirFollowFreeAreaTop()", + "AirFollowFreeAreaTop", "" ] }, @@ -55764,7 +58096,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirFollowFreeAreaBottom()", + "AirFollowFreeAreaBottom", "" ] }, @@ -55775,7 +58107,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirUpwardSpeed()", + "AirUpwardSpeed", "" ] }, @@ -55786,7 +58118,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirDownwardSpeed()", + "AirDownwardSpeed", "" ] }, @@ -55797,7 +58129,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirUpwardSpeedMax()", + "AirUpwardSpeedMax", "" ] }, @@ -55808,7 +58140,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirDownwardSpeedMax()", + "AirDownwardSpeedMax", "" ] } @@ -55996,7 +58328,7 @@ "name": "BoidsMovement", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Glyphster Pack/Master/SVG/Restaurant/Restaurant_restaurant_seafood_animal_fish.svg", "shortDescription": "Simulates flocks movement.", - "version": "0.3.0", + "version": "0.3.2", "description": [ "Simulates swarms or flocks movement following the separation, alignment, cohesion principles. The flock can be attracted to a location or avoid some obstacles.", "", @@ -56945,8 +59277,7 @@ "Behavior", "TargetedObject.CenterX()", "TargetedObject.CenterY()", - "DecisionWeight", - "GetArgumentAsNumber(\"DecisionWeight\")" + "DecisionWeight" ] } ] @@ -57368,26 +59699,33 @@ "objectGroups": [] }, { - "description": "Change the maximum speed of the object.", - "fullName": "Maximum speed", - "functionType": "Action", + "description": "Check if the object is rotated while moving on its path.", + "fullName": "Object Rotated", + "functionType": "Condition", "group": "Boids movement configuration", - "name": "SetMaxSpeed", - "sentence": "Change the maximum speed of _PARAM0_ to _PARAM2_", + "name": "ShouldRotate", + "sentence": "_PARAM0_ is rotated when moving", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "BoidsMovement::BoidsMovement::SetPropertyMaxSpeed" + "value": "BoidsMovement::BoidsMovement::PropertyShouldRotate" }, "parameters": [ "Object", - "Behavior", - "=", - "MaxSpeed" + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" ] } ] @@ -57404,22 +59742,17 @@ "name": "Behavior", "supplementaryInformation": "BoidsMovement::BoidsMovement", "type": "behavior" - }, - { - "description": "Max Speed", - "name": "MaxSpeed", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change the maximum acceleration of the object.", - "fullName": "Maximum acceleration", - "functionType": "Action", + "description": "Return the maximum speed.", + "fullName": "Maximum speed", + "functionType": "Expression", "group": "Boids movement configuration", - "name": "SetMaxAcceleration", - "sentence": "Change the maximum acceleration of _PARAM0_ to _PARAM2_", + "name": "MaxSpeed", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -57427,18 +59760,18 @@ "actions": [ { "type": { - "value": "BoidsMovement::BoidsMovement::SetPropertyMaxAcceleration" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "SteeringForce" + "MaxSpeed" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -57450,43 +59783,31 @@ "name": "Behavior", "supplementaryInformation": "BoidsMovement::BoidsMovement", "type": "behavior" - }, - { - "description": "Steering Force", - "name": "SteeringForce", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Check if the object is rotated while moving on its path.", - "fullName": "Object Rotated", - "functionType": "Condition", + "description": "Change the maximum speed of the object.", + "fullName": "Maximum speed", + "functionType": "Action", "group": "Boids movement configuration", - "name": "ShouldRotate", - "sentence": "_PARAM0_ is rotated when moving", + "name": "SetMaxSpeed", + "sentence": "Change the maximum speed of _PARAM0_ to _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BoidsMovement::BoidsMovement::PropertyShouldRotate" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "BoidsMovement::BoidsMovement::SetPropertyMaxSpeed" }, "parameters": [ - "True" + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -57503,16 +59824,21 @@ "name": "Behavior", "supplementaryInformation": "BoidsMovement::BoidsMovement", "type": "behavior" + }, + { + "description": "Max Speed", + "name": "Value", + "type": "expression" } ], "objectGroups": [] }, { - "description": "Return the maximum speed.", - "fullName": "Maximum speed", + "description": "Return the maximum acceleration.", + "fullName": "Maximum acceleration", "functionType": "Expression", "group": "Boids movement configuration", - "name": "MaxSpeed", + "name": "MaxAcceleration", "sentence": "", "events": [ { @@ -57524,7 +59850,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "MaxSpeed" + "MaxAcceleration" ] } ] @@ -57549,12 +59875,12 @@ "objectGroups": [] }, { - "description": "Return the maximum acceleration.", + "description": "Change the maximum acceleration of the object.", "fullName": "Maximum acceleration", - "functionType": "Expression", + "functionType": "Action", "group": "Boids movement configuration", - "name": "MaxAcceleration", - "sentence": "", + "name": "SetMaxAcceleration", + "sentence": "Change the maximum acceleration of _PARAM0_ to _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -57562,18 +59888,18 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "BoidsMovement::BoidsMovement::SetPropertyMaxAcceleration" }, "parameters": [ - "MaxAcceleration" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -57585,6 +59911,11 @@ "name": "Behavior", "supplementaryInformation": "BoidsMovement::BoidsMovement", "type": "behavior" + }, + { + "description": "Steering Force", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -58231,6 +60562,10 @@ "shortDescription": "Smoothly change a counter value in a text object.", "version": "1.0.0", "description": "Smoothly change a counter value in a text object.", + "origin": { + "identifier": "RollingCounter", + "name": "gdevelop-extension-store" + }, "tags": [ "score", "animation", @@ -64535,6 +66870,5 @@ "windowMask": false } } - ], - "externalSourceFiles": [] + ] } \ No newline at end of file diff --git a/examples/3d-shooting-gallery/3d-shooting-gallery.json b/examples/3d-shooting-gallery/3d-shooting-gallery.json index 2ba06efef..d9e4e4789 100644 --- a/examples/3d-shooting-gallery/3d-shooting-gallery.json +++ b/examples/3d-shooting-gallery/3d-shooting-gallery.json @@ -1,7 +1,7 @@ { "firstLayout": "", "gdVersion": { - "build": 220, + "build": 221, "major": 5, "minor": 5, "revision": 0 @@ -16,9 +16,8 @@ "pixelsRounding": false, "projectUuid": "df6e4793-47c9-4ab9-af06-e31eecacbe56", "scaleMode": "linear", - "sizeOnStartupMode": "", + "sizeOnStartupMode": "adaptWidth", "templateSlug": "", - "useExternalSourceFiles": false, "version": "1.0.0", "name": "3D Shooting Gallery Example", "description": "A 3D shooting gallery game example featuring a timer, score system, 3D first person movement on the X and Y planes, pointer lock, and hitscan gun mechanics.", @@ -477,20 +476,32 @@ "userAdded": true }, { - "file": "assets/Shaded dark joystick border.png", + "file": "assets/Line light joystick thumb.png", "kind": "image", "metadata": "", - "name": "Shaded dark joystick border.png", + "name": "assets\\Line light joystick thumb.png", "smoothed": true, "userAdded": false }, { - "file": "assets/Shaded dark joystick thumb.png", + "file": "assets/Line light joystick border.png", "kind": "image", "metadata": "", - "name": "Shaded dark joystick thumb.png", + "name": "assets\\Line light joystick border.png", "smoothed": true, "userAdded": false + }, + { + "file": "assets/rotate-screen-icon.png", + "kind": "image", + "metadata": "", + "name": "rotate-screen-icon.png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Mobile Layouts/assets/6a8102ce3340bf9f62300ee1a81ef0b2327b2c6e8d62d7dda68d547f5e2b5969_rotate-screen-icon.png", + "name": "rotate-screen-icon.png" + } } ], "resourceFolders": [] @@ -522,7 +533,7 @@ "gridColor": 10401023, "gridAlpha": 0.8, "snap": true, - "zoomFactor": 0.2817259932079611, + "zoomFactor": 0.41943397827591405, "windowMask": false }, "objectsGroups": [ @@ -542,17 +553,6 @@ "name": "Target3" } ] - }, - { - "name": "UI", - "objects": [ - { - "name": "LookJoystick" - }, - { - "name": "WalkJoystick" - } - ] } ], "variables": [ @@ -1523,24 +1523,6 @@ "CurrentRotationSpeedZ": 0, "CurrentRotationSpeedY": 0 }, - { - "name": "FirstPersonMultitouchMapper", - "type": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", - "Object3D": "Object3D", - "GamepadIdentifier": 1, - "CameraStick": "Secondary", - "RotationSpeedMaxZ": 180, - "RotationAccelerationZ": 360, - "RotationDecelerationZ": 720, - "RotationSpeedMaxY": 120, - "RotationAccelerationY": 240, - "RotationDecelerationY": 480, - "ElevationAngleMin": -90, - "ElevationAngleMax": 90, - "OffsetZ": 0, - "CurrentRotationSpeedZ": 0, - "CurrentRotationSpeedY": 0 - }, { "name": "FirstPersonPointerMapper", "type": "MousePointerLock::FirstPersonPointerMapper", @@ -1588,7 +1570,9 @@ "sidewaysDeceleration": 800, "sidewaysSpeedMax": 400, "slopeMaxAngle": 50, - "shouldBindObjectAndForwardAngle": true + "shouldBindObjectAndForwardAngle": true, + "stairHeightMax": 20, + "canBePushed": true }, { "name": "Shooter3DGamepadMapper", @@ -1723,7 +1707,8 @@ "behaviors": [ { "name": "ShakeObject_PositionAngleScale", - "type": "ShakeObject::ShakeObject_PositionAngleScale" + "type": "ShakeObject::ShakeObject_PositionAngleScale", + "Scale": "Scale" } ], "animations": [ @@ -1871,102 +1856,6 @@ "wordWrap": true } }, - { - "assetStoreId": "9be1b0d0d5a1afad4537db989ea5e3a4a4564dfd123630a9bf61330a73803c63", - "name": "LookJoystick", - "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 0, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "ControllerIdentifier": 1, - "JoystickIdentifier": "Secondary", - "DeadZoneRadius": 0.4 - }, - "childrenContent": { - "Border": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "Shaded dark joystick border.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - }, - "Thumb": { - "adaptCollisionMaskAutomatically": false, - "updateIfNotVisible": false, - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": false, - "image": "Shaded dark joystick thumb.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [] - } - ] - } - ] - } - ] - } - } - }, { "assetStoreId": "9be1b0d0d5a1afad4537db989ea5e3a4a4564dfd123630a9bf61330a73803c63", "name": "WalkJoystick", @@ -1990,7 +1879,7 @@ "sprites": [ { "hasCustomCollisionMask": false, - "image": "Shaded dark joystick border.png", + "image": "assets\\Line light joystick border.png", "points": [], "originPoint": { "name": "origine", @@ -2025,7 +1914,7 @@ "sprites": [ { "hasCustomCollisionMask": false, - "image": "Shaded dark joystick thumb.png", + "image": "assets\\Line light joystick thumb.png", "points": [], "originPoint": { "name": "origine", @@ -2104,6 +1993,141 @@ "bottomFaceResourceRepeat": true, "materialType": "StandardWithoutMetalness" } + }, + { + "assetStoreId": "e5919fb86a559b00001678c710efe55f4e9f2e032a9ff9610087370f998d57de", + "name": "ScreenOrientationChecker", + "type": "ScreenOrientationChecker::ScreenOrientationChecker", + "variables": [], + "effects": [], + "behaviors": [ + { + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "name": "Anchor", + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "type": "AnchorBehavior::AnchorBehavior", + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "IsForceShown": false, + "BackgroundColor": "24;24;24", + "CornerRadius": 8, + "Padding": 5 + }, + "childrenContent": { + "BackgroundPainter": { + "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 + } + }, + "Icon": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "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 + } + ] + ] + } + ] + } + ] + } + ] + }, + "Text": { + "bold": true, + "italic": false, + "smoothed": true, + "underlined": false, + "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, + "color": "255;255;255" + } + } + } } ], "objectsFolderStructure": { @@ -2128,10 +2152,13 @@ "objectName": "Restart" }, { - "objectName": "LookJoystick" + "objectName": "WalkJoystick" + }, + { + "objectName": "ScreenOrientationChecker" }, { - "objectName": "WalkJoystick" + "objectName": "Crosshair" } ] }, @@ -2167,9 +2194,6 @@ }, { "objectName": "MarkerAbove" - }, - { - "objectName": "Crosshair" } ] }, @@ -2293,12 +2317,65 @@ }, "parameters": [ "", - "\"TouchControls\"", + "\"Touch controls\"", "", "", "" ] } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "WalkJoystick" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "WalkJoystick", + "", + "" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "WalkJoystick", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "WalkJoystick", + "CursorX(\"UI\")" ] } ] @@ -2377,28 +2454,12 @@ "subInstructions": [ { "type": { - "value": "BuiltinCommonInstructions::And" + "value": "DoubleClick::HasSimpleClicked" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "MouseButtonReleased" - }, - "parameters": [ - "", - "Left" - ] - }, - { - "type": { - "value": "MousePointerLock::isPointerLocked" - }, - "parameters": [ - "", - "" - ] - } + "parameters": [ + "", + "Left", + "" ] }, { @@ -3129,12 +3190,12 @@ }, { "type": { - "value": "MettreX" + "value": "SetCenterX" }, "parameters": [ "Restart", "=", - "(ScreenWidth()/2)-(Restart.Width()/2)" + "ScreenWidth() / 2" ] }, { @@ -3174,21 +3235,6 @@ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ - { - "type": { - "value": "MouseButtonPressed" - }, - "parameters": [ - "", - "Left" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - }, { "type": { "inverted": true, @@ -3198,35 +3244,78 @@ "", "" ] - }, + } + ], + "actions": [], + "events": [ { - "type": { - "value": "BuiltinCommonInstructions::Not" - }, - "parameters": [], - "subInstructions": [ - { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SystemInfo::HasTouchScreen" + }, + "parameters": [ + "" + ] + }, + { "type": { - "value": "SourisSurObjet" + "value": "MouseButtonFromTextPressed" }, "parameters": [ - "UI", "", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "MousePointerLock::RequestPointerLock" + }, + "parameters": [ "", "" ] } ] - } - ], - "actions": [ + }, { - "type": { - "value": "MousePointerLock::RequestPointerLock" - }, - "parameters": [ - "", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SystemInfo::HasTouchScreen" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "WalkJoystick", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MousePointerLock::RequestPointerLock" + }, + "parameters": [ + "", + "" + ] + } ] } ] @@ -3248,11 +3337,11 @@ "conditions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "r" + "\"r\"" ] } ], @@ -3374,10 +3463,6 @@ "name": "FirstPersonGamepadMapper", "type": "Gamepads::FirstPersonGamepadMapper" }, - { - "name": "FirstPersonMultitouchMapper", - "type": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper" - }, { "name": "FirstPersonPointerMapper", "type": "MousePointerLock::FirstPersonPointerMapper" @@ -11594,7 +11679,7 @@ "name": "MousePointerLock", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Virtual Reality/Virtual Reality_360_rotate_vr_movement.svg", "shortDescription": "This behavior removes the limit on the distance the mouse can move and hides the cursor.", - "version": "0.1.8", + "version": "0.2.0", "description": [ "This behavior removes the limit on the distance the mouse can move and hides the cursor.", "", @@ -11618,11 +11703,33 @@ "pointer" ], "authorIds": [ - "Zu55H5hcb9YmZTltIVOTAFDJQyB2" + "Zu55H5hcb9YmZTltIVOTAFDJQyB2", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" ], "dependencies": [], "globalVariables": [], - "sceneVariables": [], + "sceneVariables": [ + { + "name": "TouchId", + "type": "number", + "value": -1 + }, + { + "name": "OldX", + "type": "number", + "value": 0 + }, + { + "name": "OldY", + "type": "number", + "value": 0 + }, + { + "name": "TouchSpeedFactor", + "type": "number", + "value": 4 + } + ], "eventsFunctions": [ { "fullName": "", @@ -11633,25 +11740,63 @@ { "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ - "const canvas = runtimeScene.getGame().getRenderer().getCanvas();", + "class PointerLockHandler {", + " movementX = 0;", + " movementY = 0;", + " retried = false;", + " /**", + " * @type {gdjs.RuntimeGame}", + " */", + " game;", "", - "gdjs._MousePointerLockExtension = {", - " movementX: 0,", - " movementY: 0,", - " retried: false,", - "};", + " /**", + " * @param {gdjs.RuntimeGame} game", + " */", + " constructor(game) {", + " this.game = game;", + " const canvas = game.getRenderer().getCanvas();", + "", + " canvas.addEventListener(\"pointermove\", event => {", + " if (!!document.pointerLockElement) {", + " this.movementX += event.movementX || 0;", + " this.movementY += event.movementY || 0;", + " }", + " }, false);", + "", + " document.addEventListener(\"pointerlockerror\", event => {", + " if (!this.retried) {", + " canvas.requestPointerLock();", + " this.retried = true;", + " }", + " });", + " }", + "", + " requestPointerLock() {", + " const canvas = this.game.getRenderer().getCanvas();", + " if (canvas.requestPointerLock && !document.pointerLockElement) {", + " this.retried = false;", + " canvas.requestPointerLock({ unadjustedMovement: true });", + " }", + " }", + "", + " exitPointerLock() {", + " if (document.exitPointerLock) {", + " document.exitPointerLock();", + " }", + " }", + "", + " isPointerLocked() {", + " return !!document.pointerLockElement;", + " }", "", - "canvas.addEventListener(\"pointermove\", (e) => {", - " gdjs._MousePointerLockExtension.movementX += e.movementX || 0;", - " gdjs._MousePointerLockExtension.movementY += e.movementY || 0;", - "}, false);", + " resetMovement() {", + " this.movementX = 0;", + " this.movementY = 0;", + " }", + "};", "", - "document.addEventListener(\"pointerlockerror\", (e) => {", - " if (!gdjs._MousePointerLockExtension.retried) {", - " canvas.requestPointerLock();", - " gdjs._MousePointerLockExtension.retried = true;", - " } ", - "});" + "gdjs._MousePointerLockExtension = { handler: new PointerLockHandler(runtimeScene.getGame()) };", + "" ], "parameterObjects": "", "useStrict": true, @@ -11670,12 +11815,98 @@ { "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ - "gdjs._MousePointerLockExtension.movementX = 0;\r", - "gdjs._MousePointerLockExtension.movementY = 0;" + "const { handler } = gdjs._MousePointerLockExtension;\r", + "\r", + "handler.resetMovement();\r", + "" ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": false + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "MousePointerLock::isEmulatingPointerLock" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MousePointerLock::SetMovementX" + }, + "parameters": [ + "", + "=", + "(MousePointerLock::TouchX(TouchId) - OldX) * TouchSpeedFactor", + "" + ] + }, + { + "type": { + "value": "MousePointerLock::SetMovementY" + }, + "parameters": [ + "", + "=", + "(MousePointerLock::TouchY(TouchId) - OldY) * TouchSpeedFactor", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OldX", + "=", + "MousePointerLock::TouchX(TouchId)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OldY", + "=", + "MousePointerLock::TouchY(TouchId)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasTouchEnded" + }, + "parameters": [ + "", + "TouchId" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchId", + "=", + "-1" + ] + } + ] } ], "parameters": [], @@ -11688,18 +11919,72 @@ "name": "RequestPointerLock", "sentence": "Request Pointer Lock", "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TouchId", + "=", + "-1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchId", + "=", + "StartedTouchOrMouseId(0)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OldX", + "=", + "MousePointerLock::TouchX(TouchId)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OldY", + "=", + "MousePointerLock::TouchY(TouchId)" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ - "const canvas = runtimeScene.getGame().getRenderer().getCanvas();\r", - "if (canvas.requestPointerLock && !document.pointerLockElement) {\r", - " canvas.requestPointerLock({ unadjustedMovement: true });\r", - " gdjs._MousePointerLockExtension.retried = false;\r", - "}" + "const { handler } = gdjs._MousePointerLockExtension;\r", + "\r", + "handler.requestPointerLock();\r", + "" ], "parameterObjects": "", "useStrict": true, - "eventsSheetExpanded": true + "eventsSheetExpanded": false } ], "parameters": [], @@ -11712,12 +11997,30 @@ "name": "ExitPointerLock", "sentence": "Exit pointer lock", "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchId", + "=", + "-1" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ - "if (document.exitPointerLock) {\r", - " document.exitPointerLock();\r", - "}" + "\r", + "const { handler } = gdjs._MousePointerLockExtension;\r", + "\r", + "handler.exitPointerLock();\r", + "" ], "parameterObjects": "", "useStrict": true, @@ -11735,22 +12038,146 @@ "sentence": "The mouse pointer is locked", "events": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "eventsFunctionContext.returnValue = document.pointerLockElement ? true : false;", - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Check if the locked pointer is moving.", - "fullName": "Locked pointer is moving", - "functionType": "Condition", - "name": "IsMoving", - "sentence": "Locked pointer is moving", + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TouchId", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TouchId", + "<", + "0" + ] + }, + { + "type": { + "value": "MousePointerLock::isPointerActuallyLocked" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Check if the mouse pointer is actually locked.", + "fullName": "Pointer is actually locked", + "functionType": "Condition", + "name": "isPointerActuallyLocked", + "private": true, + "sentence": "The mouse pointer actually is locked", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const { handler } = gdjs._MousePointerLockExtension;\r", + "\r", + "eventsFunctionContext.returnValue = handler.isPointerLocked();\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Check if the mouse pointer lock is emulated.", + "fullName": "Pointer lock is emulated", + "functionType": "Condition", + "name": "isEmulatingPointerLock", + "private": true, + "sentence": "The mouse pointer is lock is emulated", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "MousePointerLock::isPointerActuallyLocked" + }, + "parameters": [ + "", + "" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TouchId", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Check if the locked pointer is moving.", + "fullName": "Locked pointer is moving", + "functionType": "Condition", + "name": "IsMoving", + "sentence": "Locked pointer is moving", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -11811,7 +12238,11 @@ "events": [ { "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "eventsFunctionContext.returnValue = gdjs._MousePointerLockExtension.movementX || 0;", + "inlineCode": [ + "\r", + "eventsFunctionContext.returnValue = gdjs._MousePointerLockExtension.handler.movementX || 0;\r", + "" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": false @@ -11823,6 +12254,31 @@ "parameters": [], "objectGroups": [] }, + { + "description": "the movement of the locked pointer on the X axis.", + "fullName": "Pointer X movement", + "functionType": "ActionWithOperator", + "getterName": "MovementX", + "name": "SetMovementX", + "private": true, + "sentence": "the movement of the locked pointer on the X axis", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const value = eventsFunctionContext.getArgument(\"Value\");\r", + "gdjs._MousePointerLockExtension.handler.movementX = value;\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, { "description": "the movement of the pointer on the Y axis.", "fullName": "Pointer Y movement", @@ -11833,7 +12289,11 @@ "events": [ { "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "eventsFunctionContext.returnValue = gdjs._MousePointerLockExtension.movementY || 0;", + "inlineCode": [ + "\r", + "eventsFunctionContext.returnValue = gdjs._MousePointerLockExtension.handler.movementY || 0;\r", + "" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": false @@ -11844,33 +12304,177 @@ }, "parameters": [], "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ + }, { - "description": "Control camera rotations with a mouse.", - "fullName": "First person camera mouse mapper", - "name": "FirstPersonPointerMapper", - "objectType": "", - "eventsFunctions": [ + "description": "the movement of the locked pointer on the X axis.", + "fullName": "Pointer X movement", + "functionType": "ActionWithOperator", + "getterName": "MovementY", + "name": "SetMovementY", + "private": true, + "sentence": "the movement of the locked pointer on the X axis", + "events": [ { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", - "events": [ + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "const value = eventsFunctionContext.getArgument(\"Value\");\r", + "gdjs._MousePointerLockExtension.handler.movementY = value;\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Return the X position of a specific touch", + "fullName": "Touch X position", + "functionType": "Expression", + "name": "TouchX", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const touchId = eventsFunctionContext.getArgument(\"NewTouchId\");", + "eventsFunctionContext.returnValue = runtimeScene.getGame().getInputManager().getTouchX(touchId);", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Touch identifier", + "name": "NewTouchId", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the Y position of a specific touch", + "fullName": "Touch Y position", + "functionType": "Expression", + "name": "TouchY", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const touchId = eventsFunctionContext.getArgument(\"NewTouchId\");", + "eventsFunctionContext.returnValue = runtimeScene.getGame().getInputManager().getTouchY(touchId);", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Touch identifier", + "name": "NewTouchId", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the speed factor for touch movement.", + "fullName": "Speed factor for touch movement", + "functionType": "ExpressionAndCondition", + "name": "TouchSpeedFactor", + "sentence": "the speed factor for touch movement", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetReturnNumber" }, - "comment": "TODO It's probably a bad idea to rotate the object around Y." - }, + "parameters": [ + "TouchSpeedFactor" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "TouchSpeedFactor", + "name": "SetTouchSpeedFactor", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchSpeedFactor", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Control camera rotations with a mouse.", + "fullName": "First person camera mouse mapper", + "name": "FirstPersonPointerMapper", + "objectType": "", + "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": [ @@ -12573,7 +13177,7 @@ "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.5.0", + "version": "1.6.1", "description": [ "Multitouch joysticks can be used the same way as physical gamepads:", "- 4 or 8 directions", @@ -14045,6 +14649,11 @@ "name": "JoystickIdentifier", "supplementaryInformation": "[\"Primary\",\"Secondary\"]", "type": "stringWithSelector" + }, + { + "description": "", + "name": "Coucou", + "type": "expression" } ], "objectGroups": [] @@ -14337,6 +14946,123 @@ } ], "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": "CompareArgumentAsString" + }, + "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": "CompareArgumentAsString" + }, + "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": [ @@ -14766,6 +15492,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "", + "name": "Parameter", + "type": "objectList" } ], "objectGroups": [] @@ -15438,6 +16169,51 @@ } ], "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": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": [ @@ -15609,12 +16385,31 @@ "conditions": [ { "type": { - "value": "CollisionPoint" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "Object", - "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)" + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer())", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer())" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyRadius" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer()), TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer()))" + ] + } ] } ], @@ -15930,6 +16725,16 @@ "extraInformation": [], "hidden": true, "name": "IsReleased" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Triggering circle radius", + "description": "This circle adds up to the object collision mask.", + "group": "", + "extraInformation": [], + "name": "Radius" } ], "sharedPropertyDescriptors": [] @@ -18214,37 +19019,80 @@ ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onHotReloading", - "sentence": "", - "events": [ + }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::PropertyShouldBeHiddenWhenReleased" }, "parameters": [ - "Object", - "" + "Object" ] - } + }, + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Object", + "no", + "" + ] + } + ] + } + ], + "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", + "" + ] + } ] } ], @@ -18319,6 +19167,176 @@ ], "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": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::SetPropertyShouldBeHiddenWhenReleased" + }, + "parameters": [ + "Object", + "yes" + ] + }, + { + "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", @@ -19039,6 +20057,16 @@ "extraInformation": [], "hidden": true, "name": "ParentOrigin" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShouldBeHiddenWhenReleased" } ], "objects": [ @@ -29857,90 +30885,1361 @@ "\r", "eventsFunctionContext.returnValue = gdjs._cameraShake3DExtension.noiseManager.getGenerator(name).octaves;" ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false + "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._cameraShake3DExtension.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._cameraShake3DExtension.noiseManager.getGenerator(name).lacunarity;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "Silver-Streak", + "category": "Input", + "extensionNamespace": "", + "fullName": "Double-click and tap", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwO30NCjwvc3R5bGU+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMTYiIHkxPSIzIiB4Mj0iMTYiIHkyPSI2Ii8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMTYiIHkxPSIxMCIgeDI9IjE2IiB5Mj0iMTMiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xNiwxMEwxNiwxMGMtMS4xLDAtMi0wLjktMi0ydjBjMC0xLjEsMC45LTIsMi0yaDBjMS4xLDAsMiwwLjksMiwydjBDMTgsOS4xLDE3LjEsMTAsMTYsMTB6Ii8+DQo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNywxNC4xYzIuMy0wLjcsNS41LTEuMSw5LTEuMWMzLjUsMCw2LjcsMC40LDksMS4xIi8+DQo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMTYsMjlMMTYsMjljLTUsMC05LTQtOS05di01LjlWOWMwLTMuMywyLjctNiw2LTZoNmMzLjMsMCw2LDIuNyw2LDZ2MTFDMjUsMjUsMjEsMjksMTYsMjl6Ii8+DQo8L3N2Zz4NCg==", + "name": "DoubleClick", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Computers and Hardware/Computers and Hardware_mouse_wireless_pc.svg", + "shortDescription": "Check for a double-click or a tap.", + "version": "2.0.0", + "description": [ + "Check for a double-click with a mouse, or a tap and double-click on a touchscreen.", + "", + "Please note: Touch devices do not have alternatives for middle/right clicks. Taps on a touch device will get counted for _any_ use of these conditions, so you should either design your controls accordingly, or build out separate events if the device has a touch screen.", + "", + "Breaking changes from 2.0.0:", + "- Mouse button value now needs quotes", + "- The double-click sensitivity now relies on the device settings" + ], + "origin": { + "identifier": "DoubleClick", + "name": "gdevelop-extension-store" + }, + "tags": [ + "mouse", + "cursor", + "pointer", + "click", + "tap" + ], + "authorIds": [ + "8Ih1aa8f5gWUp4UB2BdhQ2iXWxJ3", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [ + { + "name": "MaxDelay", + "type": "number", + "value": 0.5 + } + ], + "sceneVariables": [], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "class ClickCounter {", + " // Multiple clicks", + " multipleClickButton = -1;", + " count = 0;", + "", + " // Simple click", + " lastButton = -1;", + " lastPointerId = 0;", + " lastTime = 0;", + " hasMoved = false;", + " simpleClickButton = -1;", + "", + " constructor() {", + " window.addEventListener(", + " 'click',", + " event => {", + " if (event.detail > 1) {", + " this.multipleClickButton = convertHtmlMouseButtonToInputManagerMouseButton(event.button);", + " this.count = event.detail;", + " }", + " }", + " );", + "", + " // The 'click' event doesn't do any constraint on the 1st click.", + " // It doesn't allow to differenciate a dragging from a click.", + " // So, we check it manually.", + "", + " window.addEventListener(", + " 'pointerdown',", + " event => {", + " this.lastButton = event.button;", + " this.lastPointerId = event.pointerId;", + " this.lastTime = Date.now();", + " this.hasMoved = false;", + " }", + " );", + "", + " window.addEventListener(", + " 'pointermove',", + " event => {", + " if (event.pointerId === this.lastPointerId) {", + " this.hasMoved = true;", + " }", + " }", + " );", + "", + " window.addEventListener(", + " 'pointerup',", + " (event) => {", + " if (event.button === this.lastButton &&", + " event.pointerId === this.lastPointerId &&", + " (!this.hasMoved || Date.now() - this.lastTime < 500)) {", + " this.simpleClickButton = convertHtmlMouseButtonToInputManagerMouseButton(event.button);", + " this.lastButton = -1;", + " }", + " }", + " );", + "", + " }", + "", + " reset() {", + " this.multipleClickButton = -1;", + " this.simpleClickButton = -1;", + " }", + "", + " hasClicked(buttonName, count) {", + " const button = gdjs.evtTools.input.mouseButtonsNameToCode[buttonName];", + " if (count === 1) {", + " return button === this.simpleClickButton;", + " }", + " else {", + " return button === this.multipleClickButton && clickCount === this.count", + " }", + " }", + "}", + "", + "// Converts HTML mouse button to InputManager mouse button.", + "// This function is used to align HTML button values with GDevelop 3 C++ SFML Mouse button enum values,", + "// notably the middle and right buttons.", + "function convertHtmlMouseButtonToInputManagerMouseButton(button) {", + " switch (button) {", + " case 1: // Middle button", + " return gdjs.InputManager.MOUSE_MIDDLE_BUTTON;", + " case 2: // Right button", + " return gdjs.InputManager.MOUSE_RIGHT_BUTTON;", + " }", + " return button;", + "}", + "", + "gdjs._DoubleClickExtension = { clickCounter: new ClickCounter() };", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onScenePostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const { clickCounter } = gdjs._DoubleClickExtension;\r", + "\r", + "clickCounter.reset();\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Check if the specified mouse button is clicked twice in a short amount of time.", + "fullName": "Double-clicked (or double-tapped)", + "functionType": "Condition", + "name": "HasDoubleClicked", + "sentence": "_PARAM1_ mouse button is double-clicked", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DoubleClick::HasClicked" + }, + "parameters": [ + "", + "MouseButton", + "2", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Mouse button to track", + "longDescription": "As touch devices do not have middle/right tap equivalents, you will need to account for this within your events if you're not using the left mouse button and building for touch devices.", + "name": "MouseButton", + "type": "mouse" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the specified mouse button is clicked.", + "fullName": "Clicked (or tapped)", + "functionType": "Condition", + "name": "HasSimpleClicked", + "sentence": "_PARAM1_ mouse button is clicked", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DoubleClick::HasClicked" + }, + "parameters": [ + "", + "MouseButton", + "1", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Mouse button to track", + "longDescription": "As touch devices do not have middle/right tap equivalents, you will need to account for this within your events if you're not using the left mouse button and building for touch devices.", + "name": "MouseButton", + "type": "mouse" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the specified mouse button is clicked.", + "fullName": "Clicked (or tapped)", + "functionType": "Condition", + "name": "HasClicked", + "private": true, + "sentence": "_PARAM1_ mouse button is clicked _PARAM2_ times", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const { clickCounter } = gdjs._DoubleClickExtension;", + "", + "const buttonName = eventsFunctionContext.getArgument(\"MouseButton\");", + "const clickCount = eventsFunctionContext.getArgument(\"ClickCount\");", + "", + "eventsFunctionContext.returnValue = clickCounter.hasClicked(buttonName, clickCount);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Mouse button to track", + "longDescription": "As touch devices do not have middle/right tap equivalents, you will need to account for this within your events if you're not using the left mouse button and building for touch devices.", + "name": "MouseButton", + "type": "string" + }, + { + "description": "Click count", + "name": "ClickCount", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Input", + "extensionNamespace": "", + "fullName": "Screen Orientation Checker", + "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.0.2", + "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": [ + { + "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", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "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": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "!=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + } + ] + }, + { + "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": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + } + ] + } + ] + }, + { + "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": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsShown" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::FillColor" + }, + "parameters": [ + "BackgroundPainter", + "BackgroundColor" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::RoundedRectangle" + }, + "parameters": [ + "BackgroundPainter", + "Padding", + "Padding", + "Object.Width()-Padding", + "Object.Height()-Padding", + "CornerRadius" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsShown" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "inverted": true, + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" + ] + } + ], + "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": "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", + "group": "Screen Orientation Checker configuration", + "name": "IsForceShown", + "sentence": "_PARAM0_ is forced to be shown", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" + ] + } + ], + "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", + "group": "Screen Orientation Checker configuration", + "name": "SetIsForceShown", + "sentence": "Force _PARAM0_ to be shown: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsForceShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsForceShown" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + }, + { + "defaultValue": "yes", + "description": "Force show the screen?", + "name": "Value", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] } ], - "expressionType": { - "type": "expression" - }, - "parameters": [ + "propertyDescriptors": [ { - "description": "Generator name", - "name": "Name", - "type": "string" + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsShown" + }, + { + "value": "", + "type": "Boolean", + "label": "Force show the screen", + "description": "Use this to test the screen in your game", + "group": "", + "extraInformation": [], + "name": "IsForceShown" + }, + { + "value": "5", + "type": "Number", + "unit": "Pixel", + "label": "Padding", + "description": "", + "group": "Appearance", + "extraInformation": [], + "name": "Padding" + }, + { + "value": "10", + "type": "Number", + "unit": "Pixel", + "label": "Corner radius", + "description": "Corner radius for the background", + "group": "Appearance", + "extraInformation": [], + "name": "CornerRadius" + }, + { + "value": "0;0;0", + "type": "Color", + "label": "Background color", + "description": "", + "group": "Appearance", + "extraInformation": [], + "name": "BackgroundColor" } ], - "objectGroups": [] - }, - { - "description": "The persistence used for noise generation.", - "fullName": "Noise persistence", - "functionType": "Expression", - "name": "Persistence", - "private": true, - "sentence": "", - "events": [ + "objects": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "\r", - "eventsFunctionContext.returnValue = gdjs._cameraShake3DExtension.noiseManager.getGenerator(name).persistence;" + "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" + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ + "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, + "color": "255;255;255" + } + }, { - "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": [ + "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 + } + }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const name = eventsFunctionContext.getArgument(\"Name\");\r", - "\r", - "eventsFunctionContext.returnValue = gdjs._cameraShake3DExtension.noiseManager.getGenerator(name).lacunarity;" + "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" + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false + "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 + } + ] + ] + } + ] + } + ] + } + ] } ], - "expressionType": { - "type": "expression" + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Text" + }, + { + "objectName": "BackgroundPainter" + }, + { + "objectName": "Icon" + } + ] }, - "parameters": [ + "objectsGroups": [], + "layers": [ { - "description": "Generator name", - "name": "Name", - "type": "string" + "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": [] } ], - "objectGroups": [] + "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": [] + } + ] } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [] + ] } ], "externalLayouts": [ @@ -29994,7 +32293,7 @@ "width": 0, "x": 0, "y": 675, - "zOrder": 17, + "zOrder": 2, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -30009,7 +32308,7 @@ "width": 0, "x": 0, "y": 625, - "zOrder": 14, + "zOrder": 1, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -30024,7 +32323,7 @@ "width": 700, "x": 325, "y": 285, - "zOrder": 22, + "zOrder": 3, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -30039,7 +32338,58 @@ "width": 125, "x": 575, "y": 25, - "zOrder": 12, + "zOrder": 4, + "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": "GameScene", + "name": "Touch controls", + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "UI", + "name": "WalkJoystick", + "persistentUuid": "85c600a1-fb03-4bb6-8975-4b822d89538b", + "width": 0, + "x": 189, + "y": 534, + "zOrder": 10, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 720, + "layer": "UI", + "name": "ScreenOrientationChecker", + "persistentUuid": "9abfcbea-c248-4c77-aaa5-81a634d2ee88", + "width": 1280, + "x": 0, + "y": 0, + "zOrder": 11, "numberProperties": [], "stringProperties": [], "initialVariables": [] @@ -30059,6 +32409,5 @@ "windowMask": false } } - ], - "externalSourceFiles": [] + ] } \ No newline at end of file diff --git a/examples/3d-shooting-gallery/assets/Line light joystick border.png b/examples/3d-shooting-gallery/assets/Line light joystick border.png new file mode 100644 index 000000000..a795a9e84 Binary files /dev/null and b/examples/3d-shooting-gallery/assets/Line light joystick border.png differ diff --git a/examples/3d-shooting-gallery/assets/Line light joystick thumb.png b/examples/3d-shooting-gallery/assets/Line light joystick thumb.png new file mode 100644 index 000000000..ece439075 Binary files /dev/null and b/examples/3d-shooting-gallery/assets/Line light joystick thumb.png differ diff --git a/examples/3d-shooting-gallery/assets/Shaded dark joystick border.png b/examples/3d-shooting-gallery/assets/Shaded dark joystick border.png deleted file mode 100644 index 3d6f08b35..000000000 Binary files a/examples/3d-shooting-gallery/assets/Shaded dark joystick border.png and /dev/null differ diff --git a/examples/3d-shooting-gallery/assets/Shaded dark joystick thumb.png b/examples/3d-shooting-gallery/assets/Shaded dark joystick thumb.png deleted file mode 100644 index e91064672..000000000 Binary files a/examples/3d-shooting-gallery/assets/Shaded dark joystick thumb.png and /dev/null differ diff --git a/examples/3d-shooting-gallery/assets/rotate-screen-icon.png b/examples/3d-shooting-gallery/assets/rotate-screen-icon.png new file mode 100644 index 000000000..a7726dee3 Binary files /dev/null and b/examples/3d-shooting-gallery/assets/rotate-screen-icon.png differ diff --git a/examples/conviction-of-gun-dude-desktop/conviction-of-gun-dude-desktop.json b/examples/conviction-of-gun-dude-desktop/conviction-of-gun-dude-desktop.json index 6de1ad274..83de832a3 100644 --- a/examples/conviction-of-gun-dude-desktop/conviction-of-gun-dude-desktop.json +++ b/examples/conviction-of-gun-dude-desktop/conviction-of-gun-dude-desktop.json @@ -1,9 +1,9 @@ { "firstLayout": "StartMenu", "gdVersion": { - "build": 99, - "major": 4, - "minor": 0, + "build": 221, + "major": 5, + "minor": 5, "revision": 0 }, "properties": { @@ -18,7 +18,6 @@ "scaleMode": "nearest", "sizeOnStartupMode": "", "templateSlug": "", - "useExternalSourceFiles": false, "version": "1.0.4", "name": "The Conviction Of Gun Dude", "description": "Top down shoot'em up game with a leaderboard, randomized rooms, and upgrades.", @@ -102,7 +101,6 @@ "resources": { "resources": [ { - "alwaysLoaded": false, "file": "assets/Player1.png", "kind": "image", "metadata": "", @@ -111,7 +109,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Player2.png", "kind": "image", "metadata": "", @@ -120,7 +117,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Player3.png", "kind": "image", "metadata": "", @@ -129,7 +125,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Player4.png", "kind": "image", "metadata": "", @@ -138,7 +133,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Ghost1.png", "kind": "image", "metadata": "", @@ -147,7 +141,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Ghost2.png", "kind": "image", "metadata": "", @@ -156,7 +149,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Ghost3.png", "kind": "image", "metadata": "", @@ -165,7 +157,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Ghost4.png", "kind": "image", "metadata": "", @@ -174,7 +165,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/GhostSquint1.png", "kind": "image", "metadata": "", @@ -183,7 +173,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/GhostSquint2.png", "kind": "image", "metadata": "", @@ -192,7 +181,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/GhostSquint3.png", "kind": "image", "metadata": "", @@ -201,7 +189,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/GhostSquint4.png", "kind": "image", "metadata": "", @@ -227,7 +214,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/WesleyDeathParticle.png", "kind": "image", "metadata": "", @@ -236,7 +222,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Room_Trap53.png", "kind": "image", "metadata": "", @@ -245,7 +230,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/HealthbarBorder.png", "kind": "image", "metadata": "", @@ -254,7 +238,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Healthbar.png", "kind": "image", "metadata": "", @@ -263,7 +246,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_4Way_Walls2.png", "kind": "image", "metadata": "", @@ -272,7 +254,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Room_Floor2.png", "kind": "image", "metadata": "", @@ -301,7 +282,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Trap54.png", "kind": "image", "metadata": "", @@ -310,7 +290,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Spider1.png", "kind": "image", "metadata": "", @@ -319,7 +298,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Spider2.png", "kind": "image", "metadata": "", @@ -328,7 +306,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Spider3.png", "kind": "image", "metadata": "", @@ -337,7 +314,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Spider4.png", "kind": "image", "metadata": "", @@ -346,7 +322,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/SpiderCharging1.png", "kind": "image", "metadata": "", @@ -355,7 +330,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/SpiderCharging2.png", "kind": "image", "metadata": "", @@ -364,7 +338,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/SpiderHurt.png", "kind": "image", "metadata": "", @@ -373,7 +346,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Bullet.png", "kind": "image", "metadata": "", @@ -382,7 +354,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/GhostOrb.png", "kind": "image", "metadata": "", @@ -391,7 +362,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Health.png", "kind": "image", "metadata": "", @@ -400,7 +370,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Armor.png", "kind": "image", "metadata": "", @@ -409,7 +378,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Power.png", "kind": "image", "metadata": "", @@ -418,7 +386,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_FireRate.png", "kind": "image", "metadata": "", @@ -427,7 +394,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Speed.png", "kind": "image", "metadata": "", @@ -436,7 +402,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Health2.png", "kind": "image", "metadata": "", @@ -445,7 +410,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Armor2.png", "kind": "image", "metadata": "", @@ -454,7 +418,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Power2.png", "kind": "image", "metadata": "", @@ -463,7 +426,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_FireRate2.png", "kind": "image", "metadata": "", @@ -472,7 +434,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Speed2.png", "kind": "image", "metadata": "", @@ -481,7 +442,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp1.png", "kind": "image", "metadata": "", @@ -490,7 +450,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp2.png", "kind": "image", "metadata": "", @@ -499,7 +458,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp3.png", "kind": "image", "metadata": "", @@ -508,7 +466,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp4.png", "kind": "image", "metadata": "", @@ -517,7 +474,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ImpCharging1.png", "kind": "image", "metadata": "", @@ -526,7 +482,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ImpCharging2.png", "kind": "image", "metadata": "", @@ -535,7 +490,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ImpCharging3.png", "kind": "image", "metadata": "", @@ -544,7 +498,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ImpCharging4.png", "kind": "image", "metadata": "", @@ -553,7 +506,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Room_4Way_Doors1.png", "kind": "image", "metadata": "", @@ -562,7 +514,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_4Way_Doors22.png", "kind": "image", "metadata": "", @@ -571,7 +522,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_4Way_Doors3.png", "kind": "image", "metadata": "", @@ -580,7 +530,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_4Way_Doors4.png", "kind": "image", "metadata": "", @@ -589,7 +538,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/PointOrb.png", "kind": "image", "metadata": "", @@ -598,7 +546,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/HealthOrb.png", "kind": "image", "metadata": "", @@ -617,7 +564,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Darkening.png", "kind": "image", "metadata": "", @@ -726,7 +672,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_UpDeadEnd_Walls.png", "kind": "image", "metadata": "", @@ -735,7 +680,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_DownDeadEnd_Walls.png", "kind": "image", "metadata": "", @@ -744,7 +688,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_SideTwoWay_Walls.png", "kind": "image", "metadata": "", @@ -753,7 +696,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Room_UpDeadEnd_Doors1.png", "kind": "image", "metadata": "", @@ -762,7 +704,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_UpDeadEnd_Doors2.png", "kind": "image", "metadata": "", @@ -771,7 +712,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_UpDeadEnd_Doors3.png", "kind": "image", "metadata": "", @@ -780,7 +720,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_UpDeadEnd_Doors4.png", "kind": "image", "metadata": "", @@ -789,7 +728,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_DownDeadEnd_Doors1.png", "kind": "image", "metadata": "", @@ -798,7 +736,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_DownDeadEnd_Doors2.png", "kind": "image", "metadata": "", @@ -807,7 +744,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Room_DownDeadEnd_Doors3.png", "kind": "image", "metadata": "", @@ -816,7 +752,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Room_DownDeadEnd_Doors4.png", "kind": "image", "metadata": "", @@ -825,7 +760,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Side2way_Doors1.png", "kind": "image", "metadata": "", @@ -834,7 +768,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Side2way_Doors2.png", "kind": "image", "metadata": "", @@ -843,7 +776,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Side2way_Doors3.png", "kind": "image", "metadata": "", @@ -852,7 +784,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Side2way_Doors4.png", "kind": "image", "metadata": "", @@ -861,7 +792,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_UpDeadEnd_Floor.png", "kind": "image", "metadata": "", @@ -870,7 +800,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Room_DownDeadEnd_Floor.png", "kind": "image", "metadata": "", @@ -879,7 +808,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Side2Way_Floor.png", "kind": "image", "metadata": "", @@ -888,7 +816,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Trap14.png", "kind": "image", "metadata": "", @@ -897,7 +824,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Trap23.png", "kind": "image", "metadata": "", @@ -906,7 +832,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Trap33.png", "kind": "image", "metadata": "", @@ -915,7 +840,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Marketing/desktop-icon-512.png", "kind": "image", "metadata": "", @@ -924,7 +848,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/android-icon-192.png", "kind": "image", "metadata": "", @@ -933,7 +856,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/android-icon-144.png", "kind": "image", "metadata": "", @@ -942,7 +864,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/android-icon-96.png", "kind": "image", "metadata": "", @@ -951,7 +872,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/android-icon-72.png", "kind": "image", "metadata": "", @@ -960,7 +880,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/android-icon-48.png", "kind": "image", "metadata": "", @@ -969,7 +888,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/android-icon-36.png", "kind": "image", "metadata": "", @@ -978,7 +896,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-1024.png", "kind": "image", "metadata": "", @@ -987,7 +904,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-180.png", "kind": "image", "metadata": "", @@ -996,7 +912,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-167.png", "kind": "image", "metadata": "", @@ -1005,7 +920,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-152.png", "kind": "image", "metadata": "", @@ -1014,7 +928,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-144.png", "kind": "image", "metadata": "", @@ -1023,7 +936,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-120.png", "kind": "image", "metadata": "", @@ -1032,7 +944,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-114.png", "kind": "image", "metadata": "", @@ -1041,7 +952,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-100.png", "kind": "image", "metadata": "", @@ -1050,7 +960,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-87.png", "kind": "image", "metadata": "", @@ -1059,7 +968,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-80.png", "kind": "image", "metadata": "", @@ -1068,7 +976,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-76.png", "kind": "image", "metadata": "", @@ -1077,7 +984,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-72.png", "kind": "image", "metadata": "", @@ -1086,7 +992,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-60.png", "kind": "image", "metadata": "", @@ -1095,7 +1000,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-58.png", "kind": "image", "metadata": "", @@ -1104,7 +1008,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-57.png", "kind": "image", "metadata": "", @@ -1113,7 +1016,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-50.png", "kind": "image", "metadata": "", @@ -1122,7 +1024,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-40.png", "kind": "image", "metadata": "", @@ -1131,7 +1032,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-29.png", "kind": "image", "metadata": "", @@ -1140,7 +1040,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/ios-icon-20.png", "kind": "image", "metadata": "", @@ -1149,7 +1048,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Marketing/thumbnail.png", "kind": "image", "metadata": "", @@ -1158,7 +1056,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Spider1.png", "kind": "image", "metadata": "", @@ -1167,7 +1064,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Spider2.png", "kind": "image", "metadata": "", @@ -1176,7 +1072,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Spider3.png", "kind": "image", "metadata": "", @@ -1185,7 +1080,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Spider4.png", "kind": "image", "metadata": "", @@ -1194,7 +1088,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp1.png", "kind": "image", "metadata": "", @@ -1203,7 +1096,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp2.png", "kind": "image", "metadata": "", @@ -1212,7 +1104,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp3.png", "kind": "image", "metadata": "", @@ -1221,7 +1112,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp4.png", "kind": "image", "metadata": "", @@ -1230,7 +1120,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Gun1.png", "kind": "image", "metadata": "", @@ -1239,7 +1128,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Gun2.png", "kind": "image", "metadata": "", @@ -1417,6 +1305,7 @@ "text": "3", "font": "PTSans-Bold.ttf", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 100, "color": "255;255;255" } @@ -1476,6 +1365,7 @@ "text": "Click To Begin", "font": "PTSans-Bold.ttf", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 40, "color": "255;255;255" } @@ -1923,7 +1813,7 @@ "gridColor": 10401023, "gridAlpha": 0.8, "snap": true, - "zoomFactor": 1.354999999999997, + "zoomFactor": 1.0392375598881853, "windowMask": false }, "objectsGroups": [ @@ -2417,6 +2307,111 @@ "numberProperties": [], "stringProperties": [], "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 64, + "keepRatio": true, + "layer": "PauseLayer", + "name": "UpgradeIcons", + "persistentUuid": "ce266357-a45e-4fe2-9399-fa6e2730d946", + "width": 64, + "x": 32, + "y": 96, + "zOrder": 52, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 64, + "keepRatio": true, + "layer": "PauseLayer", + "name": "UpgradeIcons", + "persistentUuid": "cc7558dc-cc18-4bb9-8e1a-35a0bc1e936c", + "width": 64, + "x": 128, + "y": 96, + "zOrder": 52, + "numberProperties": [ + { + "name": "animation", + "value": 1 + } + ], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 64, + "keepRatio": true, + "layer": "PauseLayer", + "name": "UpgradeIcons", + "persistentUuid": "87f7ee7b-686c-4452-b4bb-593ddb043386", + "width": 64, + "x": 224, + "y": 96, + "zOrder": 52, + "numberProperties": [ + { + "name": "animation", + "value": 2 + } + ], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 64, + "keepRatio": true, + "layer": "PauseLayer", + "name": "UpgradeIcons", + "persistentUuid": "bcda33af-13ca-4431-a978-9cfbc0b89c9d", + "width": 64, + "x": 320, + "y": 96, + "zOrder": 52, + "numberProperties": [ + { + "name": "animation", + "value": 3 + } + ], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 64, + "keepRatio": true, + "layer": "PauseLayer", + "name": "UpgradeIcons", + "persistentUuid": "8fb7fafc-624d-41c1-96e9-2c0d4f9e1d15", + "width": 64, + "x": 416, + "y": 96, + "zOrder": 52, + "numberProperties": [ + { + "name": "animation", + "value": 4 + } + ], + "stringProperties": [], + "initialVariables": [] } ], "objects": [ @@ -9075,6 +9070,7 @@ "text": "Text", "font": "PTSans-Bold.ttf", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 10, "color": "255;255;255" } @@ -9121,6 +9117,7 @@ "text": "Text", "font": "PTSans-Bold.ttf", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 10, "color": "56;255;4" } @@ -9147,6 +9144,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 33, "particleBlue2": 255, + "particleColor1": "126;211;33", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": -10, "particleGreen1": 211, @@ -9192,6 +9191,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 211, "particleBlue2": 255, + "particleColor1": "143;174;211", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": -10, "particleGreen1": 174, @@ -9237,6 +9238,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 255, "particleBlue2": 255, + "particleColor1": "255;255;255", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": -10, "particleGreen1": 255, @@ -9339,6 +9342,7 @@ "text": "4 / 4", "font": "PTSans-Bold.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 22, "color": "255;255;255" } @@ -9382,6 +9386,7 @@ "text": "Text", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 20, "color": "255;255;255" } @@ -9977,6 +9982,7 @@ "text": "0", "font": "PTSans-Bold.ttf", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 22, "color": "255;255;255" } @@ -10023,6 +10029,7 @@ "text": "Total Points:", "font": "PTSans-Bold.ttf", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 22, "color": "255;255;255" } @@ -10069,6 +10076,7 @@ "text": "0", "font": "PTSans-Bold.ttf", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 22, "color": "255;255;255" } @@ -10115,6 +10123,7 @@ "text": "Danger Level:", "font": "PTSans-Bold.ttf", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 22, "color": "255;255;255" } @@ -10259,6 +10268,7 @@ "text": "3", "font": "PTSans-Bold.ttf", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 100, "color": "255;255;255" } @@ -10318,6 +10328,7 @@ "text": "Submit Score", "font": "PTSans-Bold.ttf", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 40, "color": "255;255;255" } @@ -10377,6 +10388,7 @@ "text": "Submit Score?", "font": "PTSans-Bold.ttf", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 40, "color": "255;255;255" } @@ -10436,6 +10448,7 @@ "text": "Reset?", "font": "PTSans-Bold.ttf", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 40, "color": "255;255;255" } @@ -10541,6 +10554,7 @@ "text": "Hover over upgrade to see it's effect.\n\nMove - WASD or Arrow keys\nDash - Space or Right mouse button\nShoot - Left mouse button", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 25, "color": "255;255;255" } @@ -10582,6 +10596,7 @@ "text": " ", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 25, "color": "255;255;255" } @@ -25108,9 +25123,16 @@ ], "eventsBasedObjects": [ { + "areaMaxX": 64, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, "defaultName": "ResourceBar", "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", "fullName": "Resource bar (continuous)", + "isUsingLegacyInstancesRenderer": true, "name": "PanelSpriteContinuousBar", "eventsFunctions": [ { @@ -26857,6 +26879,7 @@ "text": "2 / 3", "font": "", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 20, "color": "0;0;0" } @@ -26943,7 +26966,39 @@ "objectName": "Background" } ] - } + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [] } ] }, @@ -42873,6 +42928,5 @@ "eventsBasedObjects": [] } ], - "externalLayouts": [], - "externalSourceFiles": [] + "externalLayouts": [] } \ No newline at end of file diff --git a/examples/conviction-of-gun-dude-mobile/assets/rotate-screen-icon.png b/examples/conviction-of-gun-dude-mobile/assets/rotate-screen-icon.png new file mode 100644 index 000000000..a7726dee3 Binary files /dev/null and b/examples/conviction-of-gun-dude-mobile/assets/rotate-screen-icon.png differ diff --git a/examples/conviction-of-gun-dude-mobile/conviction-of-gun-dude-mobile.json b/examples/conviction-of-gun-dude-mobile/conviction-of-gun-dude-mobile.json index 6bcfd970a..e215b988c 100644 --- a/examples/conviction-of-gun-dude-mobile/conviction-of-gun-dude-mobile.json +++ b/examples/conviction-of-gun-dude-mobile/conviction-of-gun-dude-mobile.json @@ -1,13 +1,15 @@ { "firstLayout": "StartMenu", "gdVersion": { - "build": 99, - "major": 4, - "minor": 0, + "build": 221, + "major": 5, + "minor": 5, "revision": 0 }, "properties": { "adaptGameResolutionAtRuntime": true, + "antialiasingMode": "MSAA", + "antialisingEnabledOnMobile": false, "folderProject": false, "orientation": "landscape", "packageName": "com.example.TheConvictionOfGunDudeMobile", @@ -16,7 +18,6 @@ "scaleMode": "nearest", "sizeOnStartupMode": "adaptWidth", "templateSlug": "", - "useExternalSourceFiles": false, "version": "1.0.0", "name": "Conviction of gun dude mobile", "description": "Top down shoot'em up game with a leaderboard, randomized rooms, and upgrades.", @@ -34,6 +35,7 @@ "android-icon-48": "android-icon-48.png", "android-icon-72": "android-icon-72.png", "android-icon-96": "android-icon-96.png", + "android-windowSplashScreenAnimatedIcon": "", "desktop-icon-512": "desktop-icon-512.png", "ios-icon-100": "ios-icon-100.png", "ios-icon-1024": "ios-icon-1024.png", @@ -100,7 +102,6 @@ "resources": { "resources": [ { - "alwaysLoaded": false, "file": "assets/Player1.png", "kind": "image", "metadata": "", @@ -109,7 +110,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Player2.png", "kind": "image", "metadata": "", @@ -118,7 +118,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Player3.png", "kind": "image", "metadata": "", @@ -127,7 +126,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Player4.png", "kind": "image", "metadata": "", @@ -136,7 +134,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Ghost1.png", "kind": "image", "metadata": "", @@ -145,7 +142,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Ghost2.png", "kind": "image", "metadata": "", @@ -154,7 +150,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Ghost3.png", "kind": "image", "metadata": "", @@ -163,7 +158,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Ghost4.png", "kind": "image", "metadata": "", @@ -172,7 +166,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/GhostSquint1.png", "kind": "image", "metadata": "", @@ -181,7 +174,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/GhostSquint2.png", "kind": "image", "metadata": "", @@ -190,7 +182,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/GhostSquint3.png", "kind": "image", "metadata": "", @@ -199,7 +190,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/GhostSquint4.png", "kind": "image", "metadata": "", @@ -225,7 +215,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/WesleyDeathParticle.png", "kind": "image", "metadata": "", @@ -234,7 +223,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Room_Trap53.png", "kind": "image", "metadata": "", @@ -243,7 +231,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/HealthbarBorder.png", "kind": "image", "metadata": "", @@ -252,7 +239,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Healthbar.png", "kind": "image", "metadata": "", @@ -261,7 +247,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_4Way_Walls2.png", "kind": "image", "metadata": "", @@ -270,7 +255,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Room_Floor2.png", "kind": "image", "metadata": "", @@ -299,7 +283,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Trap54.png", "kind": "image", "metadata": "", @@ -308,7 +291,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Spider1.png", "kind": "image", "metadata": "", @@ -317,7 +299,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Spider2.png", "kind": "image", "metadata": "", @@ -326,7 +307,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Spider3.png", "kind": "image", "metadata": "", @@ -335,7 +315,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Spider4.png", "kind": "image", "metadata": "", @@ -344,7 +323,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/SpiderCharging1.png", "kind": "image", "metadata": "", @@ -353,7 +331,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/SpiderCharging2.png", "kind": "image", "metadata": "", @@ -362,7 +339,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/SpiderHurt.png", "kind": "image", "metadata": "", @@ -371,7 +347,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Bullet.png", "kind": "image", "metadata": "", @@ -380,7 +355,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/GhostOrb.png", "kind": "image", "metadata": "", @@ -389,7 +363,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Health.png", "kind": "image", "metadata": "", @@ -398,7 +371,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Armor.png", "kind": "image", "metadata": "", @@ -407,7 +379,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Power.png", "kind": "image", "metadata": "", @@ -416,7 +387,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_FireRate.png", "kind": "image", "metadata": "", @@ -425,7 +395,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Speed.png", "kind": "image", "metadata": "", @@ -434,7 +403,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Health2.png", "kind": "image", "metadata": "", @@ -443,7 +411,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Armor2.png", "kind": "image", "metadata": "", @@ -452,7 +419,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Power2.png", "kind": "image", "metadata": "", @@ -461,7 +427,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_FireRate2.png", "kind": "image", "metadata": "", @@ -470,7 +435,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Upgrade_Speed2.png", "kind": "image", "metadata": "", @@ -479,7 +443,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp1.png", "kind": "image", "metadata": "", @@ -488,7 +451,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp2.png", "kind": "image", "metadata": "", @@ -497,7 +459,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp3.png", "kind": "image", "metadata": "", @@ -506,7 +467,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp4.png", "kind": "image", "metadata": "", @@ -515,7 +475,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ImpCharging1.png", "kind": "image", "metadata": "", @@ -524,7 +483,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ImpCharging2.png", "kind": "image", "metadata": "", @@ -533,7 +491,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ImpCharging3.png", "kind": "image", "metadata": "", @@ -542,7 +499,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ImpCharging4.png", "kind": "image", "metadata": "", @@ -551,7 +507,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Room_4Way_Doors1.png", "kind": "image", "metadata": "", @@ -560,7 +515,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_4Way_Doors22.png", "kind": "image", "metadata": "", @@ -569,7 +523,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_4Way_Doors3.png", "kind": "image", "metadata": "", @@ -578,7 +531,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_4Way_Doors4.png", "kind": "image", "metadata": "", @@ -587,7 +539,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/PointOrb.png", "kind": "image", "metadata": "", @@ -596,7 +547,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/HealthOrb.png", "kind": "image", "metadata": "", @@ -615,7 +565,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Darkening.png", "kind": "image", "metadata": "", @@ -724,7 +673,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_UpDeadEnd_Walls.png", "kind": "image", "metadata": "", @@ -733,7 +681,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_DownDeadEnd_Walls.png", "kind": "image", "metadata": "", @@ -742,7 +689,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_SideTwoWay_Walls.png", "kind": "image", "metadata": "", @@ -751,7 +697,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Room_UpDeadEnd_Doors1.png", "kind": "image", "metadata": "", @@ -760,7 +705,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_UpDeadEnd_Doors2.png", "kind": "image", "metadata": "", @@ -769,7 +713,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_UpDeadEnd_Doors3.png", "kind": "image", "metadata": "", @@ -778,7 +721,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_UpDeadEnd_Doors4.png", "kind": "image", "metadata": "", @@ -787,7 +729,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_DownDeadEnd_Doors1.png", "kind": "image", "metadata": "", @@ -796,7 +737,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_DownDeadEnd_Doors2.png", "kind": "image", "metadata": "", @@ -805,7 +745,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Room_DownDeadEnd_Doors3.png", "kind": "image", "metadata": "", @@ -814,7 +753,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Room_DownDeadEnd_Doors4.png", "kind": "image", "metadata": "", @@ -823,7 +761,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Side2way_Doors1.png", "kind": "image", "metadata": "", @@ -832,7 +769,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Side2way_Doors2.png", "kind": "image", "metadata": "", @@ -841,7 +777,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Side2way_Doors3.png", "kind": "image", "metadata": "", @@ -850,7 +785,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Side2way_Doors4.png", "kind": "image", "metadata": "", @@ -859,7 +793,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_UpDeadEnd_Floor.png", "kind": "image", "metadata": "", @@ -868,7 +801,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Room_DownDeadEnd_Floor.png", "kind": "image", "metadata": "", @@ -877,7 +809,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Side2Way_Floor.png", "kind": "image", "metadata": "", @@ -886,7 +817,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Trap14.png", "kind": "image", "metadata": "", @@ -895,7 +825,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Trap23.png", "kind": "image", "metadata": "", @@ -904,7 +833,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Room_Trap33.png", "kind": "image", "metadata": "", @@ -913,7 +841,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/desktop-icon-512.png", "kind": "image", "metadata": "", @@ -922,7 +849,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/android-icon-192.png", "kind": "image", "metadata": "", @@ -931,7 +857,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/android-icon-144.png", "kind": "image", "metadata": "", @@ -940,7 +865,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/android-icon-96.png", "kind": "image", "metadata": "", @@ -949,7 +873,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/android-icon-72.png", "kind": "image", "metadata": "", @@ -958,7 +881,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/android-icon-48.png", "kind": "image", "metadata": "", @@ -967,7 +889,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/android-icon-36.png", "kind": "image", "metadata": "", @@ -976,7 +897,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-1024.png", "kind": "image", "metadata": "", @@ -985,7 +905,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-180.png", "kind": "image", "metadata": "", @@ -994,7 +913,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-167.png", "kind": "image", "metadata": "", @@ -1003,7 +921,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-152.png", "kind": "image", "metadata": "", @@ -1012,7 +929,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-144.png", "kind": "image", "metadata": "", @@ -1021,7 +937,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-120.png", "kind": "image", "metadata": "", @@ -1030,7 +945,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-114.png", "kind": "image", "metadata": "", @@ -1039,7 +953,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-100.png", "kind": "image", "metadata": "", @@ -1048,7 +961,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-87.png", "kind": "image", "metadata": "", @@ -1057,7 +969,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-80.png", "kind": "image", "metadata": "", @@ -1066,7 +977,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-76.png", "kind": "image", "metadata": "", @@ -1075,7 +985,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-72.png", "kind": "image", "metadata": "", @@ -1084,7 +993,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-60.png", "kind": "image", "metadata": "", @@ -1093,7 +1001,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-58.png", "kind": "image", "metadata": "", @@ -1102,7 +1009,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-57.png", "kind": "image", "metadata": "", @@ -1111,7 +1017,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-50.png", "kind": "image", "metadata": "", @@ -1120,7 +1025,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-40.png", "kind": "image", "metadata": "", @@ -1129,7 +1033,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-29.png", "kind": "image", "metadata": "", @@ -1138,7 +1041,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ios-icon-20.png", "kind": "image", "metadata": "", @@ -1147,7 +1049,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "thumbnail.png", "kind": "image", "metadata": "", @@ -1156,7 +1057,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Spider12.png", "kind": "image", "metadata": "", @@ -1165,7 +1065,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Spider22.png", "kind": "image", "metadata": "", @@ -1174,7 +1073,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Spider32.png", "kind": "image", "metadata": "", @@ -1183,7 +1081,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Spider42.png", "kind": "image", "metadata": "", @@ -1192,7 +1089,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp12.png", "kind": "image", "metadata": "", @@ -1201,7 +1097,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp22.png", "kind": "image", "metadata": "", @@ -1210,7 +1105,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp32.png", "kind": "image", "metadata": "", @@ -1219,7 +1113,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Imp42.png", "kind": "image", "metadata": "", @@ -1228,7 +1121,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Gun1.png", "kind": "image", "metadata": "", @@ -1237,7 +1129,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Gun2.png", "kind": "image", "metadata": "", @@ -1246,7 +1137,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/HelpIcon-1.png", "kind": "image", "metadata": "", @@ -1255,7 +1145,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/MobileCovering-1.png", "kind": "image", "metadata": "", @@ -1264,7 +1153,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Round_Joystick_Thumb.png", "kind": "image", "metadata": "", @@ -1273,7 +1161,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Round_Joystick_Border.png", "kind": "image", "metadata": "", @@ -1282,7 +1169,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Healthbar.png", "kind": "image", "metadata": "", @@ -1291,18 +1177,32 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/HealthbarBorder.png", "kind": "image", "metadata": "", "name": "assets\\HealthbarBorder.png", "smoothed": false, "userAdded": true + }, + { + "file": "assets/rotate-screen-icon.png", + "kind": "image", + "metadata": "", + "name": "rotate-screen-icon.png", + "smoothed": false, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Mobile Layouts/assets/6a8102ce3340bf9f62300ee1a81ef0b2327b2c6e8d62d7dda68d547f5e2b5969_rotate-screen-icon.png", + "name": "rotate-screen-icon.png" + } } ], "resourceFolders": [] }, "objects": [], + "objectsFolderStructure": { + "folderName": "__ROOT" + }, "objectsGroups": [], "variables": [], "layouts": [ @@ -1417,7 +1317,6 @@ "italic": false, "name": "Reset_Timer", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -1449,6 +1348,27 @@ "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": "3", + "font": "PTSans-Bold.ttf", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 100, + "color": "255;255;255" } }, { @@ -1457,7 +1377,6 @@ "italic": false, "name": "Reset_Button", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -1489,9 +1408,41 @@ "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": "Tap To Begin", + "font": "PTSans-Bold.ttf", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 40, + "color": "255;255;255" } } ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Reset_Timer" + }, + { + "objectName": "Reset_Button" + } + ] + }, "events": [ { "colorB": 228, @@ -1573,8 +1524,7 @@ "textG": 0, "textR": 0 }, - "comment": "Click anywhere on scene to delete the reset button to start the timer.", - "comment2": "" + "comment": "Click anywhere on scene to delete the reset button to start the timer." }, { "type": "BuiltinCommonInstructions::Standard", @@ -1648,8 +1598,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the reset button is deleted, start a timer to countdown for the scene transition.", - "comment2": "" + "comment": "If the reset button is deleted, start a timer to countdown for the scene transition." }, { "type": "BuiltinCommonInstructions::Standard", @@ -1870,9 +1819,15 @@ "ambientLightColorB": 32, "ambientLightColorG": 0, "ambientLightColorR": 0, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", "followBaseLayerCamera": false, "isLightingLayer": false, + "isLocked": false, "name": "", + "renderingType": "", "visibility": true, "cameras": [ { @@ -1916,7 +1871,7 @@ "gridColor": 10401023, "gridAlpha": 0.8, "snap": true, - "zoomFactor": 1.169999999999991, + "zoomFactor": 0.8973490369514181, "windowMask": false }, "objectsGroups": [ @@ -2398,14 +2353,15 @@ }, { "angle": 0, - "customSize": false, - "height": 0, + "customSize": true, + "depth": 0, + "height": 68, "layer": "UI", "name": "HelpIcon", "persistentUuid": "7163d9a4-e47a-4e40-a425-6c4072908f4d", - "width": 0, - "x": 718, - "y": 14, + "width": 68, + "x": 684, + "y": 16, "zOrder": 50, "numberProperties": [], "stringProperties": [], @@ -2445,7 +2401,7 @@ "angle": 0, "customSize": false, "height": 0, - "layer": "UI", + "layer": "MobileControls", "name": "MovementJoystick", "persistentUuid": "16f76df3-5035-4b87-950d-5128c3f6e49b", "width": 0, @@ -2460,7 +2416,7 @@ "angle": 0, "customSize": false, "height": 0, - "layer": "UI", + "layer": "MobileControls", "name": "AimingJoystick", "persistentUuid": "c56669b1-4a73-40bd-836e-16852193c57a", "width": 0, @@ -2470,13 +2426,151 @@ "numberProperties": [], "stringProperties": [], "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 64, + "keepRatio": true, + "layer": "PauseLayer", + "name": "UpgradeIcons", + "persistentUuid": "bab10747-49f4-4573-b771-8bfb05434216", + "width": 64, + "x": 144, + "y": 240, + "zOrder": 52, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 64, + "keepRatio": true, + "layer": "PauseLayer", + "name": "UpgradeIcons", + "persistentUuid": "16b43862-de0e-4982-9712-e28407716467", + "width": 64, + "x": 240, + "y": 240, + "zOrder": 52, + "numberProperties": [ + { + "name": "animation", + "value": 1 + } + ], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 64, + "keepRatio": true, + "layer": "PauseLayer", + "name": "UpgradeIcons", + "persistentUuid": "43edf832-b65e-43ff-837e-f7348509cdd7", + "width": 64, + "x": 336, + "y": 240, + "zOrder": 52, + "numberProperties": [ + { + "name": "animation", + "value": 2 + } + ], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 64, + "keepRatio": true, + "layer": "PauseLayer", + "name": "UpgradeIcons", + "persistentUuid": "524ea4b6-49d3-4d56-bae9-ef48ffaa2a54", + "width": 64, + "x": 432, + "y": 240, + "zOrder": 52, + "numberProperties": [ + { + "name": "animation", + "value": 3 + } + ], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 64, + "keepRatio": true, + "layer": "PauseLayer", + "name": "UpgradeIcons", + "persistentUuid": "4f9909bd-7df3-435d-a092-6e1a4b9cf076", + "width": 64, + "x": 528, + "y": 240, + "zOrder": 52, + "numberProperties": [ + { + "name": "animation", + "value": 4 + } + ], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "ScreenOrientationChecker", + "persistentUuid": "230366da-5d3a-43f5-9cf6-51af9c2a20a1", + "width": 0, + "x": 0, + "y": 0, + "zOrder": 57, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 432, + "keepRatio": true, + "layer": "MobileControls", + "name": "ScreenOrientationChecker", + "persistentUuid": "95d286f0-6c7a-4970-ad70-93753676dac6", + "width": 768, + "x": 0, + "y": 0, + "zOrder": 58, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] } ], "objects": [ { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "RoomTraps", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -2822,9 +2916,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "RoomDoors", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -3896,9 +3990,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "RoomFloor", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -4774,9 +4868,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Room", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -5598,9 +5692,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Wesley", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -5986,9 +6080,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Gun", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [], @@ -6033,7 +6127,8 @@ }, { "name": "ShakeObject_PositionAngleScale", - "type": "ShakeObject::ShakeObject_PositionAngleScale" + "type": "ShakeObject::ShakeObject_PositionAngleScale", + "Scale": "Scale" } ], "animations": [ @@ -6098,9 +6193,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Imp", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -6128,7 +6223,8 @@ }, { "name": "ShakeObject_PositionAngleScale", - "type": "ShakeObject::ShakeObject_PositionAngleScale" + "type": "ShakeObject::ShakeObject_PositionAngleScale", + "Scale": "Scale" } ], "animations": [ @@ -7171,9 +7267,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Spider", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -7201,7 +7297,8 @@ }, { "name": "ShakeObject_PositionAngleScale", - "type": "ShakeObject::ShakeObject_PositionAngleScale" + "type": "ShakeObject::ShakeObject_PositionAngleScale", + "Scale": "Scale" } ], "animations": [ @@ -8096,9 +8193,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Ghost", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -8126,7 +8223,8 @@ }, { "name": "ShakeObject_PositionAngleScale", - "type": "ShakeObject::ShakeObject_PositionAngleScale" + "type": "ShakeObject::ShakeObject_PositionAngleScale", + "Scale": "Scale" } ], "animations": [ @@ -8895,9 +8993,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "GhostOrb", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [], @@ -8981,9 +9079,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Bullet", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [], @@ -9059,7 +9157,6 @@ "italic": false, "name": "UpgradeText", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -9073,6 +9170,27 @@ "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": "Text", + "font": "PTSans-Bold.ttf", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 10, + "color": "255;255;255" } }, { @@ -9081,7 +9199,6 @@ "italic": false, "name": "EnemyDamageText", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -9095,6 +9212,27 @@ "b": 4, "g": 255, "r": 56 + }, + "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": "PTSans-Bold.ttf", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 10, + "color": "56;255;4" } }, { @@ -9106,6 +9244,7 @@ "emitterForceMax": 0, "emitterForceMin": 0, "flow": 50, + "jumpForwardInTimeOnCreation": 0, "maxParticleNb": 300, "name": "Particle_RecoilDust", "particleAlpha1": 150, @@ -9118,6 +9257,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 33, "particleBlue2": 255, + "particleColor1": "126;211;33", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": -10, "particleGreen1": 211, @@ -9133,7 +9274,6 @@ "rendererParam1": 2, "rendererParam2": 1, "rendererType": "Point", - "tags": "", "tank": 2, "textureParticleName": "", "type": "ParticleSystem::ParticleEmitter", @@ -9151,6 +9291,7 @@ "emitterForceMax": 0, "emitterForceMin": 0, "flow": 50, + "jumpForwardInTimeOnCreation": 0, "maxParticleNb": 300, "name": "Particle_Dash", "particleAlpha1": 150, @@ -9163,6 +9304,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 211, "particleBlue2": 255, + "particleColor1": "143;174;211", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": -10, "particleGreen1": 174, @@ -9178,7 +9321,6 @@ "rendererParam1": 3, "rendererParam2": 1, "rendererType": "Point", - "tags": "", "tank": 12, "textureParticleName": "", "type": "ParticleSystem::ParticleEmitter", @@ -9196,6 +9338,7 @@ "emitterForceMax": 0, "emitterForceMin": 0, "flow": 45, + "jumpForwardInTimeOnCreation": 0, "maxParticleNb": 300, "name": "Particle_Death", "particleAlpha1": 255, @@ -9208,6 +9351,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 255, "particleBlue2": 255, + "particleColor1": "255;255;255", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": -10, "particleGreen1": 255, @@ -9223,7 +9368,6 @@ "rendererParam1": 3, "rendererParam2": 1, "rendererType": "Quad", - "tags": "", "tank": 1, "textureParticleName": "WesleyDeathParticle.png", "type": "ParticleSystem::ParticleEmitter", @@ -9235,11 +9379,15 @@ { "assetStoreId": "3d6c54e76a9a06cbd7629c1e78388d4ab808bbf36d644c61d6a14c9ad34d4f89", "name": "HealthBar", - "tags": "", "type": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "variables": [], "effects": [], - "behaviors": [], + "behaviors": [ + { + "name": "ShakeObject_PositionAngle", + "type": "ShakeObject::ShakeObject_PositionAngle" + } + ], "content": { "PreviousHighValueDuration": 0, "ShowLabel": true, @@ -9294,6 +9442,27 @@ "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": "6 / 6", + "font": "PTSans-Bold.ttf", + "textAlignment": "center", + "verticalTextAlignment": "top", + "characterSize": 22, + "color": "255;255;255" } } } @@ -9304,7 +9473,6 @@ "italic": false, "name": "Debug", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -9318,12 +9486,33 @@ "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": "Text", + "font": "", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 20, + "color": "255;255;255" } }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "UpgradeIcons", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [], @@ -9344,7 +9533,8 @@ "behaviors": [ { "name": "ShakeObject_PositionAngleScale", - "type": "ShakeObject::ShakeObject_PositionAngleScale" + "type": "ShakeObject::ShakeObject_PositionAngleScale", + "Scale": "Scale" } ], "animations": [ @@ -9591,9 +9781,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Upgrades", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [], @@ -9623,7 +9813,8 @@ "behaviors": [ { "name": "ShakeObject_PositionAngleScale", - "type": "ShakeObject::ShakeObject_PositionAngleScale" + "type": "ShakeObject::ShakeObject_PositionAngleScale", + "Scale": "Scale" } ], "animations": [ @@ -9875,7 +10066,6 @@ "italic": false, "name": "TotalPointsCount", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -9894,6 +10084,27 @@ "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": "0", + "font": "PTSans-Bold.ttf", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 22, + "color": "255;255;255" } }, { @@ -9902,7 +10113,6 @@ "italic": false, "name": "TotalPoints", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -9921,6 +10131,27 @@ "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": "Total Points:", + "font": "PTSans-Bold.ttf", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 22, + "color": "255;255;255" } }, { @@ -9929,7 +10160,6 @@ "italic": false, "name": "DangerLevelCount", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -9948,6 +10178,27 @@ "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": "0", + "font": "PTSans-Bold.ttf", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 22, + "color": "255;255;255" } }, { @@ -9956,7 +10207,6 @@ "italic": false, "name": "DangerLevel", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -9975,12 +10225,33 @@ "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": "Danger Level:", + "font": "PTSans-Bold.ttf", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 22, + "color": "255;255;255" } }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Pick_Ups", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [], @@ -10068,7 +10339,6 @@ "italic": false, "name": "Reset_Timer", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -10100,6 +10370,27 @@ "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": "3", + "font": "PTSans-Bold.ttf", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 100, + "color": "255;255;255" } }, { @@ -10108,7 +10399,6 @@ "italic": true, "name": "Leaderboard_Submit", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -10140,6 +10430,27 @@ "b": 255, "g": 255, "r": 255 + }, + "content": { + "bold": true, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": true, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Submit Score", + "font": "PTSans-Bold.ttf", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 40, + "color": "255;255;255" } }, { @@ -10148,7 +10459,6 @@ "italic": true, "name": "Reset_Leaderboard", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -10180,6 +10490,27 @@ "b": 255, "g": 255, "r": 255 + }, + "content": { + "bold": true, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": true, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Submit Score?", + "font": "PTSans-Bold.ttf", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 40, + "color": "255;255;255" } }, { @@ -10188,7 +10519,6 @@ "italic": false, "name": "Reset_Button", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -10220,12 +10550,33 @@ "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": "Reset?", + "font": "PTSans-Bold.ttf", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 40, + "color": "255;255;255" } }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Darkening", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [], @@ -10266,7 +10617,6 @@ { "assetStoreId": "", "name": "LeaderboardName_Input", - "tags": "", "type": "TextInput::TextInputObject", "variables": [], "effects": [], @@ -10293,7 +10643,6 @@ "italic": false, "name": "Pause_Text", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -10307,6 +10656,27 @@ "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": "Touch upgrade to see it's effect.\n", + "font": "", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 25, + "color": "255;255;255" } }, { @@ -10315,7 +10685,6 @@ "italic": false, "name": "Upgrade_Text", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -10329,12 +10698,33 @@ "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": " ", + "font": "", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 25, + "color": "255;255;255" } }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "HelpIcon", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [], @@ -10349,6 +10739,16 @@ "rightEdgeAnchor": 2, "topEdgeAnchor": 0, "useLegacyBottomAndRightAnchors": false + }, + { + "name": "ButtonFSM", + "type": "ButtonStates::ButtonFSM", + "ShouldCheckHovering": true, + "State": "Idle", + "TouchId": 0, + "TouchIsInside": false, + "MouseIsInside": false, + "Index": 2.0247e-320 } ], "animations": [ @@ -10384,9 +10784,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "MobileCovering", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [], @@ -10427,7 +10827,6 @@ { "assetStoreId": "", "name": "MovementJoystick", - "tags": "", "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "variables": [], "effects": [], @@ -10435,6 +10834,7 @@ "content": {}, "childrenContent": { "Border": { + "adaptCollisionMaskAutomatically": false, "updateIfNotVisible": false, "animations": [ { @@ -10469,6 +10869,7 @@ ] }, "Thumb": { + "adaptCollisionMaskAutomatically": false, "updateIfNotVisible": false, "animations": [ { @@ -10507,7 +10908,6 @@ { "assetStoreId": "", "name": "AimingJoystick", - "tags": "", "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "variables": [], "effects": [], @@ -10528,6 +10928,7 @@ }, "childrenContent": { "Border": { + "adaptCollisionMaskAutomatically": false, "updateIfNotVisible": false, "animations": [ { @@ -10562,6 +10963,7 @@ ] }, "Thumb": { + "adaptCollisionMaskAutomatically": false, "updateIfNotVisible": false, "animations": [ { @@ -10596,8 +10998,277 @@ ] } } + }, + { + "assetStoreId": "e5919fb86a559b00001678c710efe55f4e9f2e032a9ff9610087370f998d57de", + "name": "ScreenOrientationChecker", + "type": "ScreenOrientationChecker::ScreenOrientationChecker", + "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 + }, + "childrenContent": { + "BackgroundPainter": { + "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 + } + }, + "Icon": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "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 + } + ] + ] + } + ] + } + ] + } + ] + }, + "Text": { + "bold": true, + "italic": false, + "smoothed": true, + "underlined": false, + "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, + "color": "255;255;255" + } + } + } } ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "folderName": "Background", + "children": [ + { + "objectName": "Room" + }, + { + "objectName": "RoomFloor" + }, + { + "objectName": "RoomDoors" + }, + { + "objectName": "RoomTraps" + } + ] + }, + { + "folderName": "VFX", + "children": [ + { + "objectName": "EnemyDamageText" + }, + { + "objectName": "Particle_RecoilDust" + }, + { + "objectName": "Particle_Dash" + }, + { + "objectName": "Particle_Death" + }, + { + "objectName": "Darkening" + } + ] + }, + { + "folderName": "UI", + "children": [ + { + "objectName": "MovementJoystick" + }, + { + "objectName": "AimingJoystick" + }, + { + "objectName": "ScreenOrientationChecker" + }, + { + "objectName": "MobileCovering" + }, + { + "objectName": "HelpIcon" + }, + { + "objectName": "UpgradeIcons" + }, + { + "objectName": "HealthBar" + }, + { + "objectName": "UpgradeText" + }, + { + "objectName": "Debug" + }, + { + "objectName": "TotalPointsCount" + }, + { + "objectName": "TotalPoints" + }, + { + "objectName": "DangerLevelCount" + }, + { + "objectName": "DangerLevel" + }, + { + "objectName": "Reset_Timer" + }, + { + "objectName": "Leaderboard_Submit" + }, + { + "objectName": "Reset_Leaderboard" + }, + { + "objectName": "Reset_Button" + }, + { + "objectName": "LeaderboardName_Input" + }, + { + "objectName": "Pause_Text" + }, + { + "objectName": "Upgrade_Text" + } + ] + }, + { + "objectName": "Wesley" + }, + { + "objectName": "Gun" + }, + { + "objectName": "Imp" + }, + { + "objectName": "Spider" + }, + { + "objectName": "Ghost" + }, + { + "objectName": "GhostOrb" + }, + { + "objectName": "Bullet" + }, + { + "objectName": "Pick_Ups" + }, + { + "objectName": "Upgrades" + } + ] + }, "events": [ { "colorB": 228, @@ -10656,8 +11327,7 @@ "textG": 0, "textR": 0 }, - "comment": "When level starts, create 3 upgrade objects.", - "comment2": "" + "comment": "When level starts, create 3 upgrade objects." }, { "type": "BuiltinCommonInstructions::Standard", @@ -10711,8 +11381,7 @@ "textG": 0, "textR": 0 }, - "comment": "Randomize the animation of, and apply effects to, each instance of the upgrade object.", - "comment2": "" + "comment": "Randomize the animation of, and apply effects to, each instance of the upgrade object." }, { "type": "BuiltinCommonInstructions::ForEach", @@ -10767,6 +11436,130 @@ ] } ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "MovementJoystick" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "AimingJoystick" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "MovementJoystick", + "", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "AimingJoystick", + "", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GlobalVariableAsBoolean" + }, + "parameters": [ + "PauseGameToggle", + "False" + ] + }, + { + "type": { + "inverted": true, + "value": "ButtonStates::ButtonFSM::IsPressed" + }, + "parameters": [ + "HelpIcon", + "ButtonFSM", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "MovementJoystick", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "MovementJoystick", + "CursorX(\"UI\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "AimingJoystick", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "AimingJoystick", + "CursorX(\"UI\")" + ] + } + ] } ] }, @@ -10780,8 +11573,7 @@ "textG": 0, "textR": 0 }, - "comment": "When the player picks one of the upgrades, delete the other instances of the upgrade object.", - "comment2": "" + "comment": "When the player picks one of the upgrades, delete the other instances of the upgrade object." }, { "type": "BuiltinCommonInstructions::Standard", @@ -10831,8 +11623,7 @@ "textG": 0, "textR": 0 }, - "comment": "Zoom and position camera of base layer to be align properly at the beginning of the scene.", - "comment2": "" + "comment": "Zoom and position camera of base layer to be align properly at the beginning of the scene." }, { "type": "BuiltinCommonInstructions::Standard", @@ -10923,8 +11714,7 @@ "textG": 0, "textR": 0 }, - "comment": "Mobile covering centered on the screen", - "comment2": "" + "comment": "Mobile covering centered on the screen" }, { "type": "BuiltinCommonInstructions::Standard", @@ -10954,8 +11744,7 @@ "textG": 0, "textR": 0 }, - "comment": "Lerp camera to new room if player still exists and a new room is spawned.", - "comment2": "" + "comment": "Lerp camera to new room if player still exists and a new room is spawned." }, { "type": "BuiltinCommonInstructions::Standard", @@ -11019,8 +11808,7 @@ "textG": 0, "textR": 0 }, - "comment": "If time is slowed to 0.05 for the room transitions, and when the camera gets within 5 pixels of the center of the new room, give player control back and set time scale to 1.(default)", - "comment2": "" + "comment": "If time is slowed to 0.05 for the room transitions, and when the camera gets within 5 pixels of the center of the new room, give player control back and set time scale to 1.(default)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -11081,8 +11869,7 @@ "textG": 0, "textR": 0 }, - "comment": "While the camera transitions from the old room to the new one, apply a force to the player so they continue moving in to the room.", - "comment2": "" + "comment": "While the camera transitions from the old room to the new one, apply a force to the player so they continue moving in to the room." }, { "type": "BuiltinCommonInstructions::Standard", @@ -11110,8 +11897,7 @@ "textG": 255, "textR": 255 }, - "comment": "Walk during transitioning - Direction variable set when a new room is created by the player walking through a doorway.", - "comment2": "" + "comment": "Walk during transitioning - Direction variable set when a new room is created by the player walking through a doorway." }, { "type": "BuiltinCommonInstructions::Standard", @@ -11253,8 +12039,7 @@ "textG": 0, "textR": 0 }, - "comment": "Room Spawning - When the player walks off the floor object they're currently on, they trigger this event.", - "comment2": "" + "comment": "Room Spawning - When the player walks off the floor object they're currently on, they trigger this event." }, { "type": "BuiltinCommonInstructions::Standard", @@ -11331,8 +12116,7 @@ "textG": 0, "textR": 0 }, - "comment": "Going Upwards - Player enters the top doorway.", - "comment2": "" + "comment": "Going Upwards - Player enters the top doorway." }, { "type": "BuiltinCommonInstructions::Standard", @@ -11402,8 +12186,7 @@ "textG": 0, "textR": 0 }, - "comment": "Going Down - Player enters the bottom doorway.", - "comment2": "" + "comment": "Going Down - Player enters the bottom doorway." }, { "type": "BuiltinCommonInstructions::Standard", @@ -11473,8 +12256,7 @@ "textG": 0, "textR": 0 }, - "comment": "Going Left - Player enters the left doorway.", - "comment2": "" + "comment": "Going Left - Player enters the left doorway." }, { "type": "BuiltinCommonInstructions::Standard", @@ -11544,8 +12326,7 @@ "textG": 0, "textR": 0 }, - "comment": "Going Right - Player enters the right doorway.", - "comment2": "" + "comment": "Going Right - Player enters the right doorway." }, { "type": "BuiltinCommonInstructions::Standard", @@ -11615,8 +12396,7 @@ "textG": 0, "textR": 0 }, - "comment": "Create the set of room objects at the new point relative to the old room you were leaving.", - "comment2": "" + "comment": "Create the set of room objects at the new point relative to the old room you were leaving." }, { "type": "BuiltinCommonInstructions::Standard", @@ -11712,8 +12492,7 @@ "textG": 255, "textR": 255 }, - "comment": "Room Animation Picks - Randomized the room animation to pick a different room, then the doors and floor pick the same animation number.", - "comment2": "" + "comment": "Room Animation Picks - Randomized the room animation to pick a different room, then the doors and floor pick the same animation number." }, { "type": "BuiltinCommonInstructions::Standard", @@ -11773,8 +12552,7 @@ "textG": 255, "textR": 255 }, - "comment": "Upgrade spawning - If one of the 2 blank rooms are picked instead of traps, create an upgrade object in the middle of the room, and apply effects.", - "comment2": "" + "comment": "Upgrade spawning - If one of the 2 blank rooms are picked instead of traps, create an upgrade object in the middle of the room, and apply effects." }, { "type": "BuiltinCommonInstructions::Standard", @@ -11872,8 +12650,7 @@ "textG": 255, "textR": 255 }, - "comment": "Walk up variable being set, and stopping any dash - and returning the topdown behavior. (resetting a dash)", - "comment2": "" + "comment": "Walk up variable being set, and stopping any dash - and returning the topdown behavior. (resetting a dash)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -11911,8 +12688,7 @@ "textG": 0, "textR": 0 }, - "comment": "Enemy spawning - Pick all existing rooms, and then pick the new nearest floor to pick the new room. Then, if the player is alive, create enemy object at random points base on danger level variable.", - "comment2": "" + "comment": "Enemy spawning - Pick all existing rooms, and then pick the new nearest floor to pick the new room. Then, if the player is alive, create enemy object at random points base on danger level variable." }, { "type": "BuiltinCommonInstructions::Standard", @@ -11960,8 +12736,7 @@ "textG": 255, "textR": 255 }, - "comment": "Danger level 0-2 - Spawning just basic ghost enemies.", - "comment2": "" + "comment": "Danger level 0-2 - Spawning just basic ghost enemies." }, { "type": "BuiltinCommonInstructions::Standard", @@ -12090,8 +12865,7 @@ "textG": 255, "textR": 255 }, - "comment": "Danger level 3-6 - Spawning spiders and ghosts together.", - "comment2": "" + "comment": "Danger level 3-6 - Spawning spiders and ghosts together." }, { "type": "BuiltinCommonInstructions::Standard", @@ -12285,8 +13059,7 @@ "textG": 255, "textR": 255 }, - "comment": "Danger level 7-10+ - Spawning imps, spiders, and ghosts together.", - "comment2": "" + "comment": "Danger level 7-10+ - Spawning imps, spiders, and ghosts together." }, { "type": "BuiltinCommonInstructions::Standard", @@ -12462,8 +13235,7 @@ "textG": 255, "textR": 255 }, - "comment": "Setting enemy health, multiplying their base health with the current rounded danger level.(Rounded to get Integers)", - "comment2": "" + "comment": "Setting enemy health, multiplying their base health with the current rounded danger level.(Rounded to get Integers)" }, { "type": "BuiltinCommonInstructions::ForEach", @@ -12495,8 +13267,7 @@ "textG": 0, "textR": 0 }, - "comment": "When a new room is created change the time scale during the transition.", - "comment2": "" + "comment": "When a new room is created change the time scale during the transition." }, { "type": "BuiltinCommonInstructions::Standard", @@ -12536,8 +13307,7 @@ "textG": 0, "textR": 0 }, - "comment": "Room Deleting- when you get a specified distance away from a Room, Roomfloor, or Roomtraps object - Delete that object.\n\nThis is both for performance, and to create a \"shifting maze\" effect, where there is no set level for the player to learn.", - "comment2": "" + "comment": "Room Deleting- when you get a specified distance away from a Room, Roomfloor, or Roomtraps object - Delete that object.\n\nThis is both for performance, and to create a \"shifting maze\" effect, where there is no set level for the player to learn." }, { "type": "BuiltinCommonInstructions::Standard", @@ -12765,8 +13535,7 @@ "textG": 0, "textR": 0 }, - "comment": "RoomDoors - When there are no enemies left on the map, set opacity to fade, and when the opacity hits 0, delete the room doors object.", - "comment2": "" + "comment": "RoomDoors - When there are no enemies left on the map, set opacity to fade, and when the opacity hits 0, delete the room doors object." }, { "type": "BuiltinCommonInstructions::Standard", @@ -12852,8 +13621,7 @@ "textG": 0, "textR": 0 }, - "comment": "Setting the z-order of all objects in the \"Entities\" object group to be equal to their Y position. Creating the fake depth of the top down game.", - "comment2": "" + "comment": "Setting the z-order of all objects in the \"Entities\" object group to be equal to their Y position. Creating the fake depth of the top down game." }, { "type": "BuiltinCommonInstructions::ForEach", @@ -12882,8 +13650,7 @@ "textG": 0, "textR": 0 }, - "comment": "Setting the z-order of the player's gun to always be +1 above the player. So the gun stays in front of the player as the player's z-order shifts as they move around the scene.", - "comment2": "" + "comment": "Setting the z-order of the player's gun to always be +1 above the player. So the gun stays in front of the player as the player's z-order shifts as they move around the scene." }, { "type": "BuiltinCommonInstructions::Standard", @@ -12911,8 +13678,7 @@ "textG": 0, "textR": 0 }, - "comment": "Setting the z-order of all RoomFloor objects to be -3000 of their Y position. This is so the floor stays below all other object in the room.", - "comment2": "" + "comment": "Setting the z-order of all RoomFloor objects to be -3000 of their Y position. This is so the floor stays below all other object in the room." }, { "type": "BuiltinCommonInstructions::ForEach", @@ -12941,8 +13707,7 @@ "textG": 0, "textR": 0 }, - "comment": "Setting the z-order of the RoomTraps, again set well below their y position, to keep them below objects in the room.", - "comment2": "" + "comment": "Setting the z-order of the RoomTraps, again set well below their y position, to keep them below objects in the room." }, { "type": "BuiltinCommonInstructions::ForEach", @@ -12983,8 +13748,7 @@ "textG": 0, "textR": 0 }, - "comment": "Separate the player from the Room and RoomDoors so they can't leave the space they're in.", - "comment2": "" + "comment": "Separate the player from the Room and RoomDoors so they can't leave the space they're in." }, { "type": "BuiltinCommonInstructions::Standard", @@ -13022,8 +13786,7 @@ "textG": 0, "textR": 0 }, - "comment": "Position the player's gun to be at the \"GunSpot\" point set on the player object. And to rotate toward the mouse.", - "comment2": "" + "comment": "Position the player's gun to be at the \"GunSpot\" point set on the player object. And to rotate toward the mouse." }, { "type": "BuiltinCommonInstructions::Standard", @@ -13062,8 +13825,7 @@ "textG": 0, "textR": 0 }, - "comment": "When the player object gets within 80 pixels of a PickUp object(score/health), the object has a force applied to move it towards the player.", - "comment2": "" + "comment": "When the player object gets within 80 pixels of a PickUp object(score/health), the object has a force applied to move it towards the player." }, { "type": "BuiltinCommonInstructions::Standard", @@ -13105,8 +13867,7 @@ "textG": 255, "textR": 255 }, - "comment": "Upon getting within 10 pixels of the player, the object is considered picked up. A sound is played, and a pitch variable increase, the next pick up will trigger using this new pitch variable.", - "comment2": "" + "comment": "Upon getting within 10 pixels of the player, the object is considered picked up. A sound is played, and a pitch variable increase, the next pick up will trigger using this new pitch variable." }, { "type": "BuiltinCommonInstructions::Standard", @@ -13159,8 +13920,7 @@ "textG": 255, "textR": 255 }, - "comment": "If the object has the \"HealthOrb\" animation set, it'll delete and heal the player object for a percentage of their max health.", - "comment2": "" + "comment": "If the object has the \"HealthOrb\" animation set, it'll delete and heal the player object for a percentage of their max health." }, { "type": "BuiltinCommonInstructions::Standard", @@ -13265,8 +14025,7 @@ "textG": 255, "textR": 255 }, - "comment": "If the object has the \"PointOrb\" animation set, it'll delete and add 1 point to the PointCount scene variable.", - "comment2": "" + "comment": "If the object has the \"PointOrb\" animation set, it'll delete and add 1 point to the PointCount scene variable." }, { "type": "BuiltinCommonInstructions::Standard", @@ -13343,8 +14102,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the player goes 1 full second without picking up a PickUp object, the pitch variable is returned to 1.(default)", - "comment2": "" + "comment": "If the player goes 1 full second without picking up a PickUp object, the pitch variable is returned to 1.(default)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -13406,8 +14164,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the player is in collision with an upgrade object, it applies an effect based on the animation the object had, and then deletes it. Afterward it creates an UpgradeIcons object at a position below the health bar, using the latest created UpgradeIcons to know where to place the next upgrade.", - "comment2": "" + "comment": "If the player is in collision with an upgrade object, it applies an effect based on the animation the object had, and then deletes it. Afterward it creates an UpgradeIcons object at a position below the health bar, using the latest created UpgradeIcons to know where to place the next upgrade." }, { "type": "BuiltinCommonInstructions::Standard", @@ -13450,8 +14207,7 @@ "textG": 255, "textR": 255 }, - "comment": "Health - Adds 3 to the CharacterStats.Health scene variable. (Which changes the maximum amount HealthOrb PickUp objects can health to)", - "comment2": "" + "comment": "Health - Adds 3 to the CharacterStats.Health scene variable. (Which changes the maximum amount HealthOrb PickUp objects can health to)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -13500,8 +14256,7 @@ "textG": 255, "textR": 255 }, - "comment": "Armor - Adds 2 to the CharacterStats.Defense scene variable. (Which is used when a GhostOrb collides with the player)", - "comment2": "" + "comment": "Armor - Adds 2 to the CharacterStats.Defense scene variable. (Which is used when a GhostOrb collides with the player)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -13539,8 +14294,7 @@ "textG": 255, "textR": 255 }, - "comment": "FireRate - Multiplies the fire cooldown by 0.85.", - "comment2": "" + "comment": "FireRate - Multiplies the fire cooldown by 0.85." }, { "type": "BuiltinCommonInstructions::Standard", @@ -13590,8 +14344,7 @@ "textG": 255, "textR": 255 }, - "comment": "Power - Adds 2 to the CharacterStats.Power scene variable. (Which is used when a bullet collides with an enemy)", - "comment2": "" + "comment": "Power - Adds 2 to the CharacterStats.Power scene variable. (Which is used when a bullet collides with an enemy)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -13639,8 +14392,7 @@ "textG": 255, "textR": 255 }, - "comment": "Speed - Adds to the player object's maximum speed, and adds 1 to the CharacterStats.Speedcap scene variable. (Which is used to deminish the effectiveness of subsequent speed upgrades)", - "comment2": "" + "comment": "Speed - Adds to the player object's maximum speed, and adds 1 to the CharacterStats.Speedcap scene variable. (Which is used to deminish the effectiveness of subsequent speed upgrades)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -13688,8 +14440,7 @@ "textG": 255, "textR": 255 }, - "comment": "Upgrade Icon Display - Create an upgrade icon at a position relative to the number of icons on screen and then change it's animation to match the upgrade you're interacting with.", - "comment2": "" + "comment": "Upgrade Icon Display - Create an upgrade icon at a position relative to the number of icons on screen and then change it's animation to match the upgrade you're interacting with." }, { "type": "BuiltinCommonInstructions::Standard", @@ -13745,8 +14496,7 @@ "textG": 0, "textR": 0 }, - "comment": "Finally, delete the upgrades object after the upgrade effect has been applied.", - "comment2": "" + "comment": "Finally, delete the upgrades object after the upgrade effect has been applied." }, { "type": "BuiltinCommonInstructions::Standard", @@ -13787,8 +14537,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the player is not in the middle of a force movement between rooms (during camera movement) allow player movement and gun control.", - "comment2": "" + "comment": "If the player is not in the middle of a force movement between rooms (during camera movement) allow player movement and gun control." }, { "type": "BuiltinCommonInstructions::Standard", @@ -13845,8 +14594,7 @@ "textG": 0, "textR": 0 }, - "comment": "Movement is applied based on position of the multitouch joystick.", - "comment2": "" + "comment": "Movement is applied based on position of the multitouch joystick." }, { "type": "BuiltinCommonInstructions::Standard", @@ -13897,8 +14645,7 @@ "textG": 0, "textR": 0 }, - "comment": "Detect if a force is applied to the player this frame. If so set the animation to run/idle.", - "comment2": "" + "comment": "Detect if a force is applied to the player this frame. If so set the animation to run/idle." }, { "type": "BuiltinCommonInstructions::Standard", @@ -13995,8 +14742,7 @@ "textG": 0, "textR": 0 }, - "comment": "Rotate gun based on Joystick position", - "comment2": "" + "comment": "Rotate gun based on Joystick position" }, { "type": "BuiltinCommonInstructions::Standard", @@ -14024,8 +14770,7 @@ "textG": 0, "textR": 0 }, - "comment": "Flip the player object and gun based on the angle between the joystick and outter ring.", - "comment2": "" + "comment": "Flip the player object and gun based on the angle between the joystick and outter ring." }, { "type": "BuiltinCommonInstructions::Standard", @@ -14119,8 +14864,7 @@ "textG": 0, "textR": 0 }, - "comment": "This event applies a number of effects to the player object, creates a bullet object and then applies a force toward the angle that the gun is facing. \n\nIt also resets the recoil timer.\n\nThe recoil timer is used in the event below.", - "comment2": "" + "comment": "This event applies a number of effects to the player object, creates a bullet object and then applies a force toward the angle that the gun is facing. \n\nIt also resets the recoil timer.\n\nThe recoil timer is used in the event below." }, { "type": "BuiltinCommonInstructions::Standard", @@ -14323,8 +15067,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the recoil timer is below 0.1 seconds long, an instant force is applied to the character using the angle saved to the object variable of the player \"RecoilAngle\" during the bullet firing event above.", - "comment2": "" + "comment": "If the recoil timer is below 0.1 seconds long, an instant force is applied to the character using the angle saved to the object variable of the player \"RecoilAngle\" during the bullet firing event above." }, { "type": "BuiltinCommonInstructions::Standard", @@ -14365,8 +15108,7 @@ "textG": 0, "textR": 0 }, - "comment": "Deleting stray bullets if they collide with a room wall or the room doors during combat.", - "comment2": "" + "comment": "Deleting stray bullets if they collide with a room wall or the room doors during combat." }, { "type": "BuiltinCommonInstructions::Standard", @@ -14443,8 +15185,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the player collides with a GhostOrb or the RoomTraps object, and they are no currently flashing(Flash/Blink behavior) then apply effects and damage the player object based on the game's current DangerLevelRounded value subtracted by the player's armor value which is the scene variable CharacterStats.Defense.", - "comment2": "" + "comment": "If the player collides with a GhostOrb or the RoomTraps object, and they are no currently flashing(Flash/Blink behavior) then apply effects and damage the player object based on the game's current DangerLevelRounded value subtracted by the player's armor value which is the scene variable CharacterStats.Defense." }, { "type": "BuiltinCommonInstructions::Standard", @@ -14595,8 +15336,7 @@ "textG": 255, "textR": 255 }, - "comment": "If the player's health reaches 0(Or below) they are deleted from the game to remove control and trigger the game restart events.", - "comment2": "" + "comment": "If the player's health reaches 0(Or below) they are deleted from the game to remove control and trigger the game restart events." }, { "type": "BuiltinCommonInstructions::Standard", @@ -14694,8 +15434,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the player's X position is greater/less than that of the enemy's in the \"enemy\" object group, they'll turn to face the player's position.", - "comment2": "" + "comment": "If the player's X position is greater/less than that of the enemy's in the \"enemy\" object group, they'll turn to face the player's position." }, { "type": "BuiltinCommonInstructions::Standard", @@ -14759,8 +15498,7 @@ "textG": 0, "textR": 0 }, - "comment": "Separate all enemies from the Room object, and then separate all imp and spider objects from the RoomTraps object.\n\nThis excludes the ghosts so they can float over the traps and not get displaced.", - "comment2": "" + "comment": "Separate all enemies from the Room object, and then separate all imp and spider objects from the RoomTraps object.\n\nThis excludes the ghosts so they can float over the traps and not get displaced." }, { "type": "BuiltinCommonInstructions::Standard", @@ -14808,8 +15546,7 @@ "textG": 0, "textR": 0 }, - "comment": "Separate all Ghosts, Spiders, and Imps from one another so they aren't spawning on top of one another at the beginning of a new room.", - "comment2": "" + "comment": "Separate all Ghosts, Spiders, and Imps from one another so they aren't spawning on top of one another at the beginning of a new room." }, { "type": "BuiltinCommonInstructions::Standard", @@ -14866,8 +15603,7 @@ "textG": 0, "textR": 0 }, - "comment": "The Ghost will Idle if they're above 120 pixels away from the player object, at which point their opacity changes to 100 and they have a force applied toward the player positon.", - "comment2": "" + "comment": "The Ghost will Idle if they're above 120 pixels away from the player object, at which point their opacity changes to 100 and they have a force applied toward the player positon." }, { "type": "BuiltinCommonInstructions::Standard", @@ -14916,8 +15652,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the ghost was hit and had its animation changed to \"Hurt\", when that animation finishes it will change to the Idle animation.", - "comment2": "" + "comment": "If the ghost was hit and had its animation changed to \"Hurt\", when that animation finishes it will change to the Idle animation." }, { "type": "BuiltinCommonInstructions::Standard", @@ -14962,8 +15697,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the ghost was playing the Idle animation, and is below 120 pixels away from the player, it will change it's animation to \"Charging\", and set it's opacity to 255.", - "comment2": "" + "comment": "If the ghost was playing the Idle animation, and is below 120 pixels away from the player, it will change it's animation to \"Charging\", and set it's opacity to 255." }, { "type": "BuiltinCommonInstructions::Standard", @@ -15021,8 +15755,7 @@ "textG": 255, "textR": 255 }, - "comment": "Shooting - When the Charging animation is finished, it will change the animation to \"resting\", and create a GhostOrb object and apply a permanent force toward the player's position.", - "comment2": "" + "comment": "Shooting - When the Charging animation is finished, it will change the animation to \"resting\", and create a GhostOrb object and apply a permanent force toward the player's position." }, { "type": "BuiltinCommonInstructions::Standard", @@ -15113,8 +15846,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the ghost animation is set to Resting, and the animation is finished, change the animation to Idle.\n\nThis acts as the \"gap\" that makes the ghost wait before firing another shot.", - "comment2": "" + "comment": "If the ghost animation is set to Resting, and the animation is finished, change the animation to Idle.\n\nThis acts as the \"gap\" that makes the ghost wait before firing another shot." }, { "type": "BuiltinCommonInstructions::Standard", @@ -15159,8 +15891,7 @@ "textG": 0, "textR": 0 }, - "comment": "If The Ghost object's opacity is 255(not transparent) and they collide with a bullet object, they'll change to the \"Hurt\" animation and have the below actions applied to them for effect.", - "comment2": "" + "comment": "If The Ghost object's opacity is 255(not transparent) and they collide with a bullet object, they'll change to the \"Hurt\" animation and have the below actions applied to them for effect." }, { "type": "BuiltinCommonInstructions::Standard", @@ -15322,8 +16053,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the object timer \"Knockback\" of the Ghost is below 0.1 seconds, an instant force is applied towards the angle saved when the bullet collided with the ghost in the above event.", - "comment2": "" + "comment": "If the object timer \"Knockback\" of the Ghost is below 0.1 seconds, an instant force is applied towards the angle saved when the bullet collided with the ghost in the above event." }, { "type": "BuiltinCommonInstructions::Standard", @@ -15376,8 +16106,7 @@ "textG": 0, "textR": 0 }, - "comment": "The Spider will Idle if they're above 15 pixels away from the player object, at which point they have a force applied toward the player positon.", - "comment2": "" + "comment": "The Spider will Idle if they're above 15 pixels away from the player object, at which point they have a force applied toward the player positon." }, { "type": "BuiltinCommonInstructions::Standard", @@ -15416,8 +16145,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the spider was hit and had its animation changed to \"Hurt\", when that animation finishes it will change to the Idle animation.", - "comment2": "" + "comment": "If the spider was hit and had its animation changed to \"Hurt\", when that animation finishes it will change to the Idle animation." }, { "type": "BuiltinCommonInstructions::Standard", @@ -15462,8 +16190,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the spider was playing the Idle animation, and is below 15 pixels away from the player, it will change it's animation to \"Charging\".", - "comment2": "" + "comment": "If the spider was playing the Idle animation, and is below 15 pixels away from the player, it will change it's animation to \"Charging\"." }, { "type": "BuiltinCommonInstructions::Standard", @@ -15511,8 +16238,7 @@ "textG": 255, "textR": 255 }, - "comment": "Shooting - When the Charging animation is finished, it will change the animation to \"resting\", and create a grouping of GhostOrb objects and apply a permanent force toward the player's position.", - "comment2": "" + "comment": "Shooting - When the Charging animation is finished, it will change the animation to \"resting\", and create a grouping of GhostOrb objects and apply a permanent force toward the player's position." }, { "type": "BuiltinCommonInstructions::Standard", @@ -15632,8 +16358,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the spider animation is set to Resting, and the animation is finished, change the animation to Idle.\n\nThis acts as the \"gap\" that makes the spider wait before firing another shot.", - "comment2": "" + "comment": "If the spider animation is set to Resting, and the animation is finished, change the animation to Idle.\n\nThis acts as the \"gap\" that makes the spider wait before firing another shot." }, { "type": "BuiltinCommonInstructions::Standard", @@ -15678,8 +16403,7 @@ "textG": 0, "textR": 0 }, - "comment": "If The spider object collides with a bullet object, they'll change to the \"Hurt\" animation and have the below actions applied to them for effect.", - "comment2": "" + "comment": "If The spider object collides with a bullet object, they'll change to the \"Hurt\" animation and have the below actions applied to them for effect." }, { "type": "BuiltinCommonInstructions::Standard", @@ -15831,8 +16555,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the object timer \"Knockback\" of the spider is below 0.1 seconds, an instant force is applied towards the angle saved when the bullet collided with the spider in the above event.", - "comment2": "" + "comment": "If the object timer \"Knockback\" of the spider is below 0.1 seconds, an instant force is applied towards the angle saved when the bullet collided with the spider in the above event." }, { "type": "BuiltinCommonInstructions::Standard", @@ -15885,8 +16608,7 @@ "textG": 0, "textR": 0 }, - "comment": "The Imp will Idle if they're above 140 pixels away from the player object, at which point they have a force applied toward the player positon.", - "comment2": "" + "comment": "The Imp will Idle if they're above 140 pixels away from the player object, at which point they have a force applied toward the player positon." }, { "type": "BuiltinCommonInstructions::Standard", @@ -15925,8 +16647,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the Imp was playing the Idle animation, and is below 140 pixels away from the player, it will change it's animation to \"Charging\".", - "comment2": "" + "comment": "If the Imp was playing the Idle animation, and is below 140 pixels away from the player, it will change it's animation to \"Charging\"." }, { "type": "BuiltinCommonInstructions::Standard", @@ -15986,8 +16707,7 @@ "textG": 255, "textR": 255 }, - "comment": "Shooting - When the Charging animation is finished, it will change the animation to \"resting\", and create a spray of GhostOrb objects and apply a permanent force toward a set angle relative to the player.", - "comment2": "" + "comment": "Shooting - When the Charging animation is finished, it will change the animation to \"resting\", and create a spray of GhostOrb objects and apply a permanent force toward a set angle relative to the player." }, { "type": "BuiltinCommonInstructions::Standard", @@ -16044,8 +16764,7 @@ "textG": 0, "textR": 0 }, - "comment": "This first creates the spread variable for the imp and sets it to 130. Then with each time the below event repeats it adds 10 degrees to the spread variable. Causing 9 different GhostOrb objects to spawn and spread outwards with 10 degrees difference between each angle of fire.", - "comment2": "" + "comment": "This first creates the spread variable for the imp and sets it to 130. Then with each time the below event repeats it adds 10 degrees to the spread variable. Causing 9 different GhostOrb objects to spawn and spread outwards with 10 degrees difference between each angle of fire." }, { "type": "BuiltinCommonInstructions::Standard", @@ -16135,8 +16854,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the Imp animation is set to Resting, and the animation is finished, change the animation to Idle.\n\nThis acts as the \"gap\" that makes the Imp wait before firing another shot.", - "comment2": "" + "comment": "If the Imp animation is set to Resting, and the animation is finished, change the animation to Idle.\n\nThis acts as the \"gap\" that makes the Imp wait before firing another shot." }, { "type": "BuiltinCommonInstructions::Standard", @@ -16181,8 +16899,7 @@ "textG": 0, "textR": 0 }, - "comment": "If The Imp object collides with a bullet object, they'll have the below actions applied to them for effect.(The Imp does not have a \"hurt\" animation)", - "comment2": "" + "comment": "If The Imp object collides with a bullet object, they'll have the below actions applied to them for effect.(The Imp does not have a \"hurt\" animation)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -16325,8 +17042,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the object timer \"Knockback\" of the spider is below 0.1 seconds, an instant force is applied towards the angle saved when the bullet collided with the spider in the above event.", - "comment2": "" + "comment": "If the object timer \"Knockback\" of the spider is below 0.1 seconds, an instant force is applied towards the angle saved when the bullet collided with the spider in the above event." }, { "type": "BuiltinCommonInstructions::Standard", @@ -16379,8 +17095,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the \"Enemies\" health drops to 0 or below, pick a random integer in the range of 0-100 and then check to see if that integer is below the drop chance variable set for the enemy object, and if it is create a PickUp object and change it's animation to \"HealthOrb\". Then based on the drop amount variable, set for the enemy object, create a PickUp object to represent point pick ups.\n\nApply a permanent force to the created PickUp Objects at a random float in range of 0-360 degrees, and begin a timer for each to track how long they've been moving for.", - "comment2": "" + "comment": "If the \"Enemies\" health drops to 0 or below, pick a random integer in the range of 0-100 and then check to see if that integer is below the drop chance variable set for the enemy object, and if it is create a PickUp object and change it's animation to \"HealthOrb\". Then based on the drop amount variable, set for the enemy object, create a PickUp object to represent point pick ups.\n\nApply a permanent force to the created PickUp Objects at a random float in range of 0-360 degrees, and begin a timer for each to track how long they've been moving for." }, { "type": "BuiltinCommonInstructions::Standard", @@ -16549,8 +17264,7 @@ "textG": 0, "textR": 0 }, - "comment": "Delete stray GhostOrbs if they collide with the Room or RoomDoors", - "comment2": "" + "comment": "Delete stray GhostOrbs if they collide with the Room or RoomDoors" }, { "type": "BuiltinCommonInstructions::Standard", @@ -16610,8 +17324,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the object timer of a \"PickUp\" object is above 0.2 seconds, stop all forces.(Ending their movement after killing an enemy)", - "comment2": "" + "comment": "If the object timer of a \"PickUp\" object is above 0.2 seconds, stop all forces.(Ending their movement after killing an enemy)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -16655,8 +17368,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the object timer of a \"PickUp\" object is above 5 seconds, delete it.(Performance saving, but also encouraging the player to pick up the object before they disappear)", - "comment2": "" + "comment": "If the object timer of a \"PickUp\" object is above 5 seconds, delete it.(Performance saving, but also encouraging the player to pick up the object before they disappear)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -16707,8 +17419,7 @@ "textG": 0, "textR": 0 }, - "comment": "Applying to all EnemyDamageText objects on screen, change their opacity by an amount multiplied by TimeDelta()", - "comment2": "" + "comment": "Applying to all EnemyDamageText objects on screen, change their opacity by an amount multiplied by TimeDelta()" }, { "type": "BuiltinCommonInstructions::Standard", @@ -16736,8 +17447,7 @@ "textG": 0, "textR": 0 }, - "comment": "When their opacity does reach 0, delete the enemyDamageText object.", - "comment2": "" + "comment": "When their opacity does reach 0, delete the enemyDamageText object." }, { "type": "BuiltinCommonInstructions::Standard", @@ -16787,8 +17497,7 @@ "textG": 0, "textR": 0 }, - "comment": "Hide the Reset_Timer object, so it can be shown later when needed.", - "comment2": "" + "comment": "Hide the Reset_Timer object, so it can be shown later when needed." }, { "type": "BuiltinCommonInstructions::Standard", @@ -16823,8 +17532,7 @@ "textG": 0, "textR": 0 }, - "comment": "This event will only trigger if the player object is deleted, showing the Reset layer, and allowing for the buttons to be pressed.", - "comment2": "" + "comment": "This event will only trigger if the player object is deleted, showing the Reset layer, and allowing for the buttons to be pressed." }, { "type": "BuiltinCommonInstructions::Standard", @@ -16852,8 +17560,7 @@ "textG": 0, "textR": 0 }, - "comment": "Give a 1.5 second window for the player to realize they've died\nand show the Reset layer and align objects to fit the screen, and apply effects (like object shake).", - "comment2": "" + "comment": "Give a 1.5 second window for the player to realize they've died\nand show the Reset layer and align objects to fit the screen, and apply effects (like object shake)." }, { "type": "BuiltinCommonInstructions::Standard", @@ -17008,8 +17715,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the Reset layer is visible, but the Leaderboard layer isn't, allow the subevents to trigger.", - "comment2": "" + "comment": "If the Reset layer is visible, but the Leaderboard layer isn't, allow the subevents to trigger." }, { "type": "BuiltinCommonInstructions::Standard", @@ -17046,8 +17752,7 @@ "textG": 255, "textR": 255 }, - "comment": "If the mouse is hovering over the Reset button, and the left mouse button is released, delete the button objects and restart the \"Death\" timer.", - "comment2": "" + "comment": "If the mouse is hovering over the Reset button, and the left mouse button is released, delete the button objects and restart the \"Death\" timer." }, { "type": "BuiltinCommonInstructions::Standard", @@ -17122,8 +17827,7 @@ "textG": 255, "textR": 255 }, - "comment": "If the buttons were deleted by the above event, check the \"Death\" timer and apply the changes to the newly shown \"Reset_timer\" object.", - "comment2": "" + "comment": "If the buttons were deleted by the above event, check the \"Death\" timer and apply the changes to the newly shown \"Reset_timer\" object." }, { "type": "BuiltinCommonInstructions::Standard", @@ -17345,8 +18049,7 @@ "textG": 255, "textR": 255 }, - "comment": "If the mouse is hovering over the leaderboard text object and the left mouse button is released, delete the text objects and show the leaderboard layer and apply tweaks.", - "comment2": "" + "comment": "If the mouse is hovering over the leaderboard text object and the left mouse button is released, delete the text objects and show the leaderboard layer and apply tweaks." }, { "type": "BuiltinCommonInstructions::Standard", @@ -17444,8 +18147,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the leaderboard layer is visible, align the text input object and the submit text object with the screen width.", - "comment2": "" + "comment": "If the leaderboard layer is visible, align the text input object and the submit text object with the screen width." }, { "type": "BuiltinCommonInstructions::Standard", @@ -17502,8 +18204,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the text input object is clicked in to, or focused, they submit button will become visible again.(Encouraging the player to put a name in first)", - "comment2": "" + "comment": "If the text input object is clicked in to, or focused, they submit button will become visible again.(Encouraging the player to put a name in first)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -17549,8 +18250,7 @@ "textG": 0, "textR": 0 }, - "comment": "If the submit button is visible, and the mouse button is hovered over them, and the left moiuse button is release, send the scene variable \"PointCount\" to the selected leaderboard with the player name typed in to the LeaderboardName_Input object.", - "comment2": "" + "comment": "If the submit button is visible, and the mouse button is hovered over them, and the left moiuse button is release, send the scene variable \"PointCount\" to the selected leaderboard with the player name typed in to the LeaderboardName_Input object." }, { "type": "BuiltinCommonInstructions::Standard", @@ -17617,8 +18317,7 @@ "textG": 0, "textR": 0 }, - "comment": "When the leaderboard has finished leading, pause this scene and start the \"lLeaderboard\" scene.", - "comment2": "" + "comment": "When the leaderboard has finished leading, pause this scene and start the \"lLeaderboard\" scene." }, { "type": "BuiltinCommonInstructions::Standard", @@ -17744,28 +18443,20 @@ "textG": 0, "textR": 0 }, - "comment": "When the player's touch goes over the pause button, once, it'll trigger the pause by toggling the boolean variable to true.", - "comment2": "" + "comment": "When the player's touch goes over the pause button, once, it'll trigger the pause by toggling the boolean variable to true." }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "SourisSurObjet" + "value": "ButtonStates::ButtonFSM::IsClicked" }, "parameters": [ "HelpIcon", - "", - "", + "ButtonFSM", "" ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] } ], "actions": [ @@ -17907,8 +18598,7 @@ "textG": 0, "textR": 0 }, - "comment": "When the player's touch goes over one of their upgrade icons, it changes the \"Upgrade_Text\" to match the type of upgrade being checked.", - "comment2": "" + "comment": "When the player's touch goes over one of their upgrade icons, it changes the \"Upgrade_Text\" to match the type of upgrade being checked." }, { "type": "BuiltinCommonInstructions::Standard", @@ -18132,9 +18822,15 @@ "ambientLightColorB": 32, "ambientLightColorG": 0, "ambientLightColorR": 0, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", "followBaseLayerCamera": false, "isLightingLayer": false, + "isLocked": false, "name": "", + "renderingType": "", "visibility": true, "cameras": [ { @@ -18154,9 +18850,32 @@ "ambientLightColorB": 11412152, "ambientLightColorG": 6040208, "ambientLightColorR": 11290968, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", "followBaseLayerCamera": false, "isLightingLayer": false, + "isLocked": true, "name": "MobileCovering", + "renderingType": "", + "visibility": true, + "cameras": [], + "effects": [] + }, + { + "ambientLightColorB": 9768528, + "ambientLightColorG": 6034944, + "ambientLightColorR": 7581144, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "UI", + "renderingType": "", "visibility": true, "cameras": [], "effects": [] @@ -18165,9 +18884,15 @@ "ambientLightColorB": -2147483632, "ambientLightColorG": 6040208, "ambientLightColorR": 11290968, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", "followBaseLayerCamera": false, "isLightingLayer": false, + "isLocked": true, "name": "MobileControls", + "renderingType": "", "visibility": true, "cameras": [], "effects": [] @@ -18176,31 +18901,32 @@ "ambientLightColorB": 12199304, "ambientLightColorG": 6040208, "ambientLightColorR": 11978728, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", "followBaseLayerCamera": false, "isLightingLayer": false, + "isLocked": false, "name": "PauseLayer", + "renderingType": "", "visibility": false, "cameras": [], "effects": [] }, - { - "ambientLightColorB": 9768528, - "ambientLightColorG": 6034944, - "ambientLightColorR": 7581144, - "followBaseLayerCamera": false, - "isLightingLayer": false, - "name": "UI", - "visibility": true, - "cameras": [], - "effects": [] - }, { "ambientLightColorB": -2147483616, "ambientLightColorG": 6034944, "ambientLightColorR": 7337136, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", "followBaseLayerCamera": false, "isLightingLayer": false, + "isLocked": false, "name": "Reset", + "renderingType": "", "visibility": false, "cameras": [], "effects": [] @@ -18209,9 +18935,15 @@ "ambientLightColorB": 12252528, "ambientLightColorG": 6034944, "ambientLightColorR": 12637240, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", "followBaseLayerCamera": false, "isLightingLayer": false, + "isLocked": false, "name": "Leaderboard", + "renderingType": "", "visibility": false, "cameras": [], "effects": [] @@ -18222,6 +18954,18 @@ "name": "Anchor", "type": "AnchorBehavior::AnchorBehavior" }, + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, + { + "name": "ButtonFSM", + "type": "ButtonStates::ButtonFSM" + }, + { + "name": "Effect", + "type": "EffectCapability::EffectBehavior" + }, { "name": "FireBullet", "type": "FireBullet::FireBullet" @@ -18230,10 +18974,26 @@ "name": "Flash", "type": "Flash::Flash" }, + { + "name": "Flippable", + "type": "FlippableCapability::FlippableBehavior" + }, { "name": "Health", "type": "Health::Health" }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, + { + "name": "Resizable", + "type": "ResizableCapability::ResizableBehavior" + }, + { + "name": "Scale", + "type": "ScalableCapability::ScalableBehavior" + }, { "name": "ShakeObject_PositionAngle", "type": "ShakeObject::ShakeObject_PositionAngle" @@ -18241,6 +19001,10 @@ { "name": "ShakeObject_PositionAngleScale", "type": "ShakeObject::ShakeObject_PositionAngleScale" + }, + { + "name": "Text", + "type": "TextContainerCapability::TextContainerBehavior" } ] }, @@ -18271,6 +19035,9 @@ "variables": [], "instances": [], "objects": [], + "objectsFolderStructure": { + "folderName": "__ROOT" + }, "events": [ { "type": "BuiltinCommonInstructions::Comment", @@ -18282,8 +19049,7 @@ "textG": 0, "textR": 0 }, - "comment": "This event sends the player back to the previously paused scene when the leaderboard is exited from.\n\nThis acts as a \"pause\" for the game to prevent anything in game from being interacted with while the leaderboard is showing on top of your game.", - "comment2": "" + "comment": "This event sends the player back to the previously paused scene when the leaderboard is exited from.\n\nThis acts as a \"pause\" for the game to prevent anything in game from being interacted with while the leaderboard is showing on top of your game." }, { "type": "BuiltinCommonInstructions::Standard", @@ -18313,9 +19079,15 @@ "ambientLightColorB": 0, "ambientLightColorG": 134217728, "ambientLightColorR": 1597066561, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", "followBaseLayerCamera": false, "isLightingLayer": false, + "isLocked": false, "name": "", + "renderingType": "", "visibility": true, "cameras": [ { @@ -18342,39 +19114,26 @@ "category": "Game mechanic", "extensionNamespace": "", "fullName": "Fire bullets", - "helpPath": "https://gdevelop.io/game-example/fire-bullet", + "helpPath": "/extensions/fire-bullet/details", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWJ1bGxldCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNCwyMkgxMFYyMUgxNFYyMk0xMywxMFY3SDExVjEwTDEwLDExLjVWMjBIMTRWMTEuNUwxMywxME0xMiwyQzEyLDIgMTEsMyAxMSw1VjZIMTNWNUMxMyw1IDEzLDMgMTIsMloiIC8+PC9zdmc+", "name": "FireBullet", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/bullet.svg", - "shortDescription": "Fire bullets, manage ammo, reloading, and overheating.", - "version": "0.6.1", + "shortDescription": "Fire bullets, manage ammo, reloading and overheating.", + "version": "0.8.1", "description": [ - "Fire bullets, manage ammo, reloading, and overheating.", - "", - "Firing bullets:", - "- Cooldown: Time between shots (seconds)", - "- Bullet Quantity: Number of bullets created each time Fire Bullet action is used. ", - "- Firing Arc: Range of angles (in degrees) that bullets will shoot. Bullets are evenly spread within this range.", - "- Rotate bullet: Change the angle of each bullet to match the direction it is travelling (enabled by default)", - "- Angle Variance: Each bullet trajectory will be adjusted by a random value within this range (degrees)", - "- Bullet speed variance: Each bullet speed will be adjusted by a random value within this range (pixels/second)", + "This extension allows objects to fire bullets.", "", - " Ammo:", - "- Starting ammo", - "- Max ammo", - "- Shots per reload. Use 0 to disable reloading", - "- Reload duration", - "- Automatic reloading is enabled by default, but it can also be done manually.", + "It handles:", + "- Cooldown between shots", + "- Firing multiple bullets at a time ([open the project online](https://editor.gdevelop.io/?project=example://fire-bullet))", + "- Ammo management", + "- Overheat", "", - "Overheat:", - "- Heat increase per shot. Object is Overheated when Heat reaches 1.", - "- Cooling rate per second", - "- When overheated, the object cannot fire any bullets", + "It can be used for:", + "- Twin-stick shooters ([open the project online](https://editor.gdevelop.io/?project=example://conviction-of-gun-dude-desktop))", + "- Shoot'em up ([open the project online](https://editor.gdevelop.io/?project=example://space-shooter))", "", - "Statistics:", - "- Total bullets created", - "- Total shots taken", - "- Total reloads completed" + "A simple example shows how to make firing patterns ([open the project online](https://editor.gdevelop.io/?project=example://firing-patterns))." ], "origin": { "identifier": "FireBullet", @@ -18398,6 +19157,8 @@ "gqDaZjCfevOOxBYkK6zlhtZnXCg1" ], "dependencies": [], + "globalVariables": [], + "sceneVariables": [], "eventsFunctions": [], "eventsBasedBehaviors": [ { @@ -18433,7 +19194,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyStartingAmmo()" + "StartingAmmo" ] }, { @@ -18444,7 +19205,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -18490,8 +19251,7 @@ "textG": 0, "textR": 0 }, - "comment": "Creators can use the \"FireBullet\" action multiple times in a frame and it will be counted as a single \"shot\".", - "comment2": "" + "comment": "Creators can use the \"FireBullet\" action multiple times in a frame and it will be counted as a single \"shot\"." }, { "type": "BuiltinCommonInstructions::Standard", @@ -18506,57 +19266,48 @@ ] } ], - "actions": [], - "events": [ + "actions": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Reset firing cooldown", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ResetObjectTimer" - }, - "parameters": [ - "Object", - "\"__FireBullet.FiringCooldown\"" - ] - } - ] - } - ], - "parameters": [] + "type": { + "value": "FireBullet::FireBullet::SetPropertyHasJustFired" + }, + "parameters": [ + "Object", + "Behavior", + "=" + ] }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"__FireBullet.FiringCooldown\"" + ] + }, + { + "type": { + "value": "FireBullet::FireBullet::SetPropertyTotalShotsFired" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ], + "events": [ { "colorB": 228, "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Update ammo", + "name": "Ammo", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Subtract 1 from ammo (if not unlimited ammo)", - "comment2": "" - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -18579,24 +19330,12 @@ "parameters": [ "Object", "Behavior", - "-", - "1" + "=", + "max(0, AmmoQuantity - 1)" ] } ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Update reloading counter", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -18625,19 +19364,7 @@ ] } ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Automatically reload gun when needed", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -18693,23 +19420,10 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Update Overheat", + "name": "Overheat", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Increase heat (if needed)", - "comment2": "" - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -18734,24 +19448,11 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyHeatIncreasePerShot()" + "HeatIncreasePerShot" ] } ], "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Check if this caused overheat", - "comment2": "" - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -18793,63 +19494,6 @@ } ], "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Update statistics", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "FireBullet::FireBullet::SetPropertyTotalShotsFired" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "1" - ] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Reset firing detection", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "FireBullet::FireBullet::SetPropertyHasJustFired" - }, - "parameters": [ - "Object", - "Behavior", - "=" - ] - } - ] - } - ], - "parameters": [] } ] } @@ -18861,7 +19505,7 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Reload gun when needed", + "name": "Reload", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ @@ -18875,8 +19519,7 @@ "textG": 0, "textR": 0 }, - "comment": "Detect when reload is completed", - "comment2": "" + "comment": "Detect when reload is completed" }, { "type": "BuiltinCommonInstructions::Standard", @@ -18899,7 +19542,7 @@ "Object", "\"__FireBullet.ReloadingTimer\"", ">=", - "Object.Behavior::PropertyReloadDuration()" + "ReloadDuration" ] } ], @@ -18950,7 +19593,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -18965,8 +19608,7 @@ "textG": 0, "textR": 0 }, - "comment": "Only reload the amount of ammo available", - "comment2": "" + "comment": "Only reload the amount of ammo available" }, { "type": "BuiltinCommonInstructions::Standard", @@ -18992,7 +19634,7 @@ "Object", "Behavior", "=", - "min(Object.Behavior::PropertyShotsPerReload(), Object.Behavior::PropertyAmmoQuantity())" + "min(ShotsPerReload, AmmoQuantity)" ] } ] @@ -19007,7 +19649,7 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Reduce heat level (based on cooling rate)", + "name": "Cooling", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ @@ -19019,7 +19661,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "Object.Behavior::HeatLevel()", + "HeatLevel", ">", "0" ] @@ -19051,7 +19693,7 @@ "Object", "Behavior", "=", - "max(0, Object.Behavior::PropertyHeatLevel() - TimeDelta() * Object.Behavior::PropertyExponentialCoolingRate() * Object.Behavior::PropertyHeatLevel())" + "max(0, HeatLevel - TimeDelta() * ExponentialCoolingRate * HeatLevel)" ] } ] @@ -19080,7 +19722,7 @@ "Object", "Behavior", "=", - "max(0, Object.Behavior::PropertyHeatLevel() - TimeDelta() * Object.Behavior::PropertyLinearCoolingRate())" + "max(0, HeatLevel - TimeDelta() * LinearCoolingRate)" ] } ] @@ -19106,6 +19748,75 @@ ], "objectGroups": [] }, + { + "description": "Fire bullets toward an object.", + "fullName": "Fire bullets toward an object", + "functionType": "Action", + "name": "FireTowardObject", + "sentence": "Fire _PARAM4_ from _PARAM0_, at position _PARAM2_; _PARAM3_, toward _PARAM5_ with speed _PARAM6_ px/s", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FireBullet::FireBullet::Fire" + }, + "parameters": [ + "Object", + "Behavior", + "XPosition", + "YPosition", + "Bullet", + "Object.AngleToObject(TargetObject)", + "Speed", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FireBullet::FireBullet", + "type": "behavior" + }, + { + "description": "X position, where to create the bullet", + "name": "XPosition", + "type": "expression" + }, + { + "description": "Y position, where to create the bullet", + "name": "YPosition", + "type": "expression" + }, + { + "description": "The bullet object", + "name": "Bullet", + "type": "objectListOrEmptyIfJustDeclared" + }, + { + "description": "Target object", + "name": "TargetObject", + "type": "objectList" + }, + { + "description": "Speed of the bullet, in pixels per second", + "name": "Speed", + "type": "expression" + } + ], + "objectGroups": [] + }, { "description": "Fire bullets toward a position.", "fullName": "Fire bullets toward a position", @@ -19114,37 +19825,25 @@ "sentence": "Fire _PARAM4_ from _PARAM0_, at position _PARAM2_; _PARAM3_, toward position _PARAM5_;_PARAM6_ with speed _PARAM7_ px/s", "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Calculate the trajectory angle and use the \"Fire bullets\" action", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "FireBullet::FireBullet::Fire" - }, - "parameters": [ - "Object", - "Behavior", - "GetArgumentAsNumber(\"XPosition\")", - "GetArgumentAsNumber(\"YPosition\")", - "Bullet", - "Object.AngleToPosition(GetArgumentAsNumber(\"TargetXPosition\"),GetArgumentAsNumber(\"TargetYPosition\"))", - "GetArgumentAsNumber(\"Speed\")", - "" - ] - } + "type": { + "value": "FireBullet::FireBullet::Fire" + }, + "parameters": [ + "Object", + "Behavior", + "XPosition", + "YPosition", + "Bullet", + "Object.AngleToPosition(TargetXPosition, TargetYPosition)", + "Speed", + "" ] } - ], - "parameters": [] + ] } ], "parameters": [ @@ -19172,7 +19871,7 @@ { "description": "The bullet object", "name": "Bullet", - "type": "objectList" + "type": "objectListOrEmptyIfJustDeclared" }, { "description": "Target X position", @@ -19200,136 +19899,163 @@ "sentence": "Fire _PARAM4_ from _PARAM0_, at position _PARAM2_; _PARAM3_, toward angle _PARAM5_ and speed _PARAM6_ px/s", "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Check if ready to shoot", - "source": "", - "type": "BuiltinCommonInstructions::Group", + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "FireBullet::FireBullet::IsReadyToShoot" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "FireBullet::FireBullet::SetPropertyHasJustFired" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ], "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "FireBullet::FireBullet::IsReadyToShoot" + "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "Object", - "Behavior", - "" + "BulletQuantity", + "=", + "1" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyHasJustFired" + "value": "FireBullet::FireBullet::FireSingleBullet" }, "parameters": [ "Object", "Behavior", - "yes" + "XPosition", + "YPosition", + "Bullet", + "Angle", + "Speed", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "BulletQuantity", + ">", + "1" ] } ], + "actions": [], "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Single bullet", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Behavior::PropertyBulletQuantity()", - "=", - "1" - ] - } - ], - "actions": [ - { - "type": { - "value": "FireBullet::FireBullet::FireSingleBullet" - }, - "parameters": [ - "Object", - "Behavior", - "GetArgumentAsNumber(\"XPosition\")", - "GetArgumentAsNumber(\"YPosition\")", - "Bullet", - "GetArgumentAsNumber(\"Angle\")", - "GetArgumentAsNumber(\"Speed\")", - "" - ] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Multiple bullets", - "source": "", - "type": "BuiltinCommonInstructions::Group", + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "BulletQuantity", + "conditions": [], + "actions": [], + "events": [ { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Behavior::PropertyBulletQuantity()", - ">", - "1" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "FireBullet::FireBullet::FiringArc" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "360", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MultiShotAngle", + "=", + "Angle + lerp(-FiringArc / 2, FiringArc / 2, BulletIndex / (BulletQuantity - 1)) " + ] + } ] - } - ], - "actions": [ + }, { - "type": { - "value": "ModVarObjet" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "Object", - "__FireBullet.CurrentBulletAngle", - "=", - "GetArgumentAsNumber(\"Angle\") - Object.Behavior::PropertyFiringArc()/2" - ] + "comment": "When firing in a full circle, prevent first and last bullet from using the same angle" }, { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__FireBullet.BatchOrderID", - "=", - "0" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "FireBullet::FireBullet::FiringArc" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "360", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MultiShotAngle", + "=", + "Angle + lerp(-FiringArc / 2, FiringArc / 2, BulletIndex / BulletQuantity) " + ] + } ] - } - ], - "events": [ + }, { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "Object.Behavior::PropertyBulletQuantity()", + "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { @@ -19339,55 +20065,22 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsNumber(\"XPosition\")", - "GetArgumentAsNumber(\"YPosition\")", + "XPosition", + "YPosition", "Bullet", - "Object.Variable(__FireBullet.CurrentBulletAngle) + RandomInRange(-Object.Behavior::PropertyAngleVariance(),Object.Behavior::PropertyAngleVariance())", - "GetArgumentAsNumber(\"Speed\")", + "MultiShotAngle", + "Speed", "" ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Move temp variable to the next angle a bullet will be sent", - "comment2": "" }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__FireBullet.CurrentBulletAngle", - "+", - "Object.Behavior::PropertyFiringArc() / (Object.Behavior::PropertyBulletQuantity() - 1)" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__FireBullet.BatchOrderID", - "+", - "1" - ] - } + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BulletIndex", + "+", + "1" ] } ] @@ -19395,12 +20088,23 @@ ] } ], - "parameters": [] + "variables": [ + { + "folded": true, + "name": "MultiShotAngle", + "type": "number", + "value": 0 + }, + { + "name": "BulletIndex", + "type": "number", + "value": 0 + } + ] } ] } - ], - "parameters": [] + ] } ], "parameters": [ @@ -19428,7 +20132,7 @@ { "description": "The bullet object", "name": "Bullet", - "type": "objectList" + "type": "objectListOrEmptyIfJustDeclared" }, { "description": "Angle of the bullet, in degrees", @@ -19471,8 +20175,7 @@ "textG": 0, "textR": 0 }, - "comment": "Create bullet", - "comment2": "" + "comment": "Create bullet" }, { "type": "BuiltinCommonInstructions::Standard", @@ -19485,9 +20188,9 @@ "parameters": [ "", "Bullet", - "GetArgumentAsNumber(\"XPosition\")", - "GetArgumentAsNumber(\"YPosition\")", - "Object.Behavior::PropertyBulletLayer()" + "XPosition", + "YPosition", + "BulletLayer" ] } ], @@ -19502,8 +20205,7 @@ "textG": 0, "textR": 0 }, - "comment": "Move bullet (apply angle and bullet speed variances)", - "comment2": "" + "comment": "Move bullet (apply angle and bullet speed variances)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -19517,7 +20219,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Angle\") + RandomInRange(-Object.Behavior::PropertyAngleVariance(), Object.Behavior::PropertyAngleVariance())" + "Angle + RandomInRange(-AngleVariance, AngleVariance)" ] }, { @@ -19526,8 +20228,8 @@ }, "parameters": [ "Bullet", - "Object.Behavior::PropertyRandomizedAngle()", - "GetArgumentAsNumber(\"Speed\") + RandomInRange(-Object.Behavior::PropertyBulletSpeedVariance(), Object.Behavior::PropertyBulletSpeedVariance())", + "RandomizedAngle", + "Speed + RandomInRange(-BulletSpeedVariance, BulletSpeedVariance)", "1" ] } @@ -19543,60 +20245,7 @@ "textG": 0, "textR": 0 }, - "comment": "Add identifier variables (to enable advanced picking by users)", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Bullet", - "__FireBullet.BulletID", - "=", - "Object.Behavior::PropertyTotalBulletsCreated()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Bullet", - "__FireBullet.BatchID", - "=", - "Object.Behavior::PropertyTotalShotsFired()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Bullet", - "__FireBullet.BatchOrderID", - "=", - "0" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Rotate newly created bullet, if needed", - "comment2": "" + "comment": "Rotate newly created bullet, if needed" }, { "type": "BuiltinCommonInstructions::Standard", @@ -19619,7 +20268,7 @@ "parameters": [ "Bullet", "=", - "Object.Behavior::PropertyRandomizedAngle()" + "RandomizedAngle" ] } ] @@ -19636,8 +20285,7 @@ "textG": 0, "textR": 0 }, - "comment": "Update statistics", - "comment2": "" + "comment": "Update statistics" }, { "type": "BuiltinCommonInstructions::Standard", @@ -19685,7 +20333,7 @@ { "description": "The bullet object", "name": "Bullet", - "type": "objectList" + "type": "objectListOrEmptyIfJustDeclared" }, { "description": "Angle of the bullet, in degrees", @@ -19768,20 +20416,6 @@ "name": "HasJustFired", "sentence": "_PARAM0_ has just fired", "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "False" - ] - } - ] - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -19887,7 +20521,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFiringArc()" + "FiringArc" ] } ] @@ -19930,7 +20564,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -19977,7 +20611,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -20021,7 +20655,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAngleVariance()" + "AngleVariance" ] } ] @@ -20064,7 +20698,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -20111,7 +20745,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -20155,7 +20789,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBulletSpeedVariance()" + "BulletSpeedVariance" ] } ] @@ -20198,7 +20832,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -20245,7 +20879,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -20289,7 +20923,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBulletQuantity()" + "BulletQuantity" ] } ] @@ -20332,7 +20966,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -20379,7 +21013,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -20426,7 +21060,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -20469,7 +21103,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"RotateBullet\"" + "\"Value\"" ] } ], @@ -20494,7 +21128,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"RotateBullet\"" + "\"Value\"" ] } ], @@ -20527,7 +21161,7 @@ { "defaultValue": "yes", "description": "Rotate bullet to match trajetory", - "name": "RotateBullet", + "name": "Value", "optional": true, "type": "yesorno" } @@ -20551,7 +21185,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"UnlimitedAmmo\"" + "\"Value\"" ] } ], @@ -20576,7 +21210,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"UnlimitedAmmo\"" + "\"Value\"" ] } ], @@ -20609,7 +21243,7 @@ { "defaultValue": "yes", "description": "Unlimited ammo", - "name": "UnlimitedAmmo", + "name": "Value", "optional": true, "type": "yesorno" } @@ -20633,7 +21267,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFireCooldown()" + "FireCooldown" ] } ] @@ -20676,7 +21310,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -20723,7 +21357,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"NewCooldown\")", + "Value", "" ] } @@ -20744,7 +21378,7 @@ }, { "description": "Cooldown in seconds", - "name": "NewCooldown", + "name": "Value", "type": "expression" } ], @@ -20767,7 +21401,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyReloadDuration()" + "ReloadDuration" ] } ] @@ -20810,7 +21444,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -20857,7 +21491,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -20901,7 +21535,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyOverheatDuration()" + "OverheatDuration" ] } ] @@ -20944,7 +21578,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -20991,7 +21625,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -21035,7 +21669,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAmmoQuantity()" + "AmmoQuantity" ] } ] @@ -21078,7 +21712,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "max(0, Value)" ] } ] @@ -21125,7 +21759,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "max(0, Value)", "" ] } @@ -21169,7 +21803,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHeatIncreasePerShot()" + "HeatIncreasePerShot" ] } ] @@ -21212,7 +21846,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -21259,7 +21893,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -21303,7 +21937,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxAmmo()" + "MaxAmmo" ] } ] @@ -21346,7 +21980,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -21375,7 +22009,7 @@ "Object", "Behavior", "=", - "min(Object.Behavior::MaxAmmo(),Object.Behavior::AmmoQuantity())" + "min(MaxAmmo, AmmoQuantity)" ] } ] @@ -21422,7 +22056,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -21589,7 +22223,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -21632,7 +22266,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -21648,7 +22282,7 @@ "Object", "Behavior", ">", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ], @@ -21661,7 +22295,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -21708,7 +22342,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -21824,7 +22458,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyLinearCoolingRate()" + "LinearCoolingRate" ] } ] @@ -21867,7 +22501,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -21914,7 +22548,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -21958,7 +22592,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyExponentialCoolingRate()" + "ExponentialCoolingRate" ] } ] @@ -22001,7 +22635,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22049,7 +22683,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -22096,7 +22730,7 @@ "Object", "Behavior", "+", - "GetArgumentAsNumber(\"AmmoGained\")" + "AmmoGained" ] } ] @@ -22111,8 +22745,7 @@ "textG": 0, "textR": 0 }, - "comment": "If Max Ammo is set, do not exceed the value", - "comment2": "" + "comment": "If Max Ammo is set, do not exceed the value" }, { "type": "BuiltinCommonInstructions::Standard", @@ -22138,7 +22771,7 @@ "Object", "Behavior", "=", - "min(Object.Behavior::MaxAmmo(),Object.Behavior::AmmoQuantity())" + "min(MaxAmmo, AmmoQuantity)" ] } ] @@ -22217,7 +22850,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyBulletLayer()" + "BulletLayer" ] } ] @@ -22258,7 +22891,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "min(1,Object.Behavior::PropertyHeatLevel())" + "min(1, HeatLevel)" ] } ] @@ -22299,7 +22932,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTotalShotsFired()" + "TotalShotsFired" ] } ] @@ -22340,7 +22973,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTotalBulletsCreated()" + "TotalBulletsCreated" ] } ] @@ -22381,7 +23014,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTotalReloadsCompleted()" + "TotalReloadsCompleted" ] } ] @@ -22422,7 +23055,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShotsBeforeNextReload()" + "ShotsBeforeNextReload" ] } ] @@ -22463,7 +23096,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::Cooldown() - Object.ObjectTimerElapsedTime(\"__FireBullet.FiringCooldown\"))" + "max(0, FireCooldown - Object.ObjectTimerElapsedTime(\"__FireBullet.FiringCooldown\"))" ] } ] @@ -22516,7 +23149,60 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0, Object.Behavior::PropertyOverheatDuration() - Object.ObjectTimerElapsedTime(\"__FireBullet.OverheatDuration\"))" + "max(0, OverheatDuration - Object.ObjectTimerElapsedTime(\"__FireBullet.OverheatDuration\"))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FireBullet::FireBullet", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the remaining duration before the reload finishes, in seconds.", + "fullName": "Duration before the reload finishes", + "functionType": "ExpressionAndCondition", + "group": "Reload", + "name": "ReloadTimeLeft", + "sentence": "the remaining duration before the reload finishes", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"__FireBullet.ReloadingTimer\"", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "max(0, ReloadDuration - Object.ObjectTimerElapsedTime(\"__FireBullet.ReloadingTimer\"))" ] } ] @@ -22911,7 +23597,7 @@ "parameters": [ "Object", "Behavior", - "=", + "<=", "0" ] } @@ -22975,8 +23661,7 @@ "textG": 0, "textR": 0 }, - "comment": "Shots per reload must not be \"0\"", - "comment2": "" + "comment": "Shots per reload must not be \"0\"" }, { "type": "BuiltinCommonInstructions::Standard", @@ -23183,10 +23868,9 @@ "type": "Number", "unit": "Second", "label": "Firing cooldown", - "description": "Objects cannot shoot while firing cooldown is active", + "description": "Objects cannot shoot while firing cooldown is active.", "group": "", "extraInformation": [], - "hidden": false, "name": "FireCooldown" }, { @@ -23199,6 +23883,15 @@ "hidden": true, "name": "HasJustFired" }, + { + "value": "true", + "type": "Boolean", + "label": "Rotate bullets to match their trajectory", + "description": "", + "group": "", + "extraInformation": [], + "name": "RotateBullet" + }, { "value": "45", "type": "Number", @@ -23207,17 +23900,15 @@ "description": "Multi-Fire bullets will be evenly spaced inside the firing arc", "group": "Multi-Fire", "extraInformation": [], - "hidden": false, "name": "FiringArc" }, { "value": "1", "type": "Number", - "label": "Number of bullets created at once (Multi-Fire)", + "label": "Number of bullets created at once", "description": "Multi-Fire bullets will be evenly spaced inside the firing arc", "group": "Multi-Fire", "extraInformation": [], - "hidden": false, "name": "BulletQuantity" }, { @@ -23225,21 +23916,22 @@ "type": "Number", "unit": "DegreeAngle", "label": "Angle variance", - "description": "Make imperfect aim (Range: 0 to 180 degrees)", + "description": "Make imperfect aim (between 0 and 180 degrees).", "group": "Firing variance", "extraInformation": [], - "hidden": false, + "advanced": true, "name": "AngleVariance" }, { - "value": "true", - "type": "Boolean", - "label": "Rotate bullets to match their trajectory", - "description": "", - "group": "", + "value": "0", + "type": "Number", + "unit": "PixelSpeed", + "label": "Bullet speed variance", + "description": "Bullet speed will be adjusted by a random value within this range.", + "group": "Firing variance", "extraInformation": [], - "hidden": false, - "name": "RotateBullet" + "advanced": true, + "name": "BulletSpeedVariance" }, { "value": "0", @@ -23255,10 +23947,10 @@ "value": "0", "type": "Number", "label": "Shots per reload ", - "description": "Use 0 to disable reloading", + "description": "Use 0 to disable reloading.", "group": "Reload", "extraInformation": [], - "hidden": false, + "advanced": true, "name": "ShotsPerReload" }, { @@ -23266,10 +23958,10 @@ "type": "Number", "unit": "Second", "label": "Reloading duration", - "description": "Objects cannot shoot while reloading is in progress", + "description": "Objects cannot shoot while reloading is in progress.", "group": "Reload", "extraInformation": [], - "hidden": false, + "advanced": true, "name": "ReloadDuration" }, { @@ -23279,7 +23971,7 @@ "description": "", "group": "Ammo", "extraInformation": [], - "hidden": false, + "advanced": true, "name": "MaxAmmo" }, { @@ -23319,7 +24011,7 @@ "description": "", "group": "Ammo", "extraInformation": [], - "hidden": false, + "advanced": true, "name": "StartingAmmo" }, { @@ -23339,7 +24031,7 @@ "description": "", "group": "Ammo", "extraInformation": [], - "hidden": false, + "advanced": true, "name": "UnlimitedAmmo" }, { @@ -23355,11 +24047,11 @@ { "value": "0", "type": "Number", - "label": "Heat increase per shot (Range: 0 to 1)", - "description": " Object is overheated when Heat reaches 1", + "label": "Heat increase per shot (between 0 and 1)", + "description": " Object is overheated when Heat reaches 1.", "group": "Overheat", "extraInformation": [], - "hidden": false, + "advanced": true, "name": "HeatIncreasePerShot" }, { @@ -23379,7 +24071,7 @@ "description": "", "group": "Reload", "extraInformation": [], - "hidden": false, + "advanced": true, "name": "AutomaticReloading" }, { @@ -23387,10 +24079,10 @@ "type": "Number", "unit": "Second", "label": "Overheat duration", - "description": "Object cannot shoot while overheat duration is active", + "description": "Object cannot shoot while overheat duration is active.", "group": "Overheat", "extraInformation": [], - "hidden": false, + "advanced": true, "name": "OverheatDuration" }, { @@ -23400,27 +24092,27 @@ "description": "", "group": "Overheat", "extraInformation": [], - "hidden": false, + "advanced": true, "name": "LinearCoolingRate" }, { "value": "0.3", "type": "Number", "label": "Exponential cooling rate (per second)", - "description": "Happens faster when heat is high and slower when heat is low", + "description": "Happens faster when heat is high and slower when heat is low.", "group": "Overheat", "extraInformation": [ "Linear", "Exponential" ], - "hidden": false, + "advanced": true, "name": "ExponentialCoolingRate" }, { "value": "", "type": "String", "label": "Layer the bullets are created on", - "description": "Base layer by default", + "description": "Base layer by default.", "group": "Shooting configuration", "extraInformation": [], "hidden": true, @@ -23435,17 +24127,6 @@ "extraInformation": [], "hidden": true, "name": "RandomizedAngle" - }, - { - "value": "0", - "type": "Number", - "unit": "PixelSpeed", - "label": "Bullet speed variance", - "description": "Bullet speed will be adjusted by a random value within this range", - "group": "Firing variance", - "extraInformation": [], - "hidden": false, - "name": "BulletSpeedVariance" } ], "sharedPropertyDescriptors": [] @@ -23463,7 +24144,7 @@ "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.1.3", + "version": "1.6.1", "description": [ "Multitouch joysticks can be used the same way as physical gamepads:", "- 4 or 8 directions", @@ -23485,7 +24166,10 @@ "touchscreen", "twin stick", "shooter", - "virtual" + "virtual", + "platformer", + "platform", + "top-down" ], "authorIds": [ "gqDaZjCfevOOxBYkK6zlhtZnXCg1", @@ -23494,7 +24178,459 @@ "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": [ + { + "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": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"TargetedSpeed\"", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(0, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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 is pressed on a gamepad.", "fullName": "Multitouch controller button pressed", @@ -23507,10 +24643,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Pressed\"" ] @@ -23555,10 +24691,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Released\"" ] @@ -23605,12 +24741,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", - "GetArgumentAsString(\"ButtonState\")" + "ButtonState" ] } ] @@ -23650,12 +24786,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", "=", - "GetArgumentAsNumber(\"DeadZoneRadius\")" + "DeadZoneRadius" ] } ] @@ -23698,7 +24834,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone" ] } ] @@ -23738,7 +24874,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 4 / 360), 4)" + "mod(round(Angle * 4 / 360), 4)" ] } ] @@ -23773,7 +24909,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 8 / 360), 8)" + "mod(round(Angle * 8 / 360), 8)" ] } ] @@ -23807,7 +24943,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -23820,7 +24956,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -23844,7 +24980,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -23857,7 +24993,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -23881,7 +25017,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -23894,7 +25030,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -23918,7 +25054,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -23931,7 +25067,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -23979,7 +25115,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -23992,7 +25128,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24016,7 +25152,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownRight\"" ] @@ -24029,7 +25165,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24053,7 +25189,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -24066,7 +25202,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24090,7 +25226,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownLeft\"" ] @@ -24103,7 +25239,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24127,7 +25263,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -24140,7 +25276,7 @@ "", "=", "4", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24164,7 +25300,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpLeft\"" ] @@ -24177,7 +25313,7 @@ "", "=", "5", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24201,7 +25337,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -24214,7 +25350,7 @@ "", "=", "6", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24238,7 +25374,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpRight\"" ] @@ -24251,7 +25387,7 @@ "", "=", "7", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24300,8 +25436,7 @@ "textG": 0, "textR": 0 }, - "comment": "Make sure the joystick has moved from center", - "comment2": "" + "comment": "Make sure the joystick has moved from center" }, { "type": "BuiltinCommonInstructions::Standard", @@ -24313,9 +25448,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -24325,8 +25460,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -24381,8 +25516,7 @@ "textG": 0, "textR": 0 }, - "comment": "Make sure the joystick has moved from center", - "comment2": "" + "comment": "Make sure the joystick has moved from center" }, { "type": "BuiltinCommonInstructions::Standard", @@ -24394,9 +25528,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -24406,8 +25540,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -24447,9 +25581,10 @@ }, { "description": "the percentage the thumb has been pulled away from the joystick center (Range: 0 to 1).", - "fullName": "Joystick force", + "fullName": "Joystick force (deprecated)", "functionType": "ExpressionAndCondition", "name": "JoystickForce", + "private": true, "sentence": "Joystick _PARAM2_ of multitouch controller _PARAM1_ force", "events": [ { @@ -24461,7 +25596,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Force)" + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -24481,6 +25616,51 @@ "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": [] @@ -24499,12 +25679,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Force", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -24531,9 +25711,10 @@ }, { "description": "Return the angle the joystick is pointing towards (Range: -180 to 180).", - "fullName": "Joystick angle", + "fullName": "Joystick angle (deprecated)", "functionType": "Expression", "name": "JoystickAngle", + "private": true, "sentence": "", "events": [ { @@ -24545,7 +25726,47 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle)" + "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" ] } ] @@ -24583,12 +25804,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -24612,70 +25833,267 @@ } ], "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ + }, { - "description": "Joystick that can be controlled by interacting with a touchscreen.", - "fullName": "Multitouch Joystick", - "name": "MultitouchJoystick", - "objectType": "", - "private": true, - "eventsFunctions": [ + "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": [ { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", + "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": [], - "actions": [ + "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::SetDeadZone" + "value": "CompareArgumentAsString" }, "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyDeadZoneRadius()", - "" + "\"Side\"", + "=", + "\"Left\"" ] }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + "value": "TouchX" }, "parameters": [ - "Object", - "Behavior", + "", + "StartedTouchOrMouseId(0)", + "<", + "CameraCenterX(Object.Layer())", + "Object.Layer()", "" ] } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "parameters": [ + "\"Side\"", + "=", + "\"Right\"" + ] + }, + { + "type": { + "value": "TouchX" + }, + "parameters": [ + "", + "StartedTouchOrMouseId(0)", + ">=", + "CameraCenterX(Object.Layer())", + "Object.Layer()", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] } - ], - "objectGroups": [] + ] + } + ], + "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": "onDeActivate", + "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": [ { @@ -24738,16 +26156,6 @@ "Behavior", "" ] - }, - { - "type": { - "value": "DebuggerTools::ConsoleLog" - }, - "parameters": [ - "\"Resumed!!!\"", - "", - "" - ] } ] }, @@ -24812,8 +26220,8 @@ }, "parameters": [ "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)" + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)" ] } ], @@ -24826,7 +26234,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] } ] @@ -24862,8 +26270,7 @@ "textG": 0, "textR": 0 }, - "comment": "Move thumb back to center when not being pressed (acts like a spring on a real controller)", - "comment2": "" + "comment": "Move thumb back to center when not being pressed (acts like a spring on a real controller)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -24874,7 +26281,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -24926,8 +26333,8 @@ "parameters": [ "Object", "Behavior", - "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))", - "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))" + "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))" ] }, { @@ -24938,7 +26345,7 @@ "Object", "Behavior", "=", - "clamp(2 * DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)) / Object.Width(), 0, 1)", + "clamp(2 * DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(TouchId, Object.Layer(), 0), TouchY(TouchId, Object.Layer(), 0)) / Object.Width(), 0, 1)", "" ] } @@ -24964,7 +26371,7 @@ "objectGroups": [] }, { - "description": "the joystick force (range: 0 to 1).", + "description": "the joystick force (from 0 to 1).", "fullName": "Joystick force", "functionType": "ExpressionAndCondition", "name": "JoystickForce", @@ -24979,7 +26386,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickForce()" + "max(0, JoystickForce - DeadZoneRadius) / (1 - DeadZoneRadius)" ] } ] @@ -25023,7 +26430,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -25032,9 +26439,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickForce()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickForce", "" ] } @@ -25052,6 +26459,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "", + "name": "Parameter", + "type": "objectList" } ], "objectGroups": [] @@ -25072,7 +26484,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickAngle()" + "JoystickAngle" ] } ] @@ -25116,7 +26528,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -25125,9 +26537,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickAngle()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickAngle", "" ] } @@ -25155,193 +26567,11 @@ "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::PropertyJoystickForce" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "Object.Behavior::PropertyDeadZoneRadius()" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::IsAngleIn4WayDirection" - }, - "parameters": [ - "", - "Object.Behavior::JoystickAngle()", - "GetArgumentAsString(\"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::PropertyJoystickForce" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "Object.Behavior::PropertyDeadZoneRadius()" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::IsAngleIn8WayDirection" - }, - "parameters": [ - "", - "Object.Behavior::JoystickAngle()", - "GetArgumentAsString(\"Direction\")", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - }, - { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Check if a joystick is pressed.", - "fullName": "Joystick pressed", - "functionType": "Condition", - "name": "IsPressed", - "sentence": "Joystick _PARAM0_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" - }, - "parameters": [ - "Object", - "Behavior", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Reset the joystick values (except for angle, which stays the same)", - "fullName": "Reset", - "functionType": "Action", - "name": "Reset", - "private": true, - "sentence": "Reset the joystick of _PARAM0_", + "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", @@ -25349,30 +26579,18 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickForce" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "0" + "Object.Behavior::JoystickForce() * cos(ToRad(Object.Behavior::JoystickAngle()))" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -25389,12 +26607,11 @@ "objectGroups": [] }, { - "description": "the multitouch controller identifier.", - "fullName": "Multitouch controller identifier", - "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "ControllerIdentifier", - "sentence": "the multitouch controller identifier", + "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", @@ -25405,7 +26622,284 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyControllerIdentifier()" + "Object.Behavior::JoystickForce() * sin(ToRad(Object.Behavior::JoystickAngle()))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (4-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed4Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::IsAngleIn4WayDirection" + }, + "parameters": [ + "", + "JoystickAngle", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (8-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed8Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::IsAngleIn8WayDirection" + }, + "parameters": [ + "", + "JoystickAngle", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a joystick is pressed.", + "fullName": "Joystick pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Joystick _PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Reset the joystick values (except for angle, which stays the same)", + "fullName": "Reset", + "functionType": "Action", + "name": "Reset", + "private": true, + "sentence": "Reset the joystick of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the multitouch controller identifier.", + "fullName": "Multitouch controller identifier", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "ControllerIdentifier", + "sentence": "the multitouch controller identifier", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ControllerIdentifier" ] } ] @@ -25448,7 +26942,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -25486,7 +26980,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyJoystickIdentifier()" + "JoystickIdentifier" ] } ] @@ -25529,7 +27023,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -25567,7 +27061,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDeadZoneRadius()" + "DeadZoneRadius" ] } ] @@ -25610,7 +27104,59 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "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": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -25627,6 +27173,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "Touch identifier", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -25640,7 +27191,6 @@ "description": "", "group": "", "extraInformation": [], - "hidden": false, "name": "ControllerIdentifier" }, { @@ -25650,7 +27200,6 @@ "description": "", "group": "", "extraInformation": [], - "hidden": false, "name": "JoystickIdentifier" }, { @@ -25660,7 +27209,6 @@ "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", "group": "", "extraInformation": [], - "hidden": false, "name": "DeadZoneRadius" }, { @@ -25804,12 +27352,31 @@ "conditions": [ { "type": { - "value": "CollisionPoint" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)" + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer())", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer())" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyRadius" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer()), TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer()))" + ] + } ] } ], @@ -25822,7 +27389,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] }, { @@ -25878,7 +27445,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -26046,9 +27613,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyButtonIdentifier()", - "GetArgumentAsString(\"ButtonState\")", + "ControllerIdentifier", + "ButtonIdentifier", + "ButtonState", "" ] } @@ -26085,7 +27652,6 @@ "description": "", "group": "", "extraInformation": [], - "hidden": false, "name": "ControllerIdentifier" }, { @@ -26095,7 +27661,6 @@ "description": "", "group": "", "extraInformation": [], - "hidden": false, "name": "ButtonIdentifier" }, { @@ -26127,6 +27692,16 @@ "extraInformation": [], "hidden": true, "name": "IsReleased" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Triggering circle radius", + "description": "This circle adds up to the object collision mask.", + "group": "", + "extraInformation": [], + "name": "Radius" } ], "sharedPropertyDescriptors": [] @@ -26152,8 +27727,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -26180,8 +27755,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -26208,8 +27783,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -26245,8 +27820,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -26273,8 +27848,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJumpButton()", + "ControllerIdentifier", + "JumpButton", "\"Down\"" ] } @@ -26318,7 +27893,6 @@ "extraInformation": [ "PlatformBehavior::PlatformerObjectBehavior" ], - "hidden": false, "name": "Property" }, { @@ -26328,7 +27902,6 @@ "description": "", "group": "", "extraInformation": [], - "hidden": false, "name": "ControllerIdentifier" }, { @@ -26341,7 +27914,6 @@ "Primary", "Secondary" ], - "hidden": false, "name": "JoystickIdentifier" }, { @@ -26351,16 +27923,15 @@ "description": "", "group": "Controls", "extraInformation": [], - "hidden": false, "name": "JumpButton" } ], "sharedPropertyDescriptors": [] }, { - "description": "Control a top-down character with a multitouch controller.", - "fullName": "Top-down multitouch controller mapper", - "name": "TopDownMultitouchMapper", + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D platformer multitouch controller mapper", + "name": "Platformer3DMultitouchMapper", "objectType": "", "eventsFunctions": [ { @@ -26374,55 +27945,39 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "value": "SpriteMultitouchJoystick::StickForce" }, "parameters": [ - "Object", - "Behavior", - "=", - "\"Analog\"" + "", + ">", + "0", + "ControllerIdentifier", + "JoystickIdentifier", + "" ] } ], "actions": [ { "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "SpriteMultitouchJoystick::JoystickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", - "SpriteMultitouchJoystick::JoystickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "value": "Physics3D::PhysicsCharacter3D::SetForwardAngle" }, "parameters": [ "Object", - "Behavior", + "PhysicsCharacter3D", "=", - "\"360°\"" + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier) + CameraAngle(Object.Layer())" ] - } - ], - "actions": [ + }, { "type": { - "value": "TopDownMovementBehavior::SimulateStick" + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" }, "parameters": [ "Object", - "TopDownMovement", - "SpriteMultitouchJoystick::JoystickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", - "sign(SpriteMultitouchJoystick::JoystickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier()))" + "PhysicsCharacter3D", + "-90", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -26432,423 +27987,24 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "value": "SpriteMultitouchJoystick::IsButtonPressed" }, "parameters": [ - "Object", - "Behavior", - "=", - "\"8 Directions\"" + "", + "ControllerIdentifier", + "JumpButton", + "\"Down\"" ] } ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "TopDownMovementBehavior::DiagonalsAllowed" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - } - ] - }, + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "TopDownMovementBehavior::DiagonalsAllowed" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"UpLeft\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"UpRight\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"DownLeft\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"DownRight\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - } + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" ] } ] @@ -26863,7 +28019,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", + "supplementaryInformation": "SpriteMultitouchJoystick::Platformer3DMultitouchMapper", "type": "behavior" } ], @@ -26874,14 +28030,13 @@ { "value": "", "type": "Behavior", - "label": "Top-down movement behavior", + "label": "3D physics character", "description": "", "group": "", "extraInformation": [ - "TopDownMovementBehavior::TopDownMovementBehavior" + "Physics3D::PhysicsCharacter3D" ], - "hidden": false, - "name": "TopDownMovement" + "name": "PhysicsCharacter3D" }, { "value": "1", @@ -26890,140 +28045,253 @@ "description": "", "group": "", "extraInformation": [], - "hidden": false, "name": "ControllerIdentifier" }, { "value": "Primary", "type": "Choice", - "label": "Joystick name", + "label": "Walk joystick", "description": "", - "group": "", + "group": "Controls", "extraInformation": [ "Primary", "Secondary" ], - "hidden": false, "name": "JoystickIdentifier" }, { - "value": "Analog", - "type": "Choice", - "label": "Stick mode", + "value": "A", + "type": "String", + "label": "Jump button name", "description": "", "group": "Controls", - "extraInformation": [ - "Analog", - "360°", - "8 Directions" - ], - "hidden": false, - "name": "StickMode" + "extraInformation": [], + "name": "JumpButton" } ], "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [ + }, { - "defaultName": "Joystick", - "description": "Joystick for touchscreens.", - "fullName": "Multitouch Joystick", - "name": "SpriteMultitouchJoystick", + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D shooter multitouch controller mapper", + "name": "Shooter3DMultitouchMapper", + "objectType": "", "eventsFunctions": [ { "fullName": "", "functionType": "Action", - "name": "onCreated", + "name": "doStepPreEvents", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "Create" + "value": "SpriteMultitouchJoystick::StickForce" }, "parameters": [ "", - "Border", - "0", + ">", "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] - }, + } + ], + "actions": [ { "type": { - "value": "Create" + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" }, "parameters": [ - "", - "Thumb", - "0", - "0", - "" + "Object", + "PhysicsCharacter3D", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "ChangePlan" + "value": "SpriteMultitouchJoystick::IsButtonPressed" }, "parameters": [ - "Border", - "=", - "1" + "", + "ControllerIdentifier", + "JumpButton", + "\"Down\"" ] - }, + } + ], + "actions": [ { "type": { - "value": "ChangePlan" + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" }, "parameters": [ - "Thumb", - "=", - "2" + "Object", + "PhysicsCharacter3D" ] - }, - { - "type": { - "value": "SetCenter" - }, - "parameters": [ - "Border", - "=", - "0", + } + ] + } + ], + "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", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control camera rotations with a multitouch controller.", + "fullName": "First person camera multitouch controller mapper", + "name": "FirstPersonMultitouchMapper", + "objectType": "", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyCurrentRotationSpeedZ" + }, + "parameters": [ + "Object", + "Behavior", "=", - "0" + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedZ, SpriteMultitouchJoystick::StickForceX(ControllerIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" ] }, { "type": { - "value": "SetCenter" + "value": "SetAngle" }, "parameters": [ - "Thumb", - "=", - "0", + "Object", + "+", + "CurrentRotationSpeedZ * TimeDelta()" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyCurrentRotationSpeedY" + }, + "parameters": [ + "Object", + "Behavior", "=", - "0" + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedY, SpriteMultitouchJoystick::StickForceY(ControllerIdentifier, CameraStick) * VerticalRotationSpeedMax, VerticalRotationSpeedMax, VerticalRotationAcceleration, VerticalRotationDeceleration)" ] }, { "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + "value": "Scene3D::Base3DBehavior::SetRotationY" }, "parameters": [ "Object", - "" + "Object3D", + "+", + "CurrentRotationSpeedY * TimeDelta()" ] }, { "type": { - "value": "SetIncludedInParentCollisionMask" + "value": "Scene3D::Base3DBehavior::SetRotationY" }, "parameters": [ - "Thumb", + "Object", + "Object3D", + "=", + "clamp(Object.Object3D::RotationY(), VerticalAngleMin, VerticalAngleMax)" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::LookFromObjectEyes" + }, + "parameters": [ + "Object", + "Behavior", "" ] } @@ -27034,17 +28302,25 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "", + "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", - "name": "doStepPostEvents", - "sentence": "", + "group": "Layers and cameras", + "name": "LookFromObjectEyes", + "private": true, + "sentence": "Move the camera to look though _PARAM0_ eyes", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -27052,13 +28328,62 @@ "actions": [ { "type": { - "value": "MettreAutour" + "value": "CentreCamera" }, "parameters": [ - "Thumb", - "Border", - "Border.MultitouchJoystick::JoystickForce() * Border.Width() / 2", - "Border.MultitouchJoystick::JoystickAngle()" + "", + "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()", + "" ] } ] @@ -27068,17 +28393,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "", - "functionType": "Action", - "name": "onHotReloading", - "sentence": "", + "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", @@ -27086,33 +28418,39 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "" + "HorizontalRotationSpeedMax" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "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_", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationSpeedMax", + "name": "SetHorizontalRotationSpeedMax", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -27120,38 +28458,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "=", - "Object.PropertyControllerIdentifier()", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "=", - "Object.PropertyJoystickIdentifier()", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationSpeedMax" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "Object.PropertyDeadZoneRadius()", - "" + "Value" ] } ] @@ -27161,114 +28474,78 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "De/activate control of the joystick.", - "fullName": "De/activate control", - "functionType": "Action", - "name": "ActivateControl", - "sentence": "Activate control of _PARAM0_: _PARAM1_", + "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": [ - { - "type": { - "inverted": true, - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"ShouldActivate\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "no" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"ShouldActivate\"" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "ActivateBehavior" + "value": "SetReturnNumber" }, "parameters": [ - "Border", - "MultitouchJoystick", - "yes" + "HorizontalRotationAcceleration" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Activate", - "name": "ShouldActivate", - "type": "yesorno" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if a joystick is pressed.", - "fullName": "Joystick pressed", - "functionType": "Condition", - "name": "IsPressed", - "sentence": "Joystick _PARAM0_ is pressed", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationAcceleration", + "name": "SetHorizontalRotationAcceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsPressed" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "!=" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationAcceleration" }, "parameters": [ - "True" + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -27278,18 +28555,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the joystick force (range: 0 to 1).", - "fullName": "Joystick force", + "description": "the horizontal rotation deceleration of the object.", + "fullName": "Horizontal rotation deceleration", "functionType": "ExpressionAndCondition", - "name": "JoystickForce", - "sentence": "the joystick force", + "group": "First person camera multitouch controller mapper horizontal rotation configuration", + "name": "HorizontalRotationDeceleration", + "sentence": "the horizontal rotation deceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -27300,7 +28583,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyJoystickForce()" + "HorizontalRotationDeceleration" ] } ] @@ -27313,17 +28596,22 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Return the angle the joystick is pointing towards (Range: -180 to 180).", - "fullName": "Joystick angle", - "functionType": "Expression", - "name": "JoystickAngle", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationDeceleration", + "name": "SetHorizontalRotationDeceleration", "sentence": "", "events": [ { @@ -27332,107 +28620,94 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationDeceleration" }, "parameters": [ - "Border.MultitouchJoystick::PropertyJoystickAngle()" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "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 _PARAM1_", + "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": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "GetArgumentAsString(\"Direction\")", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "VerticalRotationSpeedMax" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", - "type": "stringWithSelector" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "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_", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationSpeedMax", + "name": "SetVerticalRotationSpeedMax", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "GetArgumentAsString(\"Direction\")", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationSpeedMax" }, "parameters": [ - "True" + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -27442,25 +28717,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", - "type": "stringWithSelector" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the multitouch controller identifier (1, 2, 3, 4...).", - "fullName": "Multitouch controller identifier", + "description": "the vertical rotation acceleration of the object.", + "fullName": "Vertical rotation acceleration", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "ControllerIdentifier", - "sentence": "the multitouch controller identifier", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalRotationAcceleration", + "sentence": "the vertical rotation acceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -27471,7 +28745,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyControllerIdentifier()" + "VerticalRotationAcceleration" ] } ] @@ -27484,8 +28758,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -27493,8 +28772,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "ControllerIdentifier", - "name": "SetControllerIdentifier", + "getterName": "VerticalRotationAcceleration", + "name": "SetVerticalRotationAcceleration", "sentence": "", "events": [ { @@ -27503,14 +28782,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationAcceleration" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "Value" ] } ] @@ -27520,19 +28798,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the joystick name of the object.", - "fullName": "Joystick name", + "description": "the vertical rotation deceleration of the object.", + "fullName": "Vertical rotation deceleration", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "JoystickIdentifier", - "sentence": "the joystick name", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalRotationDeceleration", + "sentence": "the vertical rotation deceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -27540,24 +28823,29 @@ "actions": [ { "type": { - "value": "SetReturnString" + "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyJoystickIdentifier()" + "VerticalRotationDeceleration" ] } ] } ], "expressionType": { - "type": "string" + "type": "expression" }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -27565,8 +28853,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "JoystickIdentifier", - "name": "SetJoystickIdentifier", + "getterName": "VerticalRotationDeceleration", + "name": "SetVerticalRotationDeceleration", "sentence": "", "events": [ { @@ -27575,14 +28863,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationDeceleration" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsString(\"Value\")", - "" + "Value" ] } ] @@ -27592,19 +28879,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "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", + "description": "the minimum vertical camera angle of the object.", + "fullName": "Minimum vertical camera angle", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "DeadZoneRadius", - "sentence": "the dead zone radius", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalAngleMin", + "sentence": "the minimum vertical camera angle", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -27615,7 +28907,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyDeadZoneRadius()" + "VerticalAngleMin" ] } ] @@ -27628,8 +28920,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -27637,8 +28934,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "DeadZoneRadius", - "name": "SetDeadZoneRadius", + "getterName": "VerticalAngleMin", + "name": "SetVerticalAngleMin", "sentence": "", "events": [ { @@ -27647,14 +28944,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMin" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "Value" ] } ] @@ -27664,271 +28960,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "1", - "type": "Number", - "label": "Multitouch controller identifier (1, 2, 3, 4...)", - "description": "", - "group": "", - "extraInformation": [], - "hidden": false, - "name": "ControllerIdentifier" - }, - { - "value": "Primary", - "type": "Choice", - "label": "Joystick name", - "description": "", - "group": "", - "extraInformation": [ - "Primary", - "Secondary" - ], - "hidden": false, - "name": "JoystickIdentifier" - }, - { - "value": "0.4", - "type": "Number", - "label": "Dead zone radius (range: 0 to 1)", - "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", - "group": "", - "extraInformation": [], - "hidden": false, - "name": "DeadZoneRadius" - }, - { - "value": "Center-center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [ - "Thumb" - ], - "hidden": true, - "name": "ThumbAnchorOrigin" - }, - { - "value": "Center-center", - "type": "Number", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ThumbAnchorTarget" - }, - { - "value": "true", - "type": "Boolean", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [ - "Thumb" - ], - "hidden": true, - "name": "ThumbIsScaledProportionally" - }, - { - "value": "Center-center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ParentOrigin" - } - ], - "objects": [ - { - "assetStoreId": "", - "name": "Thumb", - "tags": "", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [], - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [] - } - ] - } - ] - }, - { - "assetStoreId": "", - "name": "Border", - "tags": "", - "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": [] - } - ] - } - ] - } - ] - } - ] - }, - { - "author": "", - "category": "User interface", - "extensionNamespace": "", - "fullName": "Resource bar (continuous)", - "helpPath": "/objects/resource-bar", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8cGF0aCBkPSJNMjgsMTJIMTRINGMtMi4yLDAtNCwxLjgtNCw0czEuOCw0LDQsNGgxMGgxNGMyLjIsMCw0LTEuOCw0LTRTMzAuMiwxMiwyOCwxMnogTTQsMThjLTEuMSwwLTItMC45LTItMnMwLjktMiwyLTJoMTANCgljMS4xLDAsMiwwLjksMiwycy0wLjksMi0yLDJINHoiLz4NCjwvc3ZnPg0K", - "name": "PanelSpriteContinuousBar", - "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Interface Elements/ea06363a57846caab544f536b78a952234b68d4941d41c1577852a1d61aefec3_Interface Elements_interface_ui_loading_progress_bar.svg", - "shortDescription": "A bar that represents a resource in the game (health, mana, ammo, etc).", - "version": "1.1.1", - "description": [ - "A bar that represents a resource in the game (health, mana, ammo, etc).", - "", - "There are ready-to-use resource bars in the asset-store [resource bars pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=resource-bars-resource-bars)." - ], - "origin": { - "identifier": "PanelSpriteContinuousBar", - "name": "gdevelop-extension-store" - }, - "tags": [ - "resource", - "bar", - "health", - "mana", - "shield", - "hearts", - "lives", - "ammo" - ], - "authorIds": [ - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", - "gqDaZjCfevOOxBYkK6zlhtZnXCg1", - "q8ubdigLvIRXLxsJDDTaokO41mc2" - ], - "dependencies": [], - "eventsFunctions": [], - "eventsBasedBehaviors": [ - { - "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", - "fullName": "Resource bar", - "name": "ResourceBar", - "objectType": "", - "private": true, - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "This is done after the events to allow users to read the previous value at the end of the change.", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "CompareObjectTimer" - }, - "parameters": [ - "Object", - "\"__ResourceBar.LastValueChange\"", - "<=", - "Object.Behavior::PropertyPreviousHighValueDuration()" - ] - } - ], - "actions": [ - { - "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::UpdatePreviousHighValue" - }, - "parameters": [ - "Object", - "Behavior", - "=" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", - "type": "behavior" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the value of the object.", - "fullName": "Value", + "description": "the maximum vertical camera angle of the object.", + "fullName": "Maximum vertical camera angle", "functionType": "ExpressionAndCondition", - "name": "Value", - "sentence": "the value", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalAngleMax", + "sentence": "the maximum vertical camera angle", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -27939,7 +28988,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyValue()" + "VerticalAngleMax" ] } ] @@ -27957,7 +29006,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], @@ -27966,8 +29015,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "Value", - "name": "SetValue", + "getterName": "VerticalAngleMax", + "name": "SetVerticalAngleMax", "sentence": "", "events": [ { @@ -27976,68 +29025,13 @@ "actions": [ { "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::SetPropertyValue" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMax" }, "parameters": [ "Object", "Behavior", "=", - "clamp(GetArgumentAsNumber(\"Value\"), 0, Object.Behavior::MaxValue())" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::PropertyValue" - }, - "parameters": [ - "Object", - "Behavior", - "<", - "Object.Behavior::PreviousHighValue()" - ] - } - ], - "actions": [ - { - "type": { - "value": "ResetObjectTimer" - }, - "parameters": [ - "Object", - "\"__ResourceBar.LastValueChange\"" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::PropertyValue" - }, - "parameters": [ - "Object", - "Behavior", - ">=", - "Object.Behavior::PropertyPreviousHighValue()" - ] - } - ], - "actions": [ - { - "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::UpdatePreviousHighValue" - }, - "parameters": [ - "Object", - "Behavior", - "" + "Value" ] } ] @@ -28052,19 +29046,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], "objectGroups": [] }, { - "description": "the maximum value of the object.", - "fullName": "Maximum value", + "description": "the z position offset of the object.", + "fullName": "Z position offset", "functionType": "ExpressionAndCondition", - "group": "Resource bar configuration", - "name": "MaxValue", - "sentence": "the maximum value", + "group": "First person camera multitouch controller mapper position configuration", + "name": "OffsetZ", + "sentence": "the z position offset", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -28075,7 +29069,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxValue()" + "OffsetZ" ] } ] @@ -28093,7 +29087,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], @@ -28102,8 +29096,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "MaxValue", - "name": "SetMaxValue", + "getterName": "OffsetZ", + "name": "SetOffsetZ", "sentence": "", "events": [ { @@ -28112,13 +29106,13 @@ "actions": [ { "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::SetPropertyMaxValue" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyOffsetZ" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28133,170 +29127,649 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "description": "", + "group": "", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "name": "Object3D" }, { - "description": "Check if the bar is empty.", - "fullName": "Empty", - "functionType": "Condition", - "name": "IsEmpty", - "sentence": "_PARAM0_ bar is empty", + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Secondary", + "type": "Choice", + "label": "Camera joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "CameraStick" + }, + { + "value": "180", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationSpeedMax" + }, + { + "value": "360", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationAcceleration" + }, + { + "value": "720", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationDeceleration" + }, + { + "value": "120", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationSpeedMax" + }, + { + "value": "240", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationAcceleration" + }, + { + "value": "480", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationDeceleration" + }, + { + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Minimum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMin" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Maximum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z position offset", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Z", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Y", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedY" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a top-down character with a multitouch controller.", + "fullName": "Top-down multitouch controller mapper", + "name": "TopDownMultitouchMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::PropertyValue" + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" }, "parameters": [ "Object", "Behavior", "=", - "0" + "\"Analog\"" ] } ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "TopDownMovementBehavior::SimulateStick" }, "parameters": [ - "True" + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the bar is full.", - "fullName": "Full", - "functionType": "Condition", - "name": "IsFull", - "sentence": "_PARAM0_ bar is full", - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::PropertyValue" + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" }, "parameters": [ "Object", "Behavior", "=", - "Object.Behavior::PropertyMaxValue()" + "\"360°\"" ] } ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "TopDownMovementBehavior::SimulateStick" }, "parameters": [ - "True" + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "sign(SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the previous high value of the resource bar before the current change.", - "fullName": "Previous high value", - "functionType": "ExpressionAndCondition", - "name": "PreviousHighValue", - "sentence": "the previous high value", - "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" }, "parameters": [ - "Object.Behavior::PropertyPreviousHighValue()" + "Object", + "Behavior", + "=", + "\"8 Directions\"" ] } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Force the previous resource value to update to the current one.", - "fullName": "Update previous value", - "functionType": "Action", - "name": "UpdatePreviousHighValue", - "sentence": "Update the previous resource value of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + ], + "actions": [], + "events": [ { - "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::SetPropertyPreviousHighValue" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyValue()" + "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" + ] + } + ] + } ] } ] @@ -28311,58 +29784,81 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", "type": "behavior" } ], "objectGroups": [] - }, + } + ], + "propertyDescriptors": [ { - "description": "the previous high value conservation duration (in seconds) of the object.", - "fullName": "Previous high value conservation duration", - "functionType": "ExpressionAndCondition", - "group": "FillBar bar configuration", - "name": "PreviousHighValueDuration", - "sentence": "the previous high value conservation duration", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyPreviousHighValueDuration()" - ] - } - ] - } + "value": "", + "type": "Behavior", + "label": "Top-down movement behavior", + "description": "", + "group": "", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", - "type": "behavior" - } + "name": "TopDownMovement" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "description": "", + "group": "", + "extraInformation": [ + "Primary", + "Secondary" ], - "objectGroups": [] + "name": "JoystickIdentifier" }, + { + "value": "Analog", + "type": "Choice", + "label": "Stick mode", + "description": "", + "group": "Controls", + "extraInformation": [ + "Analog", + "360°", + "8 Directions" + ], + "name": "StickMode" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [ + { + "areaMaxX": 64, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "defaultName": "Joystick", + "description": "Joystick for touchscreens.", + "fullName": "Multitouch Joystick", + "isUsingLegacyInstancesRenderer": true, + "name": "SpriteMultitouchJoystick", + "eventsFunctions": [ { "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "PreviousHighValueDuration", - "name": "SetPreviousHighValueDuration", + "functionType": "Action", + "name": "onCreated", "sentence": "", "events": [ { @@ -28371,74 +29867,88 @@ "actions": [ { "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::SetPropertyPreviousHighValueDuration" + "value": "Create" }, "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "", + "Border", + "0", + "0", + "" ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the resource value is changing.", - "fullName": "Value is changing", - "functionType": "Condition", - "name": "IsChanging", - "sentence": "_PARAM0_ value is changing", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::PreviousHighValue" + "value": "Create" }, "parameters": [ - "Object", - "Behavior", - "!=", - "Object.Behavior::PropertyValue()", + "", + "Thumb", + "0", + "0", "" ] }, { "type": { - "value": "CompareObjectTimer" + "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", - "\"__ResourceBar.LastValueChange\"", - "<=", - "Object.Behavior::PropertyPreviousHighValueDuration()" + "" ] - } - ], - "actions": [ + }, { "type": { - "value": "SetReturnBoolean" + "value": "SetIncludedInParentCollisionMask" }, "parameters": [ - "True" + "Thumb", + "" ] } ] @@ -28448,358 +29958,251 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", - "type": "behavior" } ], "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "1", - "type": "Number", - "label": "Value", - "description": "", - "group": "", - "extraInformation": [], - "hidden": false, - "name": "Value" - }, - { - "value": "3", - "type": "Number", - "label": "Maximum value", - "description": "", - "group": "", - "extraInformation": [], - "hidden": false, - "name": "MaxValue" - }, - { - "value": "", - "type": "Number", - "label": "Previous high value", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "PreviousHighValue" }, - { - "value": "1", - "type": "Number", - "label": "Previous high value conservation duration (in seconds)", - "description": "", - "group": "", - "extraInformation": [], - "hidden": false, - "name": "PreviousHighValueDuration" - } - ], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [ - { - "defaultName": "ResourceBar", - "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", - "fullName": "Resource bar (continuous)", - "name": "PanelSpriteContinuousBar", - "eventsFunctions": [ { "fullName": "", "functionType": "Action", - "name": "onCreated", + "name": "doStepPostEvents", "sentence": "", "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "This allows to detect a change of \"intial value\" on hot reload.", - "comment2": "" - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPropertyPreviousInitialValue" + "value": "MettreAutour" }, "parameters": [ - "Object", - "=", - "Object.PropertyInitialValue()" + "Thumb", + "Border", + "Border.MultitouchJoystick::JoystickForce() * Border.Width() / 2", + "Border.MultitouchJoystick::JoystickAngle()" ] } ] }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Create the child-object instances.", - "comment2": "" - }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "Create" + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::PropertyShouldBeHiddenWhenReleased" }, "parameters": [ - "", - "Background", - "0", - "0", - "" + "Object" ] }, { "type": { - "value": "Create" + "inverted": true, + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" }, "parameters": [ - "", - "FillBar", - "0", - "0", + "Object", "" ] - }, + } + ], + "actions": [ { "type": { - "value": "ChangePlan" + "value": "Cache" }, "parameters": [ - "Background", - "=", - "1" + "Object" ] }, { "type": { - "value": "ChangePlan" + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" }, "parameters": [ - "FillBar", - "=", - "3" + "Object", + "no", + "" ] } ] - }, + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyPreviousHighValueDuration" - }, - "parameters": [ - "Object", - ">", - "0" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "Create" + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" }, "parameters": [ - "", - "Buffer", - "0", - "0", + "Object", "" ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Buffer", - "=", - "2" - ] } ] - }, + } + ], + "parameters": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Create the label over the bar.", - "comment2": "" - }, + "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": "Create" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" }, "parameters": [ - "", - "Label", - "0", - "0", + "Border", + "MultitouchJoystick", + "=", + "ControllerIdentifier", "" ] }, { "type": { - "value": "ChangePlan" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" }, "parameters": [ - "Label", + "Border", + "MultitouchJoystick", "=", - "4" - ] - }, - { - "type": { - "value": "TextObject::SetTextAlignment" - }, - "parameters": [ - "Label", - "\"center\"" + "JoystickIdentifier", + "" ] }, { "type": { - "value": "TextObject::SetWrapping" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" }, "parameters": [ - "Label", - "yes" + "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": { - "inverted": true, - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyShowLabel" + "value": "HasAnyTouchOrMouseStarted" }, "parameters": [ - "Object" + "" ] } ], "actions": [ { "type": { - "value": "Cache" - }, - "parameters": [ - "Label" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Pass the configuration to the behavior.", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetMaxValue" + "value": "MettreXY" }, "parameters": [ "Object", "=", - "Object.PropertyMaxValue()", - "Object.PropertyMaxValue()" + "Object.ParentTouchX(StartedTouchOrMouseId(0))", + "=", + "Object.ParentTouchY(StartedTouchOrMouseId(0))" ] }, { "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetValue" + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" }, "parameters": [ "Object", - "=", - "Object.PropertyInitialValue()", - "Object.PropertyInitialValue()" + "yes", + "" ] }, { "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPreviousValueDuration" + "value": "Montre" }, "parameters": [ "Object", - "=", - "Object.PropertyPreviousHighValueDuration()", "" ] }, { "type": { - "value": "Tween::RemoveTween" + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::SetPropertyShouldBeHiddenWhenReleased" }, "parameters": [ - "FillBar", - "Tween", - "\"ChangeValue\"" + "Object", + "yes" ] }, { "type": { - "value": "PanelSpriteObject::Width" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::ForceStartPressing" }, "parameters": [ - "FillBar", - "=", - "Object.WidthForValue()" + "Border", + "MultitouchJoystick", + "StartedTouchOrMouseId(0)", + "" ] } ] @@ -28809,40 +30212,127 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" } ], "objectGroups": [] }, { - "fullName": "", - "functionType": "Action", - "name": "onHotReloading", + "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": [ + "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": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLayout" + "inverted": true, + "value": "GetArgumentAsBoolean" }, "parameters": [ - "Object", - "" + "\"ShouldActivate\"" ] - }, + } + ], + "actions": [ { "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetMaxValue" + "value": "ActivateBehavior" }, "parameters": [ - "Object", - "=", - "Object.PropertyMaxValue()", - "Object.PropertyMaxValue()" + "Border", + "MultitouchJoystick", + "no" ] } ] @@ -28852,320 +30342,233 @@ "conditions": [ { "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyInitialValue" + "value": "GetArgumentAsBoolean" }, "parameters": [ - "Object", - "!=", - "Object.PropertyPreviousInitialValue()" + "\"ShouldActivate\"" ] } ], "actions": [ { "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPropertyPreviousInitialValue" + "value": "ActivateBehavior" }, "parameters": [ - "Object", - "=", - "Object.PropertyInitialValue()" + "Border", + "MultitouchJoystick", + "yes" ] - }, - { - "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetValue" - }, - "parameters": [ - "Object", - "=", - "Object.PropertyInitialValue()", - "Object.PropertyInitialValue()" - ] - }, + } + ] + } + ], + "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": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPreviousValueDuration" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsPressed" }, "parameters": [ - "Object", - "=", - "Object.PropertyPreviousHighValueDuration()", - "" + "Border", + "MultitouchJoystick", + "!=" ] - }, + } + ], + "actions": [ { "type": { - "value": "Tween::RemoveTween" + "value": "SetReturnBoolean" }, "parameters": [ - "FillBar", - "Tween", - "\"ChangeValue\"" + "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": "PanelSpriteObject::Width" + "value": "SetReturnNumber" }, "parameters": [ - "FillBar", - "=", - "Object.WidthForValue()" + "Border.MultitouchJoystick::JoystickForce()" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" } ], "objectGroups": [] }, { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", + "description": "the strick force (from 0 to 1).", + "fullName": "Stick force", + "functionType": "ExpressionAndCondition", + "name": "StickForce", + "sentence": "the stick force", "events": [ - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Resize", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Children instances must be resized when the parent size change:\n- background is resized to take the full dimensions of the parent\n- the bar size is refreshed according to the value\n- the label is put back at the center of the bar\n\nThe scale is set back to 1 because it means that the parent instance has the same dimensions as the union of its children instances.", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Width()", - "!=", - "max(Background.BoundingBoxRight(), Label.BoundingBoxRight()) - min(Background.BoundingBoxLeft(), Label.BoundingBoxLeft())" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Height()", - "!=", - "max(Background.BoundingBoxBottom(), Label.BoundingBoxBottom()) - min(Background.BoundingBoxTop(), Label.BoundingBoxTop())" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Background", - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Background", - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::Scale" - }, - "parameters": [ - "Object", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Background.Variable(Width)" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Background.Variable(Height)" - ] - }, - { - "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLayout" - }, - "parameters": [ - "Object", - "" - ] - } - ] - } - ], - "parameters": [] - }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::IsChanging" - }, - "parameters": [ - "Object", - "" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "Tween::AddObjectWidthTween" + "value": "SetReturnNumber" }, "parameters": [ - "Buffer", - "Tween", - "\"ChangeValue\"", - "Object.WidthForValue()", - "\"linear\"", - "Object.PropertyEasingDuration() * 1000", - "" + "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": [ - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "FillBar", - "<", - "Buffer.Width()" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "Montre" + "value": "SetReturnNumber" }, "parameters": [ - "Buffer", - "" + "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": [ - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "FillBar", - ">=", - "Buffer.Width()" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "Cache" + "value": "SetReturnNumber" }, "parameters": [ - "Buffer" + "Border.MultitouchJoystick::StickForceY()" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" } ], "objectGroups": [] }, { - "description": "Center the bar according to the button configuration. This is used in doStepPostEvents when the button is resized.", - "fullName": "Update layout", - "functionType": "Action", - "name": "UpdateLayout", + "description": "Return the angle the joystick is pointing towards (from -180 to 180).", + "fullName": "Joystick angle (deprecated)", + "functionType": "Expression", + "name": "JoystickAngle", "private": true, - "sentence": "Update layout of _PARAM0_", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -29173,120 +30576,142 @@ "actions": [ { "type": { - "value": "MettreXY" - }, - "parameters": [ - "FillBar", - "=", - "Object.PropertyBarLeftPadding()", - "=", - "Object.PropertyBarTopPadding()" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "FillBar", - "=", - "Object.WidthForValue()" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" + "value": "SetReturnNumber" }, "parameters": [ - "FillBar", - "=", - "round(Background.Height() - Object.PropertyBarTopPadding() - Object.PropertyBarBottomPadding())" + "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": "MettreXY" + "value": "SetReturnNumber" }, "parameters": [ - "Buffer", - "=", - "FillBar.X()", - "=", - "FillBar.Y()" + "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": "PanelSpriteObject::Width" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed4Way" }, "parameters": [ - "Buffer", - "=", - "FillBar.Width()" + "Border", + "MultitouchJoystick", + "Direction", + "" ] - }, + } + ], + "actions": [ { "type": { - "value": "PanelSpriteObject::Height" + "value": "SetReturnBoolean" }, "parameters": [ - "Buffer", - "=", - "FillBar.Height()" + "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": [], - "actions": [ - { - "type": { - "value": "MettreXY" - }, - "parameters": [ - "Label", - "=", - "Object.PropertyBarLeftPadding()", - "=", - "Object.PropertyBarTopPadding()" - ] - }, - { - "type": { - "value": "TextObject::WrappingWidth" - }, - "parameters": [ - "Label", - "=", - "Object.FullBarWidth()" - ] - }, + "conditions": [ { "type": { - "value": "SetCenterY" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed8Way" }, "parameters": [ - "Label", - "=", - "FillBar.CenterY()" + "Border", + "MultitouchJoystick", + "Direction", + "" ] - }, + } + ], + "actions": [ { "type": { - "value": "SetCenterX" + "value": "SetReturnBoolean" }, "parameters": [ - "Label", - "=", - "Background.CenterX() + (Object.PropertyBarLeftPadding() - Object.PropertyBarRightPadding()) / 2" + "True" ] } ] @@ -29296,19 +30721,25 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" } ], "objectGroups": [] }, { - "description": "the value of the object.", - "fullName": "Value", + "description": "the multitouch controller identifier (1, 2, 3, 4...).", + "fullName": "Multitouch controller identifier", "functionType": "ExpressionAndCondition", - "group": "Resource bar", - "name": "Value", - "sentence": "the value", + "group": "Multitouch Joystick configuration", + "name": "ControllerIdentifier", + "sentence": "the multitouch controller identifier", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -29319,7 +30750,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "FillBar.ResourceBar::Value()" + "Border.MultitouchJoystick::PropertyControllerIdentifier()" ] } ] @@ -29332,7 +30763,7 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" } ], @@ -29341,8 +30772,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "Value", - "name": "SetValue", + "getterName": "ControllerIdentifier", + "name": "SetControllerIdentifier", "sentence": "", "events": [ { @@ -29351,114 +30782,86 @@ "actions": [ { "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::SetValue" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" }, "parameters": [ - "FillBar", - "ResourceBar", + "Border", + "MultitouchJoystick", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyEasingDuration" - }, - "parameters": [ - "Object", - ">", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "Tween::AddObjectWidthTween" - }, - "parameters": [ - "FillBar", - "Tween", - "\"ChangeValue\"", - "Object.WidthForValue()", - "\"linear\"", - "Object.PropertyEasingDuration() * 1000", - "" - ] - } - ] - }, + } + ], + "parameters": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyEasingDuration" - }, - "parameters": [ - "Object", - "<=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "FillBar", - "=", - "Object.WidthForValue()" - ] - } - ] - }, + "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": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLabel" + "value": "SetReturnString" }, "parameters": [ - "Object", - "" + "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": [ - { - "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::IsChanging" - }, - "parameters": [ - "FillBar", - "ResourceBar", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "PanelSpriteObject::Width" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" }, "parameters": [ - "Buffer", + "Border", + "MultitouchJoystick", "=", - "round(Object.FullBarWidth() * FillBar.ResourceBar::PreviousHighValue() / FillBar.ResourceBar::MaxValue())" + "Value", + "" ] } ] @@ -29468,25 +30871,19 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "the maximum value of the object.", - "fullName": "Maximum value", + "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": "Resource bar configuration", - "name": "MaxValue", - "sentence": "the maximum value", + "group": "Multitouch Joystick configuration", + "name": "DeadZoneRadius", + "sentence": "the dead zone radius", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -29497,7 +30894,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "FillBar.ResourceBar::PropertyMaxValue()" + "Border.MultitouchJoystick::PropertyDeadZoneRadius()" ] } ] @@ -29510,7 +30907,7 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" } ], @@ -29519,8 +30916,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "MaxValue", - "name": "SetMaxValue", + "getterName": "DeadZoneRadius", + "name": "SetDeadZoneRadius", "sentence": "", "events": [ { @@ -29529,31 +30926,13 @@ "actions": [ { "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::SetMaxValue" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" }, "parameters": [ - "FillBar", - "ResourceBar", + "Border", + "MultitouchJoystick", "=", - "GetArgumentAsNumber(\"Value\")", - "" - ] - }, - { - "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLabel" - }, - "parameters": [ - "Object", - "" - ] - }, - { - "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLayout" - }, - "parameters": [ - "Object", + "Value", "" ] } @@ -29564,91 +30943,296 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", - "type": "behavior" } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" }, { - "description": "Check if the bar is empty.", - "fullName": "Empty", - "functionType": "Condition", - "group": "Resource bar", - "name": "IsEmpty", - "sentence": "_PARAM0_ is empty", - "events": [ + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "description": "", + "group": "", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "0.4", + "type": "Number", + "label": "Dead zone radius (range: 0 to 1)", + "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", + "group": "", + "extraInformation": [], + "name": "DeadZoneRadius" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Thumb" + ], + "hidden": true, + "name": "ThumbAnchorOrigin" + }, + { + "value": "Center-center", + "type": "Number", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ThumbAnchorTarget" + }, + { + "value": "true", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Thumb" + ], + "hidden": true, + "name": "ThumbIsScaledProportionally" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ParentOrigin" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShouldBeHiddenWhenReleased" + } + ], + "objects": [ + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Thumb", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "name": "Idle", + "useMultipleDirections": false, + "directions": [ { - "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::IsEmpty" - }, - "parameters": [ - "FillBar", - "ResourceBar", - "=" - ] + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] } - ], - "actions": [ + ] + } + ] + }, + { + "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": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] } ] } - ], - "parameters": [ + ] + } + ], + "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": [ { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", - "type": "object" + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 } ], - "objectGroups": [] - }, + "effects": [] + } + ], + "instances": [] + } + ] + }, + { + "author": "", + "category": "User interface", + "extensionNamespace": "", + "fullName": "Resource bar (continuous)", + "helpPath": "/objects/resource-bar", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8cGF0aCBkPSJNMjgsMTJIMTRINGMtMi4yLDAtNCwxLjgtNCw0czEuOCw0LDQsNGgxMGgxNGMyLjIsMCw0LTEuOCw0LTRTMzAuMiwxMiwyOCwxMnogTTQsMThjLTEuMSwwLTItMC45LTItMnMwLjktMiwyLTJoMTANCgljMS4xLDAsMiwwLjksMiwycy0wLjksMi0yLDJINHoiLz4NCjwvc3ZnPg0K", + "name": "PanelSpriteContinuousBar", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Interface Elements/ea06363a57846caab544f536b78a952234b68d4941d41c1577852a1d61aefec3_Interface Elements_interface_ui_loading_progress_bar.svg", + "shortDescription": "A bar that represents a resource in the game (health, mana, ammo, etc).", + "version": "1.1.3", + "description": [ + "A bar that represents a resource in the game (health, mana, ammo, etc).", + "", + "There are ready-to-use resource bars in the asset-store [resource bars pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=resource-bars-resource-bars)." + ], + "origin": { + "identifier": "PanelSpriteContinuousBar", + "name": "gdevelop-extension-store" + }, + "tags": [ + "resource", + "bar", + "health", + "mana", + "shield", + "hearts", + "lives", + "ammo" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1", + "q8ubdigLvIRXLxsJDDTaokO41mc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", + "fullName": "Resource bar", + "name": "ResourceBar", + "objectType": "", + "private": true, + "eventsFunctions": [ { - "description": "Check if the bar is full.", - "fullName": "Full", - "functionType": "Condition", - "group": "Resource bar", - "name": "IsFull", - "sentence": "_PARAM0_ is full", + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "This is done after the events to allow users to read the previous value at the end of the change." + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::IsFull" + "inverted": true, + "value": "CompareObjectTimer" }, "parameters": [ - "FillBar", - "ResourceBar", - "=" + "Object", + "\"__ResourceBar.LastValueChange\"", + "<=", + "PreviousHighValueDuration" ] } ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "PanelSpriteContinuousBar::ResourceBar::UpdatePreviousHighValue" }, "parameters": [ - "True" + "Object", + "Behavior", + "=" ] } ] @@ -29658,19 +31242,23 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the previous value conservation duration (in seconds) of the object.", - "fullName": "Previous value conservation duration", + "description": "the value of the object.", + "fullName": "Value", "functionType": "ExpressionAndCondition", - "group": "Resource bar configuration", - "name": "PreviousValueDuration", - "sentence": "the previous value conservation duration", + "name": "Value", + "sentence": "the value", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -29681,7 +31269,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "FillBar.ResourceBar::PropertyPreviousHighValueDuration()" + "Value" ] } ] @@ -29694,8 +31282,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" } ], "objectGroups": [] @@ -29703,8 +31296,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "PreviousValueDuration", - "name": "SetPreviousValueDuration", + "getterName": "Value", + "name": "SetValue", "sentence": "", "events": [ { @@ -29713,14 +31306,13 @@ "actions": [ { "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::SetPreviousHighValueDuration" + "value": "PanelSpriteContinuousBar::ResourceBar::SetPropertyValue" }, "parameters": [ - "FillBar", - "ResourceBar", + "Object", + "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "clamp(Value, 0, Object.Behavior::MaxValue())" ] } ] @@ -29730,23 +31322,24 @@ "conditions": [ { "type": { - "value": "CompareArgumentAsNumber" + "value": "PanelSpriteContinuousBar::ResourceBar::PropertyValue" }, "parameters": [ - "\"Value\"", - "!=", - "0" + "Object", + "Behavior", + "<", + "Object.Behavior::PreviousHighValue()" ] } ], "actions": [ { "type": { - "value": "Montre" + "value": "ResetObjectTimer" }, "parameters": [ - "Buffer", - "" + "Object", + "\"__ResourceBar.LastValueChange\"" ] } ] @@ -29756,22 +31349,25 @@ "conditions": [ { "type": { - "value": "CompareArgumentAsNumber" + "value": "PanelSpriteContinuousBar::ResourceBar::PropertyValue" }, "parameters": [ - "\"Value\"", - "=", - "0" + "Object", + "Behavior", + ">=", + "PreviousHighValue" ] } ], "actions": [ { "type": { - "value": "Cache" + "value": "PanelSpriteContinuousBar::ResourceBar::UpdatePreviousHighValue" }, "parameters": [ - "Buffer" + "Object", + "Behavior", + "" ] } ] @@ -29781,7 +31377,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "type": "object" }, { @@ -29794,55 +31389,51 @@ "objectGroups": [] }, { - "description": "Check if the resource value is changing.", - "fullName": "Value is changing", - "functionType": "Condition", - "group": "Resource bar", - "name": "IsChanging", - "private": true, - "sentence": "_PARAM0_ value is changing", + "description": "the maximum value of the object.", + "fullName": "Maximum value", + "functionType": "ExpressionAndCondition", + "group": "Resource bar configuration", + "name": "MaxValue", + "sentence": "the maximum value", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::IsChanging" - }, - "parameters": [ - "FillBar", - "ResourceBar", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "MaxValue" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "Value width", - "functionType": "Expression", - "name": "WidthForValue", - "private": true, + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MaxValue", + "name": "SetMaxValue", "sentence": "", "events": [ { @@ -29851,80 +31442,101 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "PanelSpriteContinuousBar::ResourceBar::SetPropertyMaxValue" }, "parameters": [ - "round(Object.FullBarWidth() * FillBar.ResourceBar::Value() / FillBar.ResourceBar::MaxValue())" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "", - "functionType": "Expression", - "name": "FullBarWidth", - "private": true, - "sentence": "", + "description": "Check if the bar is empty.", + "fullName": "Empty", + "functionType": "Condition", + "name": "IsEmpty", + "sentence": "_PARAM0_ bar is empty", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::PropertyValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" }, "parameters": [ - "Background.Width() - Object.PropertyBarLeftPadding() - Object.PropertyBarRightPadding()" + "True" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if the label is shown.", - "fullName": "Label is shown", + "description": "Check if the bar is full.", + "fullName": "Full", "functionType": "Condition", - "group": "Resource bar configuration", - "name": "IsLabelShown", - "sentence": "_PARAM0_ label is shown", + "name": "IsFull", + "sentence": "_PARAM0_ bar is full", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyShowLabel" + "value": "PanelSpriteContinuousBar::ResourceBar::PropertyValue" }, "parameters": [ - "Object" + "Object", + "Behavior", + "=", + "MaxValue" ] } ], @@ -29944,82 +31556,158 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Show (or hide) the label on the bar.", - "fullName": "Show label", - "functionType": "Action", - "group": "Resource bar configuration", - "name": "SetLabelShown", - "sentence": "Show the label of _PARAM0_: _PARAM1_", + "description": "the previous high value of the resource bar before the current change.", + "fullName": "Previous high value", + "functionType": "ExpressionAndCondition", + "name": "PreviousHighValue", + "sentence": "the previous high value", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "\"Value\"" + "PreviousHighValue" ] } - ], + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Force the previous resource value to update to the current one.", + "fullName": "Update previous value", + "functionType": "Action", + "name": "UpdatePreviousHighValue", + "sentence": "Update the previous resource value of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], "actions": [ { "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPropertyShowLabel" + "value": "PanelSpriteContinuousBar::ResourceBar::SetPropertyPreviousHighValue" }, "parameters": [ "Object", - "no" - ] - }, - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Label" + "Behavior", + "=", + "Value" ] } ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the previous high value conservation duration (in seconds) of the object.", + "fullName": "Previous high value conservation duration", + "functionType": "ExpressionAndCondition", + "group": "FillBar bar configuration", + "name": "PreviousHighValueDuration", + "sentence": "the previous high value conservation duration", + "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "\"Value\"" + "PreviousHighValueDuration" ] } - ], + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "PreviousHighValueDuration", + "name": "SetPreviousHighValueDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], "actions": [ { "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPropertyShowLabel" + "value": "PanelSpriteContinuousBar::ResourceBar::SetPropertyPreviousHighValueDuration" }, "parameters": [ "Object", - "yes" - ] - }, - { - "type": { - "value": "Montre" - }, - "parameters": [ - "Label", - "" + "Behavior", + "=", + "Value" ] } ] @@ -30029,37 +31717,58 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "type": "object" }, { - "description": "Show the label", - "name": "Value", - "type": "yesorno" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Update the text that display the current value and maximum value.", - "fullName": "Update label", - "functionType": "Action", - "name": "UpdateLabel", - "private": true, - "sentence": "Update label of _PARAM0_", + "description": "Check if the resource value is changing.", + "fullName": "Value is changing", + "functionType": "Condition", + "name": "IsChanging", + "sentence": "_PARAM0_ value is changing", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::PreviousHighValue" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "Value", + "" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"__ResourceBar.LastValueChange\"", + "<=", + "PreviousHighValueDuration" + ] + } + ], "actions": [ { "type": { - "value": "TextObject::String" + "value": "SetReturnBoolean" }, "parameters": [ - "Label", - "=", - "ToString(round(Object.Value())) + \" / \" + ToString(Object.MaxValue())" + "True" ] } ] @@ -30069,8 +31778,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" } ], "objectGroups": [] @@ -30078,641 +31792,473 @@ ], "propertyDescriptors": [ { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "Bar", - "extraInformation": [ - "Label", - "FillBar", - "Buffer" - ], - "hidden": false, - "name": "BarLeftPadding" - }, - { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "Bar", - "extraInformation": [ - "Label", - "FillBar", - "Buffer" - ], - "hidden": false, - "name": "BarTopPadding" - }, - { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "Bar", - "extraInformation": [ - "Label", - "FillBar", - "Buffer" - ], - "hidden": false, - "name": "BarRightPadding" - }, - { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "Bar", - "extraInformation": [ - "Label", - "FillBar", - "Buffer" - ], - "hidden": false, - "name": "BarBottomPadding" - }, - { - "value": "3", + "value": "1", "type": "Number", - "label": "Maximum value", + "label": "Value", "description": "", "group": "", "extraInformation": [], - "hidden": false, - "name": "MaxValue" + "name": "Value" }, { "value": "3", "type": "Number", - "label": "Initial value", + "label": "Maximum value", "description": "", "group": "", "extraInformation": [], - "hidden": false, - "name": "InitialValue" + "name": "MaxValue" }, { "value": "", "type": "Number", - "label": "", - "description": "It's used to detect a change at hot reload.", + "label": "Previous high value", + "description": "", "group": "", "extraInformation": [], "hidden": true, - "name": "PreviousInitialValue" + "name": "PreviousHighValue" }, { "value": "1", "type": "Number", "label": "Previous high value conservation duration (in seconds)", "description": "", - "group": "Animation", + "group": "", "extraInformation": [], - "hidden": false, "name": "PreviousHighValueDuration" - }, - { - "value": "0.25", - "type": "Number", - "label": "Easing duration", - "description": "", - "group": "Animation", - "extraInformation": [], - "hidden": false, - "name": "EasingDuration" - }, - { - "value": "true", - "type": "Boolean", - "label": "Show the label", - "description": "", - "group": "", - "extraInformation": [ - "Label" - ], - "hidden": false, - "name": "ShowLabel" - }, - { - "value": "", - "type": "Boolean", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [ - "Buffer" - ], - "hidden": true, - "name": "ShowBuffer" - }, - { - "value": "Center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [ - "Label" - ], - "hidden": true, - "name": "LabelVerticalAnchorOrigin" - }, - { - "value": "Center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [ - "FillBar" - ], - "hidden": true, - "name": "LabelVerticalAnchorTarget" } ], - "objects": [ - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "Label", - "smoothed": true, - "tags": "", - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [], - "string": "2 / 3", - "font": "", - "textAlignment": "center", - "characterSize": 20, - "color": { - "b": 0, - "g": 0, - "r": 0 - } - }, + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [ + { + "areaMaxX": 64, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "defaultName": "ResourceBar", + "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", + "fullName": "Resource bar (continuous)", + "isUsingLegacyInstancesRenderer": true, + "name": "PanelSpriteContinuousBar", + "eventsFunctions": [ { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "FillBar", - "rightMargin": 0, - "tags": "", - "texture": "", - "tiled": true, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ { - "name": "ResourceBar", - "type": "PanelSpriteContinuousBar::ResourceBar", - "Value": 1, - "MaxValue": 3, - "PreviousValue": 0 + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "This allows to detect a change of \"intial value\" on hot reload." }, { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Buffer", - "rightMargin": 0, - "tags": "", - "texture": "", - "tiled": true, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Background", - "rightMargin": 0, - "tags": "", - "texture": "", - "tiled": true, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [] - } - ] - } - ] - }, - { - "author": "Tristan Rhodes (tristan@victrisgames.com)", - "category": "", - "extensionNamespace": "", - "fullName": "Flash layer", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWZsYXNoLW91dGxpbmUiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNywySDE3TDEzLjUsOUgxN0wxMCwyMlYxNEg3VjJNOSw0VjEySDEyVjE0LjY2TDE0LDExSDEwLjI0TDEzLjc2LDRIOVoiIC8+PC9zdmc+", - "name": "FlashLayer", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/flash-outline.svg", - "shortDescription": "Make a layer visible for a specified duration, and then hide the layer.", - "version": "0.2.0", - "description": [ - "Useful to make a temporary effect (flash on hit, flickering lights, lightning flash, show text like Batman and Robin \"Bam!\", etc)", - "", - "It is recommended to select a layer on the top, and one that is hidden by default." - ], - "origin": { - "identifier": "FlashLayer", - "name": "gdevelop-extension-store" - }, - "tags": [ - "effect", - "vfx", - "layer", - "flash", - "visible", - "hide" - ], - "authorIds": [ - "gqDaZjCfevOOxBYkK6zlhtZnXCg1" - ], - "dependencies": [], - "eventsFunctions": [ - { - "description": "Make a layer visible for a specified duration, and then hide the layer.", - "fullName": "Flash layer", - "functionType": "Action", - "name": "FlashLayer", - "sentence": "Make layer _PARAM1_ visible for _PARAM2_ seconds", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Save input parameters", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarSceneTxt" - }, - "parameters": [ - "__FlashLayer_Layer", - "=", - "GetArgumentAsString(\"LayerToFlash\")" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPropertyPreviousInitialValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyInitialValue()" + ] + } ] }, { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__FlashLayer_Duration", - "=", - "GetArgumentAsNumber(\"Duration\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Set default values", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__FlashLayer_Duration", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__FlashLayer_Duration", - "=", - "0.1" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Start timer and show layer", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ResetTimer" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "", - "\"__FlashLayer_Timer\"" - ] + "comment": "Create the child-object instances." }, { - "type": { - "value": "ShowLayer" - }, - "parameters": [ - "", - "VariableString(__FlashLayer_Layer)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Background", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "FillBar", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Background", + "=", + "1" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "FillBar", + "=", + "3" + ] + } ] }, { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__FlashLayer_InProgress", - "=", - "1" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Layer (Default: \"\")", - "name": "LayerToFlash", - "type": "layer" - }, - { - "description": "Duration (seconds) (Default: 0.1) ", - "name": "Duration", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onScenePostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Hide layer, reset time-scale to initial value, and delete timer", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__FlashLayer_InProgress", - "=", - "1" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyPreviousHighValueDuration" + }, + "parameters": [ + "Object", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Buffer", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Buffer", + "=", + "2" + ] + } ] }, { - "type": { - "value": "Timer" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "", - "Variable(__FlashLayer_Duration)", - "\"__FlashLayer_Timer\"" - ] - } - ], - "actions": [ + "comment": "Create the label over the bar." + }, { - "type": { - "value": "HideLayer" - }, - "parameters": [ - "", - "VariableString(__FlashLayer_Layer)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Label", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Label", + "=", + "4" + ] + }, + { + "type": { + "value": "TextObject::SetTextAlignment" + }, + "parameters": [ + "Label", + "\"center\"" + ] + }, + { + "type": { + "value": "TextObject::SetWrapping" + }, + "parameters": [ + "Label", + "yes" + ] + } ] }, { - "type": { - "value": "RemoveTimer" - }, - "parameters": [ - "", - "\"__FlashLayer_Timer\"" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyShowLabel" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Label" + ] + } ] }, { - "type": { - "value": "ModVarScene" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "__FlashLayer_InProgress", - "=", - "0" - ] - } - ] - } - ], - "parameters": [], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [] - }, - { - "author": "@4ian", - "category": "Game mechanic", - "extensionNamespace": "", - "fullName": "Health points and damage", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWhlYXJ0LWhhbGYtZnVsbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNi41LDVDMTUsNSAxMy41OCw1LjkxIDEzLDcuMlYxNy43NEMxNy4yNSwxMy44NyAyMCwxMS4yIDIwLDguNUMyMCw2LjUgMTguNSw1IDE2LjUsNU0xNi41LDNDMTkuNTgsMyAyMiw1LjQxIDIyLDguNUMyMiwxMi4yNyAxOC42LDE1LjM2IDEzLjQ1LDIwLjAzTDEyLDIxLjM1TDEwLjU1LDIwLjAzQzUuNCwxNS4zNiAyLDEyLjI3IDIsOC41QzIsNS40MSA0LjQyLDMgNy41LDNDOS4yNCwzIDEwLjkxLDMuODEgMTIsNS4wOEMxMy4wOSwzLjgxIDE0Ljc2LDMgMTYuNSwzWiIgLz48L3N2Zz4=", - "name": "Health", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/heart-half-full.svg", - "shortDescription": "Manage health points and damage, including a protective shield and armor.", - "version": "0.2.0", - "description": [ - "Manage health points including a protective shield and armor. Health can be assigned to players, enemies, NPCs, or even inanimate objects such as breaking doors and mining rocks.", - "", - "Damage calculations are performed in this order:", - "", - "Incoming Damage -> Is Damage Cooldown active? -> Chance to Dodge -> Flat Damage Reduction -> Percent Damage Reduction -> Damage to Shield -> Damage to Health", - "", - "How to use:", - "", - "- Set desired values in behavior properties", - "- To apply damage use “Apply damage to an object”", - "- To heal health, use “Heal object” action", - "- To activate the shield, use “Activate shield” action", - "- Health and shield regeneration will happen automatically based on properties", - " ", - "Tips:", - "", - "- While damage cooldown is active, no damage will be applied to health or shield (the object is invincible)", - "- Try using the “Blink” extension while damage cooldown is active", - "- Use the “Is just damaged” or \"Is just healed\" conditions to trigger sound and visual effects", - "", - "Health properties:", - "", - "- Starting health points", - "- Maximum health points. Use \"0\" for no maximum", - "- Damage cooldown (seconds) Use \"0\" for no cooldown", - "- Rate of health regeneration (points per second)", - "- Delay before health regeneration starts after being hit (seconds)", - "- Allow heals to increase health above max health (regen will never exceed max health)", - "", - "Shield properties:", - "", - "- Max shield points. Use \"0\" for no maximum", - "- Duration of shield (seconds) Use \"0\" to make shield permanent", - "- Rate of shield regeneration (points per second)", - "- Delay before shield regeneration starts after being hit (seconds)", - "- Block excess damage when shield is broken (yes/no)", - "", - "The top-down RPG example uses this extension ([open the project online](https://editor.gdevelop.io/?project=example://top-down-rpg))." - ], - "origin": { - "identifier": "Health", - "name": "gdevelop-extension-store" - }, - "tags": [ - "health", - "life", - "damage", - "hit", - "heal", - "shield", - "regeneration", - "armor" - ], - "authorIds": [ - "wWP8BSlAW0UP4NeaHa2LcmmDzmH2", - "xpwUwByyImTDcHEqDUqfyg0oRBt1", - "gqDaZjCfevOOxBYkK6zlhtZnXCg1" - ], - "dependencies": [], - "eventsFunctions": [], - "eventsBasedBehaviors": [ - { - "description": "Manage health (life) points including a protective shield and armor.", - "fullName": "Health", - "name": "Health", - "objectType": "", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ + "comment": "Pass the configuration to the behavior." + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "ResetObjectTimer" + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetMaxValue" }, "parameters": [ "Object", - "\"__Health.TimeSinceLastHit\"" + "=", + "Object.PropertyMaxValue()", + "Object.PropertyMaxValue()" ] }, { "type": { - "value": "Health::Health::SetCurrentHealth" + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetValue" }, "parameters": [ "Object", - "Behavior", - "Object.Behavior::PropertyHealth()", + "=", + "Object.PropertyInitialValue()", + "Object.PropertyInitialValue()" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPreviousValueDuration" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyPreviousHighValueDuration()", "" ] - } - ] - } - ], - "parameters": [ - { + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "FillBar", + "Tween", + "\"ChangeValue\"" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "FillBar", + "=", + "Object.WidthForValue()" + ] + } + ] + } + ], + "parameters": [ + { "description": "Object", "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetMaxValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyMaxValue()", + "Object.PropertyMaxValue()" + ] + } + ] }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyInitialValue" + }, + "parameters": [ + "Object", + "!=", + "Object.PropertyPreviousInitialValue()" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPropertyPreviousInitialValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyInitialValue()" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetValue" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyInitialValue()", + "Object.PropertyInitialValue()" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPreviousValueDuration" + }, + "parameters": [ + "Object", + "=", + "Object.PropertyPreviousHighValueDuration()", + "" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "FillBar", + "Tween", + "\"ChangeValue\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "FillBar", + "=", + "Object.WidthForValue()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" } ], "objectGroups": [] @@ -30720,146 +32266,63 @@ { "fullName": "", "functionType": "Action", - "name": "doStepPreEvents", + "name": "doStepPostEvents", "sentence": "", "events": [ { - "colorB": 224, - "colorG": 16, - "colorR": 189, + "colorB": 228, + "colorG": 176, + "colorR": 74, "creationTime": 0, - "name": "Health", + "name": "Resize", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Regeneration", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Children instances must be resized when the parent size change:\n- background is resized to take the full dimensions of the parent\n- the bar size is refreshed according to the value\n- the label is put back at the center of the bar\n\nThe scale is set back to 1 because it means that the parent instance has the same dimensions as the union of its children instances." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "BuiltinCommonInstructions::Or" }, - "comment": "Health", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "parameters": [], + "subInstructions": [ { "type": { - "value": "Health::Health::PropertyHealthRegenRate" + "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "Object", - "Behavior", + "Object.Width()", "!=", - "0" - ] - }, - { - "type": { - "value": "Health::Health::PropertyCurrentHealth" - }, - "parameters": [ - "Object", - "Behavior", - "<", - "Object.Behavior::MaxHealth()" + "max(Background.BoundingBoxRight(), Label.BoundingBoxRight()) - min(Background.BoundingBoxLeft(), Label.BoundingBoxLeft())" ] }, { "type": { - "value": "CompareObjectTimer" - }, - "parameters": [ - "Object", - "\"__Health.TimeSinceLastHit\"", - ">", - "Object.Behavior::PropertyHealthRegenDelay()" - ] - } - ], - "actions": [ - { - "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "Object", - "Behavior", - "+", - "Object.Behavior::PropertyHealthRegenRate() * TimeDelta()" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Correct any values above maximum limits", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyCurrentHealth" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "Object.Behavior::MaxHealth()" - ] - } - ], - "actions": [ - { - "type": { - "value": "Health::Health::SetPropertyCurrentHealth" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyMaxHealth()" - ] - } + "Object.Height()", + "!=", + "max(Background.BoundingBoxBottom(), Label.BoundingBoxBottom()) - min(Background.BoundingBoxTop(), Label.BoundingBoxTop())" ] } ] } ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Reset triggers", - "source": "", - "type": "BuiltinCommonInstructions::Group", + "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -30867,363 +32330,2115 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsHealthJustDamaged" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "Width", + "=", + "Object.Width()" ] }, { "type": { - "value": "Health::Health::SetPropertyIsJustHealed" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "Height", + "=", + "Object.Height()" ] }, { "type": { - "value": "Health::Health::SetPropertyIsJustDodged" - }, - "parameters": [ - "Object", - "Behavior", - "no" - ] - } - ] - } - ], - "parameters": [] - } - ], - "parameters": [] - }, - { - "colorB": 224, - "colorG": 16, - "colorR": 189, - "creationTime": 0, - "name": "Shield", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Regeneration", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Shield", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyShieldRegenRate" + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::Scale" }, "parameters": [ "Object", - "Behavior", - "!=", - "0" + "=", + "1" ] }, { "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" + "value": "PanelSpriteObject::Width" }, "parameters": [ - "Object", - "Behavior", - "<", - "Object.Behavior::PropertyMaxShieldPoints()" + "Background", + "=", + "Width" ] }, { "type": { - "value": "CompareObjectTimer" + "value": "PanelSpriteObject::Height" }, "parameters": [ - "Object", - "\"__Health.TimeSinceLastHit\"", - ">", - "Object.Behavior::PropertyShieldRegenDelay()" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "Health::Health::RenewShieldDuration" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "Object.Behavior::PropertyShieldRegenRate() * TimeDelta()" - ] - } + "Background", + "=", + "Height" ] }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Correct any values above maximum limits", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "Object.Behavior::PropertyMaxShieldPoints()" - ] - } - ], - "actions": [ - { - "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.Behavior::PropertyMaxShieldPoints()" - ] - } - ] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Remove shield points if shield expired", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ { "type": { - "inverted": true, - "value": "Health::Health::IsShieldActive" + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLayout" }, "parameters": [ "Object", - "Behavior", "" ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] } ], - "actions": [ + "variables": [ { - "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Reset damage trigger", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "name": "Width", + "type": "number", + "value": 0 + }, { - "type": { - "value": "Health::Health::SetPropertyIsShieldJustDamaged" - }, - "parameters": [ - "Object", - "Behavior", - "no" - ] + "name": "Height", + "type": "number", + "value": 0 } ] } - ], - "parameters": [] + ] } ], "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::IsChanging" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectWidthTween" + }, + "parameters": [ + "Buffer", + "Tween", + "\"ChangeValue\"", + "Object.WidthForValue()", + "\"linear\"", + "Object.PropertyEasingDuration() * 1000", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "FillBar", + "<", + "Buffer.Width()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Buffer", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "FillBar", + ">=", + "Buffer.Width()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Buffer" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Center the bar according to the button configuration. This is used in doStepPostEvents when the button is resized.", + "fullName": "Update layout", + "functionType": "Action", + "name": "UpdateLayout", + "private": true, + "sentence": "Update layout of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "FillBar", + "=", + "Object.PropertyBarLeftPadding()", + "=", + "Object.PropertyBarTopPadding()" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "FillBar", + "=", + "Object.WidthForValue()" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "FillBar", + "=", + "round(Background.Height() - Object.PropertyBarTopPadding() - Object.PropertyBarBottomPadding())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Buffer", + "=", + "FillBar.X()", + "=", + "FillBar.Y()" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Buffer", + "=", + "FillBar.Width()" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Buffer", + "=", + "FillBar.Height()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Label", + "=", + "Object.PropertyBarLeftPadding()", + "=", + "Object.PropertyBarTopPadding()" + ] + }, + { + "type": { + "value": "TextObject::WrappingWidth" + }, + "parameters": [ + "Label", + "=", + "Object.FullBarWidth()" + ] + }, + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Label", + "=", + "FillBar.CenterY()" + ] + }, + { + "type": { + "value": "SetCenterX" + }, + "parameters": [ + "Label", + "=", + "Background.CenterX() + (Object.PropertyBarLeftPadding() - Object.PropertyBarRightPadding()) / 2" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the value of the object.", + "fullName": "Value", + "functionType": "ExpressionAndCondition", + "group": "Resource bar", + "name": "Value", + "sentence": "the value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FillBar.ResourceBar::Value()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Value", + "name": "SetValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::SetValue" + }, + "parameters": [ + "FillBar", + "ResourceBar", + "=", + "Value", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyEasingDuration" + }, + "parameters": [ + "Object", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectWidthTween" + }, + "parameters": [ + "FillBar", + "Tween", + "\"ChangeValue\"", + "Object.WidthForValue()", + "\"linear\"", + "Object.PropertyEasingDuration() * 1000", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyEasingDuration" + }, + "parameters": [ + "Object", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "FillBar", + "=", + "Object.WidthForValue()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLabel" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::IsChanging" + }, + "parameters": [ + "FillBar", + "ResourceBar", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Buffer", + "=", + "round(Object.FullBarWidth() * FillBar.ResourceBar::PreviousHighValue() / FillBar.ResourceBar::MaxValue())" + ] + } + ] } ], "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Apply damage to the object. Shield and armor can reduce this damage if enabled.", - "fullName": "Apply damage to an object", - "functionType": "Action", - "group": "Health", - "name": "Hit", - "sentence": "Apply _PARAM2_ points of damage to _PARAM0_ (Damage can be reduced by Shield: _PARAM3_, Armor: _PARAM4_)", + "description": "the maximum value of the object.", + "fullName": "Maximum value", + "functionType": "ExpressionAndCondition", + "group": "Resource bar configuration", + "name": "MaxValue", + "sentence": "the maximum value", "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Incoming damage", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FillBar.ResourceBar::PropertyMaxValue()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MaxValue", + "name": "SetMaxValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::SetMaxValue" }, - "comment": "Only consider incoming damage when damage cooldown is not active", - "comment2": "" + "parameters": [ + "FillBar", + "ResourceBar", + "=", + "Value", + "" + ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "Health::Health::IsDamageCooldownActive" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"DamageValue\")" - ] - } - ], - "events": [ - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Chance to dodge", + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLabel" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the bar is empty.", + "fullName": "Empty", + "functionType": "Condition", + "group": "Resource bar", + "name": "IsEmpty", + "sentence": "_PARAM0_ is empty", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::IsEmpty" + }, + "parameters": [ + "FillBar", + "ResourceBar", + "=" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the bar is full.", + "fullName": "Full", + "functionType": "Condition", + "group": "Resource bar", + "name": "IsFull", + "sentence": "_PARAM0_ is full", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::IsFull" + }, + "parameters": [ + "FillBar", + "ResourceBar", + "=" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the previous value conservation duration (in seconds) of the object.", + "fullName": "Previous value conservation duration", + "functionType": "ExpressionAndCondition", + "group": "Resource bar configuration", + "name": "PreviousValueDuration", + "sentence": "the previous value conservation duration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FillBar.ResourceBar::PropertyPreviousHighValueDuration()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "PreviousValueDuration", + "name": "SetPreviousValueDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::SetPreviousHighValueDuration" + }, + "parameters": [ + "FillBar", + "ResourceBar", + "=", + "Value", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"Value\"", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Buffer", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"Value\"", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Buffer" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the resource value is changing.", + "fullName": "Value is changing", + "functionType": "Condition", + "group": "Resource bar", + "name": "IsChanging", + "private": true, + "sentence": "_PARAM0_ value is changing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::ResourceBar::IsChanging" + }, + "parameters": [ + "FillBar", + "ResourceBar", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "Value width", + "functionType": "Expression", + "name": "WidthForValue", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "round(Object.FullBarWidth() * FillBar.ResourceBar::Value() / FillBar.ResourceBar::MaxValue())" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Expression", + "name": "FullBarWidth", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Background.Width() - Object.PropertyBarLeftPadding() - Object.PropertyBarRightPadding()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the label is shown.", + "fullName": "Label is shown", + "functionType": "Condition", + "group": "Resource bar configuration", + "name": "IsLabelShown", + "sentence": "_PARAM0_ label is shown", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::PropertyShowLabel" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Show (or hide) the label on the bar.", + "fullName": "Show label", + "functionType": "Action", + "group": "Resource bar configuration", + "name": "SetLabelShown", + "sentence": "Show the label of _PARAM0_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPropertyShowLabel" + }, + "parameters": [ + "Object", + "no" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Label" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPropertyShowLabel" + }, + "parameters": [ + "Object", + "yes" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Label", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + }, + { + "description": "Show the label", + "name": "Value", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Update the text that display the current value and maximum value.", + "fullName": "Update label", + "functionType": "Action", + "name": "UpdateLabel", + "private": true, + "sentence": "Update label of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextObject::String" + }, + "parameters": [ + "Label", + "=", + "ToString(round(Object.Value())) + \" / \" + ToString(Object.MaxValue())" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "Bar", + "extraInformation": [ + "Label", + "FillBar", + "Buffer" + ], + "name": "BarLeftPadding" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "Bar", + "extraInformation": [ + "Label", + "FillBar", + "Buffer" + ], + "name": "BarTopPadding" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "Bar", + "extraInformation": [ + "Label", + "FillBar", + "Buffer" + ], + "name": "BarRightPadding" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "Bar", + "extraInformation": [ + "Label", + "FillBar", + "Buffer" + ], + "name": "BarBottomPadding" + }, + { + "value": "3", + "type": "Number", + "label": "Maximum value", + "description": "", + "group": "", + "extraInformation": [], + "name": "MaxValue" + }, + { + "value": "3", + "type": "Number", + "label": "Initial value", + "description": "", + "group": "", + "extraInformation": [], + "name": "InitialValue" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "It's used to detect a change at hot reload.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "PreviousInitialValue" + }, + { + "value": "1", + "type": "Number", + "label": "Previous high value conservation duration (in seconds)", + "description": "", + "group": "Animation", + "extraInformation": [], + "name": "PreviousHighValueDuration" + }, + { + "value": "0.25", + "type": "Number", + "label": "Easing duration", + "description": "", + "group": "Animation", + "extraInformation": [], + "name": "EasingDuration" + }, + { + "value": "true", + "type": "Boolean", + "label": "Show the label", + "description": "", + "group": "", + "extraInformation": [ + "Label" + ], + "name": "ShowLabel" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Buffer" + ], + "hidden": true, + "name": "ShowBuffer" + }, + { + "value": "Center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Label" + ], + "hidden": true, + "name": "LabelVerticalAnchorOrigin" + }, + { + "value": "Center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "FillBar" + ], + "hidden": true, + "name": "LabelVerticalAnchorTarget" + } + ], + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Label", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "2 / 3", + "font": "", + "textAlignment": "center", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "2 / 3", + "font": "", + "textAlignment": "center", + "verticalTextAlignment": "top", + "characterSize": 20, + "color": "0;0;0" + } + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "FillBar", + "rightMargin": 0, + "texture": "", + "tiled": true, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "ResourceBar", + "type": "PanelSpriteContinuousBar::ResourceBar", + "Value": 1, + "MaxValue": 3, + "PreviousValue": 0 + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Buffer", + "rightMargin": 0, + "texture": "", + "tiled": true, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Background", + "rightMargin": 0, + "texture": "", + "tiled": true, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Label" + }, + { + "objectName": "FillBar" + }, + { + "objectName": "Buffer" + }, + { + "objectName": "Background" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [] + } + ] + }, + { + "author": "Tristan Rhodes (tristan@victrisgames.com)", + "category": "Visual effect", + "extensionNamespace": "", + "fullName": "Flash layer", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWZsYXNoLW91dGxpbmUiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNywySDE3TDEzLjUsOUgxN0wxMCwyMlYxNEg3VjJNOSw0VjEySDEyVjE0LjY2TDE0LDExSDEwLjI0TDEzLjc2LDRIOVoiIC8+PC9zdmc+", + "name": "FlashLayer", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/flash-outline.svg", + "shortDescription": "Make a layer visible for a specified duration, and then hide the layer.", + "version": "0.3.0", + "description": [ + "Useful to make a temporary effect (flash on hit, flickering lights, lightning flash, show text like Batman and Robin \"Bam!\", etc)", + "", + "It is recommended to select a layer on the top, and one that is hidden by default." + ], + "origin": { + "identifier": "FlashLayer", + "name": "gdevelop-extension-store" + }, + "tags": [ + "effect", + "vfx", + "layer", + "flash" + ], + "authorIds": [ + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Make a layer visible for a specified duration, and then hide the layer.", + "fullName": "Flash layer", + "functionType": "Action", + "name": "FlashLayer", + "sentence": "Make layer _PARAM1_ visible for _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "LayerVisible" + }, + "parameters": [ + "", + "Layer" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShowLayer" + }, + "parameters": [ + "", + "Layer" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "Duration" + ] + }, + { + "type": { + "value": "HideLayer" + }, + "parameters": [ + "", + "Layer" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Layer", + "name": "Layer", + "type": "layer" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "@4ian", + "category": "Game mechanic", + "extensionNamespace": "", + "fullName": "Health points and damage", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWhlYXJ0LWhhbGYtZnVsbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNi41LDVDMTUsNSAxMy41OCw1LjkxIDEzLDcuMlYxNy43NEMxNy4yNSwxMy44NyAyMCwxMS4yIDIwLDguNUMyMCw2LjUgMTguNSw1IDE2LjUsNU0xNi41LDNDMTkuNTgsMyAyMiw1LjQxIDIyLDguNUMyMiwxMi4yNyAxOC42LDE1LjM2IDEzLjQ1LDIwLjAzTDEyLDIxLjM1TDEwLjU1LDIwLjAzQzUuNCwxNS4zNiAyLDEyLjI3IDIsOC41QzIsNS40MSA0LjQyLDMgNy41LDNDOS4yNCwzIDEwLjkxLDMuODEgMTIsNS4wOEMxMy4wOSwzLjgxIDE0Ljc2LDMgMTYuNSwzWiIgLz48L3N2Zz4=", + "name": "Health", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/heart-half-full.svg", + "shortDescription": "Manage health (life) points, shield and armor.", + "version": "0.3.2", + "description": [ + "Manage health (life) points, shield and armor. ", + "", + "It handles:", + "- Damage cooldown", + "- Health and shield regeneration", + "- Over healing", + "", + "It can be used on:", + "- Players", + "- Enemies", + "- NPCs", + "- Inanimate objects (for insance breakable doors or mining rocks)", + "", + "The top-down RPG example uses this extension ([open the project online](https://editor.gdevelop.io/?project=example://top-down-rpg))." + ], + "origin": { + "identifier": "Health", + "name": "gdevelop-extension-store" + }, + "tags": [ + "health", + "life", + "damage", + "hit", + "heal", + "shield", + "regeneration", + "armor" + ], + "authorIds": [ + "wWP8BSlAW0UP4NeaHa2LcmmDzmH2", + "xpwUwByyImTDcHEqDUqfyg0oRBt1", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Manage health (life) points, shield and armor.", + "fullName": "Health", + "name": "Health", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"__Health.TimeSinceLastHit\"" + ] + }, + { + "type": { + "value": "Health::Health::SetCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "Health", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 224, + "colorG": 16, + "colorR": 189, + "creationTime": 0, + "name": "Health", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Regeneration", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Health" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyHealthRegenRate" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + }, + { + "type": { + "value": "Health::Health::PropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "Object.Behavior::MaxHealth()" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"__Health.TimeSinceLastHit\"", + ">", + "HealthRegenDelay" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "HealthRegenRate * TimeDelta()" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Correct any values above maximum limits" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "Object.Behavior::MaxHealth()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "MaxHealth" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Reset triggers", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyIsHealthJustDamaged" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "Health::Health::SetPropertyIsJustHealed" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "Health::Health::SetPropertyIsJustDodged" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [] + }, + { + "colorB": 224, + "colorG": 16, + "colorR": 189, + "creationTime": 0, + "name": "Shield", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Regeneration", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Shield" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyShieldRegenRate" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + }, + { + "type": { + "value": "Health::Health::PropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "MaxShieldPoints" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"__Health.TimeSinceLastHit\"", + ">", + "ShieldRegenDelay" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::RenewShieldDuration" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "ShieldRegenRate * TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Correct any values above maximum limits" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "MaxShieldPoints" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "MaxShieldPoints" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Remove shield points if shield expired", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Health::Health::IsShieldActive" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Reset damage trigger", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyIsShieldJustDamaged" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Apply damage to the object. Shield and armor can reduce this damage if enabled.", + "fullName": "Apply damage to an object", + "functionType": "Action", + "group": "Health", + "name": "Hit", + "sentence": "Apply _PARAM2_ points of damage to _PARAM0_ (Damage can be reduced by Shield: _PARAM3_, Armor: _PARAM4_)", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Incoming damage", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Only consider incoming damage when damage cooldown is not active" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Health::Health::IsDamageCooldownActive" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyDamageToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "DamageValue" + ] + } + ], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Chance to dodge", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ @@ -31237,8 +34452,7 @@ "textG": 0, "textR": 0 }, - "comment": "No damage will be applied when dodged", - "comment2": "" + "comment": "No damage will be applied when dodged" }, { "type": "BuiltinCommonInstructions::Standard", @@ -31250,7 +34464,7 @@ "parameters": [ "RandomFloatInRange(0,1)", "<", - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ], @@ -31336,7 +34550,7 @@ "Object", "Behavior", "=", - "max(0,Object.Behavior::PropertyDamageToBeApplied() - Object.Behavior::PropertyFlatDamageReduction())" + "max(0,DamageToBeApplied - FlatDamageReduction)" ] } ] @@ -31388,7 +34602,7 @@ "Object", "Behavior", "*", - "1 - min(1, Object.Behavior::PropertyPercentDamageReduction())" + "1 - min(1, PercentDamageReduction)" ] } ] @@ -31420,8 +34634,7 @@ "textG": 0, "textR": 0 }, - "comment": "If shield is active, damage the shield first", - "comment2": "" + "comment": "If shield is active, damage the shield first" }, { "type": "BuiltinCommonInstructions::Standard", @@ -31489,8 +34702,7 @@ "textG": 0, "textR": 0 }, - "comment": "If damage is less than shield, subtract damage from shield.", - "comment2": "" + "comment": "If damage is less than shield, subtract damage from shield." }, { "type": "BuiltinCommonInstructions::Standard", @@ -31503,7 +34715,7 @@ "Object", "Behavior", "<=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -31516,7 +34728,7 @@ "Object", "Behavior", "-", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { @@ -31527,7 +34739,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { @@ -31553,8 +34765,7 @@ "textG": 0, "textR": 0 }, - "comment": "If damage is greater than shield, conditionally apply excess damage based on property", - "comment2": "" + "comment": "If damage is greater than shield, conditionally apply excess damage based on property" }, { "type": "BuiltinCommonInstructions::Standard", @@ -31567,7 +34778,7 @@ "Object", "Behavior", ">", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -31580,7 +34791,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -31633,8 +34844,7 @@ "textG": 0, "textR": 0 }, - "comment": "Apply excess damage only if shield does not block excess damage", - "comment2": "" + "comment": "Apply excess damage only if shield does not block excess damage" }, { "type": "BuiltinCommonInstructions::Standard", @@ -31659,7 +34869,7 @@ "Object", "Behavior", "-", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] }, { @@ -31683,79 +34893,1809 @@ "parameters": [] }, { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Apply damage to health", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyDamageToBeApplied" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "Health::Health::SetJustDamaged" - }, - "parameters": [ - "Object", - "Behavior", - "yes", - "" - ] - }, - { - "type": { - "value": "Health::Health::TriggerDamageCooldown" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Health::Health::SetCurrentHealth" - }, - "parameters": [ - "Object", - "Behavior", - "Object.Behavior::PropertyCurrentHealth() - Object.Behavior::PropertyDamageToBeApplied()", - "" - ] - } - ] - } - ] - } - ], - "parameters": [] + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Apply damage to health", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyDamageToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetJustDamaged" + }, + "parameters": [ + "Object", + "Behavior", + "yes", + "" + ] + }, + { + "type": { + "value": "Health::Health::TriggerDamageCooldown" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "CurrentHealth - DamageToBeApplied", + "" + ] + } + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Points of damage", + "name": "DamageValue", + "type": "expression" + }, + { + "defaultValue": "yes", + "description": "Shield can reduce damage taken", + "name": "UseShield", + "optional": true, + "type": "yesorno" + }, + { + "defaultValue": "yes", + "description": "Armor can reduce damage taken", + "name": "UseArmor", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "current health points of the object.", + "fullName": "Health points", + "functionType": "ExpressionAndCondition", + "group": "Health", + "name": "Health", + "sentence": "health points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "CurrentHealth" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the health points of the object. Will not trigger damage cooldown.", + "fullName": "Change health points", + "functionType": "Action", + "group": "Health", + "name": "SetHealth", + "sentence": "Change the health of _PARAM0_ to _PARAM2_ points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If MaxHealth is set, prevent health from going above it" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyMaxHealth" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(CurrentHealth, MaxHealth)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "New health value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the health points of the object. Will not trigger damage cooldown.", + "fullName": "Change health points (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetCurrentHealth", + "private": true, + "sentence": "Change the health of _PARAM0_ to _PARAM2_ points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetHealth" + }, + "parameters": [ + "Object", + "Behavior", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "New health value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Heal the object by increasing its health points.", + "fullName": "Heal object", + "functionType": "Action", + "group": "Health", + "name": "Heal", + "sentence": "Heal _PARAM0_ with _PARAM2_ health points", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Heal", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If Max Health is not set, do not enforce Max Health" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyMaxHealth" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyHealToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "HealValue" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If Max Health is set and Overhealing is not allowed" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyMaxHealth" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "inverted": true, + "value": "Health::Health::PropertyAllowOverHealing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyHealToBeApplied" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(HealValue,MaxHealth - CurrentHealth)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Perform heal" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "HealToBeApplied" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Update healing trigger" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyIsJustHealed" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] } ] } - ], - "parameters": [] + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Points to heal (will be added to object health)", + "name": "HealValue", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum health points of the object.", + "fullName": "Maximum health points", + "functionType": "ExpressionAndCondition", + "group": "Health configuration", + "name": "MaxHealth", + "sentence": "the maximum health points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "MaxHealth" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MaxHealth", + "name": "SetMaxHealthOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyMaxHealth" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make sure Current Health does not exceed new Max Health" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "Object.Behavior::MaxHealth()" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Behavior::MaxHealth()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Maximum health", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the object maximum health points.", + "fullName": "Maximum health points (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetMaxHealth", + "private": true, + "sentence": "Change the maximum health of _PARAM0_ to _PARAM2_ points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetMaxHealthOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Maximum health", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the rate of health regeneration (points per second).", + "fullName": "Rate of health regeneration", + "functionType": "ExpressionAndCondition", + "group": "Health configuration", + "name": "HealthRegenRate", + "sentence": "the rate of health regeneration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "HealthRegenRate" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HealthRegenRate", + "name": "SetHealthRegenRateOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyHealthRegenRate" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Rate of regen", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the rate of health regeneration.", + "fullName": "Rate of health regeneration (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetHealthRegenRate", + "private": true, + "sentence": "Change the rate of health regen of _PARAM0_ to _PARAM2_ points per second", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetHealthRegenRateOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Rate of regen", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the duration of damage cooldown (seconds).", + "fullName": "Damage cooldown", + "functionType": "ExpressionAndCondition", + "group": "Health configuration", + "name": "DamageCooldownDuration", + "sentence": "the duration of damage cooldown", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "DamageCooldown" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DamageCooldownDuration", + "name": "SetCooldownDurationOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyDamageCooldown" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Duration of damage cooldown (seconds)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the duration of damage cooldown (seconds).", + "fullName": "Damage cooldown (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetCooldownDuration", + "private": true, + "sentence": "Change the duration of damage cooldown on _PARAM0_ to _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetCooldownDurationOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Duration of damage cooldown (seconds)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the delay before health regeneration starts after last being hit (seconds).", + "fullName": "Health regeneration delay", + "functionType": "ExpressionAndCondition", + "group": "Health configuration", + "name": "HealthRegenDelay", + "sentence": "the health regeneration delay", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "HealthRegenDelay" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HealthRegenDelay", + "name": "SetHealthRegenDelayOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyHealthRegenDelay" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Delay (seconds)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the delay before health regeneration starts after being hit.", + "fullName": "Health regeneration delay (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetHealthRegenDelay", + "private": true, + "sentence": "Change the health regeneration delay on _PARAM0_ to _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetHealthRegenDelayOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Delay (seconds)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the chance to dodge incoming damage (range: 0 to 1).", + "fullName": "Dodge chance", + "functionType": "ExpressionAndCondition", + "group": "Health configuration", + "name": "ChanceToDodge", + "sentence": "the chance to dodge incoming damage", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ChanceToDodge" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ChanceToDodge", + "name": "SetChanceToDodgeOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyChanceToDodge" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Chance to dodge (Range: 0 to 1)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the chance to dodge incoming damage.", + "fullName": "Chance to dodge incoming damage (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetChanceToDodge", + "private": true, + "sentence": "Change the chance to dodge on _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetChanceToDodgeOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Chance to dodge (Range: 0 to 1)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the flat damage reduction from the armor. Incoming damage is reduced by this value.", + "fullName": "Armor flat damage reduction", + "functionType": "ExpressionAndCondition", + "group": "Health configuration", + "name": "FlatDamageReduction", + "sentence": "the armor flat damage reduction", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FlatDamageReduction" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FlatDamageReduction", + "name": "SetFlatDamageReductionOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyFlatDamageReduction" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Flat reduction from armor", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the flat damage reduction from armor. Incoming damage is reduced by this value.", + "fullName": "Flat damage reduction from armor (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetFlatDamageReduction", + "private": true, + "sentence": "Change the flat damage reduction from armor on _PARAM0_ to _PARAM2_ points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetFlatDamageReductionOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Flat reduction from armor", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the percent damage reduction from armor (range: 0 to 1).", + "fullName": "Armor percent damage reduction", + "functionType": "ExpressionAndCondition", + "group": "Health configuration", + "name": "PercentDamageReduction", + "sentence": "the armor percent damage reduction", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "PercentDamageReduction" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "PercentDamageReduction", + "name": "SetPercentDamageReductionOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyPercentDamageReduction" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Percent damage reduction from armor", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the percent damage reduction from armor. Range: 0 to 1.", + "fullName": "Percent damage reduction from armor (deprecated)", + "functionType": "Action", + "group": "Health configuration", + "name": "SetPercentDamageReduction", + "private": true, + "sentence": "Change the percent damage reduction from armor on _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPercentDamageReductionOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Percent damage reduction from armor", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Allow heals to increase health above max health. Regeneration will not exceed max health.", + "fullName": "Allow over-healing", + "functionType": "Action", + "group": "Health configuration", + "name": "AllowOverHealing", + "sentence": "Allow over-healing on _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyAllowOverHealing" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyAllowOverHealing" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Allow over-healing", + "name": "Value", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Mark object as hit at least once.", + "fullName": "Mark object as hit at least once", + "functionType": "Action", + "group": "Health configuration", + "name": "SetHitAtLeastOnce", + "private": true, + "sentence": "Mark _PARAM0_ as hit at least once: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyHitAtLeastOnce" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyHitAtLeastOnce" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Hit at least once", + "name": "Value", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Mark object as just damaged.", + "fullName": "Mark object as just damaged", + "functionType": "Action", + "group": "Health configuration", + "name": "SetJustDamaged", + "private": true, + "sentence": "Mark _PARAM0_ as just damaged: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyIsHealthJustDamaged" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyIsHealthJustDamaged" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Just damaged", + "name": "Value", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Trigger damage cooldown.", + "fullName": "Trigger damage cooldown", + "functionType": "Action", + "group": "Health", + "name": "TriggerDamageCooldown", + "sentence": "Trigger the damage cooldown on _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Mark that the object was hit at least once (used for initial state of damage cooldown)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Health::Health::HitAtLeastOnce" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetHitAtLeastOnce" + }, + "parameters": [ + "Object", + "Behavior", + "yes", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"__Health.TimeSinceLastHit\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object has been hit at least once.", + "fullName": "Object has been hit at least once", + "functionType": "Condition", + "group": "Health", + "name": "HitAtLeastOnce", + "private": true, + "sentence": "_PARAM0_ has been hit at least once", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "This condition is used to prevent \"damage cooldown\" from being active when the game starts." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyHitAtLeastOnce" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] } ], "parameters": [ @@ -31769,36 +36709,79 @@ "name": "Behavior", "supplementaryInformation": "Health::Health", "type": "behavior" - }, + } + ], + "objectGroups": [] + }, + { + "description": "Check if health was just damaged previously in the events.", + "fullName": "Is health just damaged", + "functionType": "Condition", + "group": "Health", + "name": "IsJustDamaged", + "sentence": "Health has just been damaged on _PARAM0_", + "events": [ { - "description": "Points of damage", - "name": "DamageValue", - "type": "expression" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] }, { - "defaultValue": "yes", - "description": "Shield can reduce damage taken", - "name": "UseShield", - "optional": true, - "type": "yesorno" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyIsHealthJustDamaged" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, { - "defaultValue": "yes", - "description": "Armor can reduce damage taken", - "name": "UseArmor", - "optional": true, - "type": "yesorno" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Change the health points of the object. Will not trigger damage cooldown.", - "fullName": "Change health points", - "functionType": "Action", - "group": "Health configuration", - "name": "SetHealth", - "sentence": "Change the health of _PARAM0_ to _PARAM2_ points", + "description": "Check if the object was just healed previously in the events.", + "fullName": "Is just healed", + "functionType": "Condition", + "group": "Health", + "name": "IsJustHealed", + "sentence": "_PARAM0_ has just been healed", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -31806,36 +36789,91 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyIsJustHealed" }, "parameters": [ "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" ] } ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "If MaxHealth is set, prevent health from going above it", - "comment2": "" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if damage cooldown is active. Object and shield cannot be damaged while this is active.", + "fullName": "Is damage cooldown active", + "functionType": "Condition", + "group": "Health", + "name": "IsDamageCooldownActive", + "sentence": "Damage cooldown on _PARAM0_ is active", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "Health::Health::PropertyMaxHealth" + "value": "Health::Health::PropertyHitAtLeastOnce" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "Health::Health::PropertyDamageCooldown" }, "parameters": [ "Object", @@ -31843,18 +36881,26 @@ ">", "0" ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"__Health.TimeSinceLastHit\"", + "<", + "DamageCooldown" + ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "Behavior", - "=", - "min(Object.Behavior::PropertyCurrentHealth(), Object.Behavior::PropertyMaxHealth())" + "True" ] } ] @@ -31871,23 +36917,17 @@ "name": "Behavior", "supplementaryInformation": "Health::Health", "type": "behavior" - }, - { - "description": "New health value", - "name": "Value", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change the health points of the object. Will not trigger damage cooldown.", - "fullName": "Change health points (deprecated)", - "functionType": "Action", - "group": "Health configuration", - "name": "SetCurrentHealth", - "private": true, - "sentence": "Change the health of _PARAM0_ to _PARAM2_ points", + "description": "the time before damage cooldown ends (seconds).", + "fullName": "Time remaining in damage cooldown", + "functionType": "ExpressionAndCondition", + "group": "Health", + "name": "DamageCooldownRemaining", + "sentence": "the time before damage cooldown end", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -31895,18 +36935,43 @@ "actions": [ { "type": { - "value": "Health::Health::SetHealth" + "value": "SetReturnNumber" + }, + "parameters": [ + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::IsDamageCooldownActive" }, "parameters": [ "Object", "Behavior", - "GetArgumentAsNumber(\"Value\")", "" ] } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "max(0,DamageCooldown - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" + ] + } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -31918,189 +36983,182 @@ "name": "Behavior", "supplementaryInformation": "Health::Health", "type": "behavior" - }, - { - "description": "New health value", - "name": "Value", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Heal the object by increasing its health points.", - "fullName": "Heal object", - "functionType": "Action", + "description": "Check if the object is considered dead (no health points).", + "fullName": "Is dead", + "functionType": "Condition", "group": "Health", - "name": "Heal", - "sentence": "Heal _PARAM0_ with _PARAM2_ health points", + "name": "IsDead", + "sentence": "_PARAM0_ is dead", "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Heal", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetReturnBoolean" }, - "comment": "If Max Health is not set, do not enforce Max Health", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyMaxHealth" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "Health::Health::SetPropertyHealToBeApplied" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"HealValue\")" - ] - } + "parameters": [ + "False" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "Health::Health::PropertyCurrentHealth" }, - "comment": "If Max Health is set and Overhealing is not allowed", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyMaxHealth" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "0" - ] - }, - { - "type": { - "inverted": true, - "value": "Health::Health::PropertyAllowOverHealing" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "Health::Health::SetPropertyHealToBeApplied" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "min(GetArgumentAsNumber(\"HealValue\"),Object.Behavior::PropertyMaxHealth() - Object.Behavior::PropertyCurrentHealth())" - ] - } + "parameters": [ + "Object", + "Behavior", + "<=", + "0" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetReturnBoolean" }, - "comment": "Perform heal", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Health::Health::SetPropertyCurrentHealth" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "Object.Behavior::PropertyHealToBeApplied()" - ] - } + "parameters": [ + "True" ] - }, + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the time since last taken hit (seconds).", + "fullName": "Time since last hit", + "functionType": "ExpressionAndCondition", + "group": "Health", + "name": "TimeSinceLastHit", + "sentence": "the time since last taken hit on health", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetReturnNumber" }, - "comment": "Update healing trigger", - "comment2": "" - }, + "parameters": [ + "Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\")" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the health damage taken from most recent hit.", + "fullName": "Health damage taken from most recent hit", + "functionType": "ExpressionAndCondition", + "group": "Health", + "name": "PreviousDamageTaken", + "sentence": "the health damage taken from most recent hit", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Health::Health::SetPropertyIsJustHealed" - }, - "parameters": [ - "Object", - "Behavior", - "yes" - ] - } + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "DamageToBeApplied" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum shield points of the object.", + "fullName": "Maximum shield points", + "functionType": "ExpressionAndCondition", + "group": "Shield configuration", + "name": "MaxShield", + "sentence": "the maximum shield points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "MaxShieldPoints" ] } - ], - "parameters": [] + ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -32112,22 +37170,16 @@ "name": "Behavior", "supplementaryInformation": "Health::Health", "type": "behavior" - }, - { - "description": "Points to heal (will be added to object health)", - "name": "HealValue", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change the object maximum health points.", - "fullName": "Maximum health points", - "functionType": "Action", - "group": "Health configuration", - "name": "SetMaxHealth", - "sentence": "Change the maximum health of _PARAM0_ to _PARAM2_ points", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MaxShield", + "name": "SetMaxShieldOp", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32135,55 +37187,61 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyMaxHealth" + "value": "Health::Health::SetPropertyMaxShieldPoints" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Make sure Current Health does not exceed new Max Health", - "comment2": "" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" }, + { + "description": "Maximum shield", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the maximum shield points of the object.", + "fullName": "Maximum shield points (deprecated)", + "functionType": "Action", + "group": "Shield configuration", + "name": "SetMaxShield", + "private": true, + "sentence": "Change the maximum shield of _PARAM0_ to _PARAM2_ points", + "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyCurrentHealth" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "Object.Behavior::MaxHealth()" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "Health::Health::SetMaxShieldOp" }, "parameters": [ "Object", "Behavior", "=", - "Object.Behavior::MaxHealth()" + "Value", + "" ] } ] @@ -32202,7 +37260,7 @@ "type": "behavior" }, { - "description": "Maximum health", + "description": "Maximum shield", "name": "Value", "type": "expression" } @@ -32210,12 +37268,13 @@ "objectGroups": [] }, { - "description": "Change the rate of health regeneration.", - "fullName": "Rate of health regeneration", + "description": "Change maximum shield points.", + "fullName": "Max shield points (deprecated)", "functionType": "Action", - "group": "Health configuration", - "name": "SetHealthRegenRate", - "sentence": "Change the rate of health regen of _PARAM0_ to _PARAM2_ points per second", + "group": "Shield configuration", + "name": "SetMaxShieldPoints", + "private": true, + "sentence": "Change the maximum shield points on _PARAM0_ to _PARAM2_ points", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32223,13 +37282,14 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealthRegenRate" + "value": "Health::Health::SetMaxShieldOp" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value", + "" ] } ] @@ -32248,7 +37308,7 @@ "type": "behavior" }, { - "description": "Rate of regen", + "description": "Shield points", "name": "Value", "type": "expression" } @@ -32256,12 +37316,12 @@ "objectGroups": [] }, { - "description": "Change the duration of damage cooldown (seconds).", - "fullName": "Damage cooldown", - "functionType": "Action", - "group": "Health configuration", - "name": "SetCooldownDuration", - "sentence": "Change the duration of damage cooldown on _PARAM0_ to _PARAM2_ seconds", + "description": "the current shield points of the object.", + "fullName": "Shield points", + "functionType": "ExpressionAndCondition", + "group": "Shield", + "name": "ShieldPoints", + "sentence": "the shield points", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32269,18 +37329,18 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageCooldown" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "CurrentShieldPoints" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -32292,22 +37352,16 @@ "name": "Behavior", "supplementaryInformation": "Health::Health", "type": "behavior" - }, - { - "description": "Duration of damage cooldown (seconds)", - "name": "Value", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change the delay before health regeneration starts after being hit.", - "fullName": "Health regeneration delay", - "functionType": "Action", - "group": "Health configuration", - "name": "SetHealthRegenDelay", - "sentence": "Change the health regeneration delay on _PARAM0_ to _PARAM2_ seconds", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ShieldPoints", + "name": "SetShieldPointsOp", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32315,13 +37369,13 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealthRegenDelay" + "value": "Health::Health::SetPropertyCurrentShieldPoints" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -32340,7 +37394,7 @@ "type": "behavior" }, { - "description": "Delay (seconds)", + "description": "Shield points", "name": "Value", "type": "expression" } @@ -32348,12 +37402,13 @@ "objectGroups": [] }, { - "description": "Change the chance to dodge incoming damage.", - "fullName": "Chance to dodge incoming damage", + "description": "Change current shield points. Will not trigger damage cooldown.", + "fullName": "Shield points (deprecated)", "functionType": "Action", - "group": "Health configuration", - "name": "SetChanceToDodge", - "sentence": "Change the chance to dodge on _PARAM0_ to _PARAM2_", + "group": "Shield configuration", + "name": "SetShieldPoints", + "private": true, + "sentence": "Change current shield points on _PARAM0_ to _PARAM2_ points", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32361,13 +37416,14 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyChanceToDodge" + "value": "Health::Health::SetShieldPointsOp" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value", + "" ] } ] @@ -32386,7 +37442,7 @@ "type": "behavior" }, { - "description": "Chance to dodge (Range: 0 to 1)", + "description": "Shield points", "name": "Value", "type": "expression" } @@ -32394,12 +37450,12 @@ "objectGroups": [] }, { - "description": "Change the flat damage reduction from armor. Incoming damage is reduced by this value.", - "fullName": "Flat damage reduction from armor", - "functionType": "Action", - "group": "Health configuration", - "name": "SetFlatDamageReduction", - "sentence": "Change the flat damage reduction from armor on _PARAM0_ to _PARAM2_ points", + "description": "the rate of shield regeneration (points per second).", + "fullName": "Rate of shield regeneration", + "functionType": "ExpressionAndCondition", + "group": "Shield configuration", + "name": "ShieldRegenRate", + "sentence": "the rate of shield regeneration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32407,18 +37463,18 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyFlatDamageReduction" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "ShieldRegenRate" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -32430,22 +37486,16 @@ "name": "Behavior", "supplementaryInformation": "Health::Health", "type": "behavior" - }, - { - "description": "Flat reduction from armor", - "name": "Value", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change the percent damage reduction from armor. Range: 0 to 1.", - "fullName": "Percent damage reduction from armor", - "functionType": "Action", - "group": "Health configuration", - "name": "SetPercentDamageReduction", - "sentence": "Change the percent damage reduction from armor on _PARAM0_ to _PARAM2_", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ShieldRegenRate", + "name": "SetShieldRegenRateOp", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32453,13 +37503,13 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyPercentDamageReduction" + "value": "Health::Health::SetPropertyShieldRegenRate" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -32478,7 +37528,7 @@ "type": "behavior" }, { - "description": "Percent damage reduction from armor", + "description": "Regeneration rate (points per second)", "name": "Value", "type": "expression" } @@ -32486,12 +37536,13 @@ "objectGroups": [] }, { - "description": "Allow heals to increase health above max health. Regeneration will not exceed max health.", - "fullName": "Allow over-healing", + "description": "Change rate of shield regeneration.", + "fullName": "Shield regeneration rate (deprecated)", "functionType": "Action", - "group": "Health configuration", - "name": "AllowOverHealing", - "sentence": "Allow over-healing on _PARAM0_: _PARAM2_", + "group": "Shield configuration", + "name": "SetShieldRegenRate", + "private": true, + "sentence": "Change the shield regeneration rate of _PARAM0_ to _PARAM2_ points per second", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32499,37 +37550,100 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyAllowOverHealing" + "value": "Health::Health::SetShieldRegenRateOp" }, "parameters": [ "Object", "Behavior", - "no" + "=", + "Value", + "" ] } ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" }, + { + "description": "Regeneration rate (points per second)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the delay before shield regeneration starts after being hit (seconds).", + "fullName": "Shield regeneration delay", + "functionType": "ExpressionAndCondition", + "group": "Shield configuration", + "name": "ShieldRegenDelay", + "sentence": "the shield regeneration delay", + "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "\"Value\"" + "ShieldRegenDelay" ] } - ], + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ShieldRegenDelay", + "name": "SetShieldRegenDelayOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], "actions": [ { "type": { - "value": "Health::Health::SetPropertyAllowOverHealing" + "value": "Health::Health::SetPropertyShieldRegenDelay" }, "parameters": [ "Object", "Behavior", - "yes" + "=", + "Value" ] } ] @@ -32548,21 +37662,21 @@ "type": "behavior" }, { - "description": "Allow over-healing", + "description": "Regeneration delay (seconds)", "name": "Value", - "type": "yesorno" + "type": "expression" } ], "objectGroups": [] }, { - "description": "Mark object as hit at least once.", - "fullName": "Mark object as hit at least once", + "description": "Change delay before shield regeneration starts after being hit.", + "fullName": "Shield regeneration delay (deprecated)", "functionType": "Action", - "group": "Health configuration", - "name": "SetHitAtLeastOnce", + "group": "Shield configuration", + "name": "SetShieldRegenDelay", "private": true, - "sentence": "Mark _PARAM0_ as hit at least once: _PARAM2_", + "sentence": "Change the shield regeneration delay on _PARAM0_ to _PARAM2_ seconds", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32570,37 +37684,100 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHitAtLeastOnce" + "value": "Health::Health::SetShieldRegenDelayOp" }, "parameters": [ "Object", "Behavior", - "no" + "=", + "Value", + "" ] } ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" }, + { + "description": "Regeneration delay (seconds)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the duration of the shield (seconds). A value of \"0\" means the shield is permanent.", + "fullName": "Duration of shield", + "functionType": "ExpressionAndCondition", + "group": "Shield configuration", + "name": "ShieldDuration", + "sentence": "the duration of the shield", + "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "\"Value\"" + "ShieldDuration" ] } - ], + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ShieldDuration", + "name": "SetShieldDurationOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], "actions": [ { "type": { - "value": "Health::Health::SetPropertyHitAtLeastOnce" + "value": "Health::Health::SetPropertyShieldDuration" }, "parameters": [ "Object", "Behavior", - "yes" + "=", + "Value" ] } ] @@ -32619,21 +37796,21 @@ "type": "behavior" }, { - "description": "Hit at least once", + "description": "Shield duration (seconds)", "name": "Value", - "type": "yesorno" + "type": "expression" } ], "objectGroups": [] }, { - "description": "Mark object as just damaged.", - "fullName": "Mark object as just damaged", + "description": "Change duration of shield. Use \"0\" to make shield permanent.", + "fullName": "Duration of shield (deprecated)", "functionType": "Action", - "group": "Health configuration", - "name": "SetJustDamaged", + "group": "Shield configuration", + "name": "SetShieldDuration", "private": true, - "sentence": "Mark _PARAM0_ as just damaged: _PARAM2_", + "sentence": "Change the duration of shield on _PARAM0_ to _PARAM2_ seconds", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32641,37 +37818,58 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsHealthJustDamaged" + "value": "Health::Health::SetShieldDurationOp" }, "parameters": [ "Object", "Behavior", - "no" + "=", + "Value", + "" ] } ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" }, + { + "description": "Shield duration (seconds)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Renew shield duration to it's full value.", + "fullName": "Renew shield duration", + "functionType": "Action", + "group": "Shield", + "name": "RenewShieldDuration", + "sentence": "Renew the shield duration on _PARAM0_", + "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"Value\"" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsHealthJustDamaged" + "value": "ResetObjectTimer" }, "parameters": [ "Object", - "Behavior", - "yes" + "\"__Health.ShieldDuration\"" ] } ] @@ -32688,76 +37886,85 @@ "name": "Behavior", "supplementaryInformation": "Health::Health", "type": "behavior" - }, - { - "description": "Just damaged", - "name": "Value", - "type": "yesorno" } ], "objectGroups": [] }, { - "description": "Trigger damage cooldown.", - "fullName": "Trigger damage cooldown", + "description": "Activate the shield by setting the shield points and renewing the shield duration (optional).", + "fullName": "Activate shield", "functionType": "Action", - "group": "Health", - "name": "TriggerDamageCooldown", - "sentence": "Trigger the damage cooldown on _PARAM0_", + "group": "Shield", + "name": "ActivateShield", + "sentence": "Activate the shield on _PARAM0_ with _PARAM2_ points (Renew shield duration: _PARAM3_)", "events": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Mark that the object was hit at least once (used for initial state of damage cooldown)", - "comment2": "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "ShieldPoints" + ] + } + ] }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": true, - "value": "Health::Health::HitAtLeastOnce" + "value": "Health::Health::PropertyMaxShieldPoints" }, "parameters": [ "Object", "Behavior", - "" + ">", + "0" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetHitAtLeastOnce" + "value": "Health::Health::SetPropertyCurrentShieldPoints" }, "parameters": [ "Object", "Behavior", - "yes", - "" + "=", + "min(ShieldPoints,Object.Behavior::MaxShield())" ] } ] }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"RenewShieldDuration\"" + ] + } + ], "actions": [ { "type": { - "value": "ResetObjectTimer" + "value": "Health::Health::RenewShieldDuration" }, "parameters": [ "Object", - "\"__Health.TimeSinceLastHit\"" + "Behavior", + "" ] } ] @@ -32774,42 +37981,42 @@ "name": "Behavior", "supplementaryInformation": "Health::Health", "type": "behavior" + }, + { + "description": "Shield points", + "name": "ShieldPoints", + "type": "expression" + }, + { + "defaultValue": "yes", + "description": "Renew shield duration", + "name": "RenewShieldDuration", + "optional": true, + "type": "yesorno" } ], "objectGroups": [] }, { - "description": "Check if the object has been hit at least once.", - "fullName": "Object has been hit at least once", - "functionType": "Condition", - "group": "Health", - "name": "HitAtLeastOnce", - "private": true, - "sentence": "_PARAM0_ has been hit at least once", + "description": "Enable (or disable) blocking excess damage when shield breaks.", + "fullName": "Block excess damage when shield breaks", + "functionType": "Action", + "group": "Shield configuration", + "name": "SetShieldBlockExcessDamage", + "sentence": "Shield on _PARAM0_ blocks excess damage when it breaks: _PARAM2_", "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "This condition is used to prevent \"damage cooldown\" from being active when the game starts.", - "comment2": "" - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "Health::Health::SetPropertyBlockExcessDamage" }, "parameters": [ - "False" + "Object", + "Behavior", + "no" ] } ] @@ -32819,21 +38026,22 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyHitAtLeastOnce" + "value": "GetArgumentAsBoolean" }, "parameters": [ - "Object", - "Behavior" + "\"Value\"" ] } ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "Health::Health::SetPropertyBlockExcessDamage" }, "parameters": [ - "True" + "Object", + "Behavior", + "yes" ] } ] @@ -32850,17 +38058,22 @@ "name": "Behavior", "supplementaryInformation": "Health::Health", "type": "behavior" + }, + { + "description": "Block excess damage", + "name": "Value", + "type": "yesorno" } ], "objectGroups": [] }, { - "description": "Check if health was just damaged previously in the events.", - "fullName": "Is health just damaged", + "description": "Check if the shield was just damaged previously in the events.", + "fullName": "Is shield just damaged", "functionType": "Condition", - "group": "Health", - "name": "IsJustDamaged", - "sentence": "Health has just been damaged on _PARAM0_", + "group": "Shield", + "name": "IsShieldJustDamaged", + "sentence": "Shield on _PARAM0_ has just been damaged", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32881,7 +38094,7 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsHealthJustDamaged" + "value": "Health::Health::PropertyIsShieldJustDamaged" }, "parameters": [ "Object", @@ -32917,12 +38130,12 @@ "objectGroups": [] }, { - "description": "Check if the object was just healed previously in the events.", - "fullName": "Is just healed", + "description": "Check if incoming damage was just dodged.", + "fullName": "Damage was just dodged", "functionType": "Condition", "group": "Health", - "name": "IsJustHealed", - "sentence": "_PARAM0_ has just been healed", + "name": "IsJustDodged", + "sentence": "_PARAM0_ just dodged incoming damage", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32943,7 +38156,7 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsJustHealed" + "value": "Health::Health::PropertyIsJustDodged" }, "parameters": [ "Object", @@ -32979,12 +38192,12 @@ "objectGroups": [] }, { - "description": "Check if damage cooldown is active. Object and shield cannot be damaged while this is active.", - "fullName": "Is damage cooldown active", + "description": "Check if the shield is active (based on shield points and duration).", + "fullName": "Is shield active", "functionType": "Condition", - "group": "Health", - "name": "IsDamageCooldownActive", - "sentence": "Damage cooldown on _PARAM0_ is active", + "group": "Shield", + "name": "IsShieldActive", + "sentence": "Shield on _PARAM0_ is active", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -33000,21 +38213,24 @@ } ] }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "To be considered \"active\", a shield must have positive points AND not exceed duration" + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "Health::Health::PropertyHitAtLeastOnce" - }, - "parameters": [ - "Object", - "Behavior" - ] - }, - { - "type": { - "value": "Health::Health::PropertyDamageCooldown" + "value": "Health::Health::PropertyCurrentShieldPoints" }, "parameters": [ "Object", @@ -33022,26 +38238,83 @@ ">", "0" ] - }, - { - "type": { - "value": "CompareObjectTimer" - }, - "parameters": [ - "Object", - "\"__Health.TimeSinceLastHit\"", - "<", - "Object.Behavior::PropertyDamageCooldown()" - ] } ], - "actions": [ + "actions": [], + "events": [ { - "type": { - "value": "SetReturnBoolean" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "True" + "comment": "Don't check the timer when duration is zero (or negative)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyShieldDuration" + }, + "parameters": [ + "Object", + "Behavior", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyShieldDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"__Health.ShieldDuration\"", + "<", + "ShieldDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } ] } ] @@ -33063,12 +38336,12 @@ "objectGroups": [] }, { - "description": "Check if the object is considered dead (no health points).", - "fullName": "Is dead", - "functionType": "Condition", - "group": "Health", - "name": "IsDead", - "sentence": "_PARAM0_ is dead", + "description": "the time before the shield duration ends (seconds).", + "fullName": "Time before shield duration ends", + "functionType": "ExpressionAndCondition", + "group": "Shield", + "name": "ShieldTimeRemaining", + "sentence": "the time before the shield duration end", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -33076,10 +38349,10 @@ "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "False" + "0" ] } ] @@ -33089,12 +38362,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentHealth" + "value": "Health::Health::PropertyShieldDuration" }, "parameters": [ "Object", "Behavior", - "<=", + ">", "0" ] } @@ -33102,15 +38375,18 @@ "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "max(0,ShieldDuration - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -33127,12 +38403,12 @@ "objectGroups": [] }, { - "description": "maximum health points of the object.", - "fullName": "Maximum health points", + "description": "the shield damage taken from most recent hit.", + "fullName": "Shield damage taken from most recent hit", "functionType": "ExpressionAndCondition", - "group": "Health", - "name": "MaxHealth", - "sentence": "maximum health points", + "group": "Shield", + "name": "PreviousDamageToShield", + "sentence": "the shield damage taken from most recent hit", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -33143,7 +38419,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxHealth()" + "ShieldDamageTaken" ] } ] @@ -33168,12 +38444,12 @@ "objectGroups": [] }, { - "description": "Duration of damage cooldown (seconds).", - "fullName": "Damage cooldown", - "functionType": "Expression", + "description": "the health points gained from previous heal.", + "fullName": "Health points gained from previous heal", + "functionType": "ExpressionAndCondition", "group": "Health", - "name": "DamageCooldownDuration", - "sentence": "", + "name": "PreviousHealAmount", + "sentence": "the health points gained from previous heal", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -33184,7 +38460,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDamageCooldown()" + "HealToBeApplied" ] } ] @@ -33207,14 +38483,427 @@ } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "100", + "type": "Number", + "label": "Starting health", + "description": "", + "group": "Health", + "extraInformation": [], + "name": "Health" + }, + { + "value": "0", + "type": "Number", + "label": "Current health (life) points", + "description": "", + "group": "Health", + "extraInformation": [], + "hidden": true, + "name": "CurrentHealth" + }, + { + "value": "100", + "type": "Number", + "label": "Maximum health", + "description": "Use 0 for no maximum.", + "group": "Health", + "extraInformation": [], + "name": "MaxHealth" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Damage cooldown", + "description": "", + "group": "Health", + "extraInformation": [], + "name": "DamageCooldown" + }, + { + "value": "", + "type": "Boolean", + "label": "Allow heals to increase health above max health (regen will never exceed max health)", + "description": "", + "group": "Health", + "extraInformation": [], + "advanced": true, + "name": "AllowOverHealing" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "Health", + "extraInformation": [], + "hidden": true, + "name": "IsHealthJustDamaged" + }, + { + "value": "0", + "type": "Number", + "label": "Damage to health from the previous incoming damage", + "description": "", + "group": "Health", + "extraInformation": [], + "hidden": true, + "name": "DamageToBeApplied" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "Health", + "extraInformation": [], + "hidden": true, + "name": "HitAtLeastOnce" + }, + { + "value": "0", + "type": "Number", + "label": "Chance to dodge incoming damage (between 0 and 1)", + "description": "When a damage is dodged, no damage is applied.", + "group": "Health", + "extraInformation": [], + "advanced": true, + "name": "ChanceToDodge" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "Health", + "extraInformation": [], + "hidden": true, + "name": "IsJustDodged" + }, + { + "value": "0", + "type": "Number", + "label": "Health points gained from the previous heal", + "description": "", + "group": "Health", + "extraInformation": [], + "hidden": true, + "name": "HealToBeApplied" + }, + { + "value": "0", + "type": "Number", + "label": "Rate of health regeneration (points per second)", + "description": "", + "group": "Health regeneration", + "extraInformation": [], + "advanced": true, + "name": "HealthRegenRate" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Health regeneration delay ", + "description": "Delay before health regeneration starts after a hit.", + "group": "Health regeneration", + "extraInformation": [], + "advanced": true, + "name": "HealthRegenDelay" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsJustHealed" + }, + { + "value": "", + "type": "Number", + "label": "Current shield points", + "description": "", + "group": "Shield", + "extraInformation": [], + "hidden": true, + "name": "CurrentShieldPoints" + }, + { + "value": "0", + "type": "Number", + "label": "Maximum shield", + "description": "Leave 0 for unlimited.", + "group": "Shield", + "extraInformation": [], + "advanced": true, + "name": "MaxShieldPoints" + }, + { + "value": "5", + "type": "Number", + "unit": "Second", + "label": "Duration of shield", + "description": "Use 0 to make the shield permanent.", + "group": "Shield", + "extraInformation": [], + "advanced": true, + "name": "ShieldDuration" + }, + { + "value": "0", + "type": "Number", + "label": "Rate of shield regeneration (points per second)", + "description": "", + "group": "Shield regeneration", + "extraInformation": [], + "advanced": true, + "name": "ShieldRegenRate" + }, + { + "value": "", + "type": "Boolean", + "label": "Block excess damage when shield is broken", + "description": "", + "group": "Shield", + "extraInformation": [], + "advanced": true, + "name": "BlockExcessDamage" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Shield regeneration delay", + "description": "Delay before shield regeneration starts after a hit.", + "group": "Shield regeneration", + "extraInformation": [], + "advanced": true, + "name": "ShieldRegenDelay" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "Shield", + "extraInformation": [], + "hidden": true, + "name": "IsShieldJustDamaged" + }, + { + "value": "", + "type": "Number", + "label": "Damage to shield from the previous incoming damage", + "description": "", + "group": "Shield", + "extraInformation": [], + "hidden": true, + "name": "ShieldDamageTaken" + }, + { + "value": "0", + "type": "Number", + "label": "Flat damage reduction from armor", + "description": "Incoming damages are reduced by this value.", + "group": "Armor", + "extraInformation": [], + "advanced": true, + "name": "FlatDamageReduction" + }, + { + "value": "0", + "type": "Number", + "label": "Percentage damage reduction from armor (between 0 and 1)", + "description": "", + "group": "Armor", + "extraInformation": [], + "advanced": true, + "name": "PercentDamageReduction" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "@4ian, Entropy, VegeTato", + "category": "Visual effect", + "extensionNamespace": "", + "fullName": "Flash object", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWZsYXNoLW91dGxpbmUiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNywySDE3TDEzLjUsOUgxN0wxMCwyMlYxNEg3VjJNOSw0VjEySDEyVjE0LjY2TDE0LDExSDEwLjI0TDEzLjc2LDRIOVoiIC8+PC9zdmc+", + "name": "Flash", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/flash-outline.svg", + "shortDescription": "Make an object flash visibility (blink), color tint, object effect, or opacity (fade).", + "version": "1.3.1", + "description": [ + "Make an object flash for a period of time so that it alternates between two different states.", + "Includes the ability to flash visibility (blink), color tint, object effect, or opacity (fade).", + "", + "After adding a behavior to an object, you **trigger the effect** by using the **Flash action**.", + "", + "This can be used to:", + "- Let players know they are invincible after being hit", + "- Catch player attention on the interface (for instance a \"press start\" text)", + "" + ], + "origin": { + "identifier": "Flash", + "name": "gdevelop-extension-store" + }, + "tags": [ + "tween", + "flash", + "blink", + "visible", + "invisible", + "hit", + "damage", + "fade", + "effect", + "color", + "tint" + ], + "authorIds": [ + "wWP8BSlAW0UP4NeaHa2LcmmDzmH2", + "q8ubdigLvIRXLxsJDDTaokO41mc2", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Color tint applied to an object.", + "fullName": "Color tint applied to an object", + "functionType": "ExpressionAndCondition", + "name": "ColorTint", + "private": true, + "sentence": "Color tint applied to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Return the color string for the tint applied to the object" + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {gdjs.SpriteRuntimeObject} */\r", + "const tintedObject = objects[0];\r", + "const tint = tintedObject.getColor();\r", + "eventsFunctionContext.returnValue = tint;" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "color" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a color tint is applied to an object.", + "fullName": "Is a color tint applied to an object", + "functionType": "StringExpression", + "name": "IsTinted", + "private": true, + "sentence": "_PARAM1_ is color tinted", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Flash::ColorTint" + }, + "parameters": [ + "", + "=", + "\"255;255;255\"", + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "expressionType": { + "type": "color" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Toggle color tint between the starting tint and a given value.", + "fullName": "Toggle a color tint", + "functionType": "Action", + "name": "ToggleColorTint", + "private": true, + "sentence": "Toggle color tint _PARAM2_ on _PARAM1_", + "events": [ + { + "colorB": 35, + "colorG": 166, + "colorR": 245, + "creationTime": 0, + "name": "Note: This function cannot be \"public\" until it properly handles objects without a starting color tint variable (NULL)", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [], + "parameters": [] }, { - "description": "current health points of the object.", - "fullName": "Health points", - "functionType": "ExpressionAndCondition", - "group": "Health", - "name": "Health", - "sentence": "health points", + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Swap between the starting tint and the given value", + "source": "", + "type": "BuiltinCommonInstructions::Group", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -33222,133 +38911,50 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetObjectVariableAsBoolean" }, "parameters": [ - "Object.Behavior::PropertyCurrentHealth()" + "Object", + "__Flash_ColorTintToggled", + "False" ] } ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Delay before health regeneration starts after last being hit (seconds).", - "fullName": "Health regeneration delay", - "functionType": "Expression", - "group": "Health", - "name": "HealthRegenDelay", - "sentence": "", - "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SetReturnNumber" + "value": "Flash::ColorTint" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenDelay()" + "", + "=", + "Object.VariableString(__FlashColor_StartingTint)", + "Object", + "" ] } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Rate of health regeneration (points per second).", - "fullName": "Rate of health regeneration", - "functionType": "Expression", - "group": "Health", - "name": "HealthRegenRate", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "ChangeColor" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenRate()" + "Object", + "ColorTint" ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Time before damage cooldown ends (seconds).", - "fullName": "Time remaining in damage cooldown", - "functionType": "Expression", - "group": "Health", - "name": "DamageCooldownRemaining", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + }, { "type": { - "value": "SetReturnNumber" + "value": "SetObjectVariableAsBoolean" }, "parameters": [ - "0" + "Object", + "__Flash_ColorTintToggled", + "True" ] } ] @@ -33358,11 +38964,24 @@ "conditions": [ { "type": { - "value": "Health::Health::IsDamageCooldownActive" + "value": "ObjectVariableAsBoolean" }, "parameters": [ "Object", - "Behavior", + "__Flash_ColorTintToggled", + "False" + ] + }, + { + "type": { + "inverted": true, + "value": "Flash::ColorTint" + }, + "parameters": [ + "", + "=", + "Object.VariableString(__FlashColor_StartingTint)", + "Object", "" ] } @@ -33370,141 +38989,268 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "ChangeColor" }, "parameters": [ - "max(0,Object.Behavior::PropertyDamageCooldown() - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" + "Object", + "Object.VariableString(__FlashColor_StartingTint)" ] } ] } ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "objectList" + }, + { + "description": "Color tint", + "name": "ColorTint", + "type": "color" + } + ], + "objectGroups": [] + }, + { + "description": "Toggle object visibility.", + "fullName": "Toggle object visibility", + "functionType": "Action", + "name": "ToggleVisibility", + "private": true, + "sentence": "Toggle visibility of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_VisibilityToggled", + "False" + ] } - ], - "objectGroups": [] + ] }, { - "description": "Time since last hit (seconds).", - "fullName": "Time since last hit", - "functionType": "Expression", - "group": "Health", - "name": "TimeSinceLastHit", - "sentence": "", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\")" - ] - } + "type": { + "value": "Visible" + }, + "parameters": [ + "Object" ] } ], - "expressionType": { - "type": "expression" - }, - "parameters": [ + "actions": [ { - "description": "Object", - "name": "Object", - "type": "object" + "type": { + "value": "Cache" + }, + "parameters": [ + "Object" + ] }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_VisibilityToggled", + "True" + ] } - ], - "objectGroups": [] + ] }, { - "description": "Chance to dodge incoming damage.", - "fullName": "Chance to dodge incoming damage", - "functionType": "Expression", - "group": "Health", - "name": "ChanceToDodge", - "sentence": "", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyChanceToDodge()" - ] - } + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_VisibilityToggled", + "False" ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" + "type": { + "inverted": true, + "value": "Visible" + }, + "parameters": [ + "Object" + ] } ], - "objectGroups": [] - }, + "actions": [ + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ { - "description": "Flat damage reduction from armor. Incoming damage is reduced by this value.", - "fullName": "Flat damage reduction from armor", - "functionType": "Expression", - "group": "Health", - "name": "FlatDamageReduction", + "description": "Object", + "name": "Object", + "type": "objectList" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Make the object flash (blink) for a period of time so it alternates between visible and invisible.", + "fullName": "Flash visibility (blink)", + "name": "Flash", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SetReturnNumber" + "value": "Flash::Flash::PropertyIsFlashing" }, "parameters": [ - "Object.Behavior::PropertyFlatDamageReduction()" + "Object", + "Behavior" ] } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Alternate states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Timer\"", + ">", + "HalfPeriodTime" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::ToggleVisibility" + }, + "parameters": [ + "", + "Object", + "" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Timer\"" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Stop flashing", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::Flash::PropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Duration_Timer\"", + ">", + "FlashDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::Flash::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [] + } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -33514,115 +39260,88 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::Flash", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Percent damage reduction from armor. Range: 0 to 1.", - "fullName": "Percent damage reduction from armor", - "functionType": "Expression", - "group": "Health", - "name": "PercentDamageReduction", - "sentence": "", + "description": "Make an object flash (blink) visibility for a period of time.", + "fullName": "Flash visibility (blink)", + "functionType": "Action", + "name": "Flash", + "sentence": "Make _PARAM0_ flash (blink) for _PARAM2_ seconds", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SetReturnNumber" + "inverted": true, + "value": "Flash::Flash::IsFlashing" }, "parameters": [ - "Object.Behavior::PropertyPercentDamageReduction()" + "Object", + "Behavior", + "" ] } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Health damage taken from most recent hit.", - "fullName": "Health damage taken from most recent hit", - "functionType": "Expression", - "group": "Health", - "name": "PreviousDamageTaken", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "Flash::ToggleVisibility" + }, + "parameters": [ + "", + "Object", + "" + ] + }, + { + "type": { + "value": "Flash::Flash::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + }, + { + "type": { + "value": "ResetObjectTimer" }, "parameters": [ - "Object.Behavior::PropertyDamageToBeApplied()" + "Object", + "\"Flash_Visibility_Timer\"" ] } ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Change the maximum shield points of the object.", - "fullName": "Maximum shield points", - "functionType": "Action", - "group": "Shield configuration", - "name": "SetMaxShield", - "sentence": "Change the maximum shield of _PARAM0_ to _PARAM2_ points", - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "Health::Health::SetPropertyMaxShieldPoints" + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Duration_Timer\"" + ] + }, + { + "type": { + "value": "Flash::Flash::SetPropertyFlashDuration" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "NewFlashDuration" ] } ] @@ -33637,24 +39356,24 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::Flash", "type": "behavior" }, { - "description": "Maximum shield", - "name": "Value", + "description": "Duration of the flashing, in seconds", + "longDescription": "Use \"0\" to keep flashing until stopped.", + "name": "NewFlashDuration", "type": "expression" } ], "objectGroups": [] }, { - "description": "Change current shield points. Will not trigger damage cooldown.", - "fullName": "Shield points", - "functionType": "Action", - "group": "Shield configuration", - "name": "SetShieldPoints", - "sentence": "Change current shield points on _PARAM0_ to _PARAM2_ points", + "description": "Check if an object is flashing visibility.", + "fullName": "Is object flashing visibility", + "functionType": "Condition", + "name": "IsFlashing", + "sentence": "_PARAM0_ is flashing", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -33662,13 +39381,34 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::Flash::PropertyIsFlashing" }, "parameters": [ "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" ] } ] @@ -33683,24 +39423,17 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::Flash", "type": "behavior" - }, - { - "description": "Shield points", - "name": "Value", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change rate of shield regeneration.", - "fullName": "Shield regeneration rate", + "fullName": "", "functionType": "Action", - "group": "Shield configuration", - "name": "SetShieldRegenRate", - "sentence": "Change the shield regeneration rate of _PARAM0_ to _PARAM2_ points per second", + "name": "onDeActivate", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -33708,13 +39441,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldRegenRate" + "value": "Flash::Flash::Stop" }, "parameters": [ "Object", "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "" ] } ] @@ -33729,38 +39461,68 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::Flash", "type": "behavior" - }, - { - "description": "Regeneration rate (points per second)", - "name": "Value", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change delay before shield regeneration starts after being hit.", - "fullName": "Shield regeneration delay", + "description": "Stop flashing visibility (blink) of an object.", + "fullName": "Stop flashing visibility (blink)", "functionType": "Action", - "group": "Shield configuration", - "name": "SetShieldRegenDelay", - "sentence": "Change the shield regeneration delay on _PARAM0_ to _PARAM2_ seconds", + "name": "Stop", + "sentence": "Stop flashing visibility of _PARAM0_", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "Flash::Flash::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldRegenDelay" + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "Flash::Flash::SetPropertyIsFlashing" }, "parameters": [ "Object", "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "no" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Timer\"" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Visibility_Duration_Timer\"" ] } ] @@ -33775,24 +39537,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::Flash", "type": "behavior" - }, - { - "description": "Regeneration delay (seconds)", - "name": "Value", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change duration of shield. Use \"0\" to make shield permanent.", - "fullName": "Duration of shield", - "functionType": "Action", - "group": "Shield configuration", - "name": "SetShieldDuration", - "sentence": "Change the duration of shield on _PARAM0_ to _PARAM2_ seconds", + "description": "the half period of the object (time the object is invisible).", + "fullName": "Half period", + "functionType": "ExpressionAndCondition", + "group": "Flash visibility (blink) configuration", + "name": "HalfPeriodTime", + "sentence": "the half period (time the object is invisible)", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -33800,18 +39557,18 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldDuration" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "HalfPeriodTime" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -33821,24 +39578,18 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::Flash", "type": "behavior" - }, - { - "description": "Shield duration (seconds)", - "name": "Value", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Renew shield duration to it's full value.", - "fullName": "Renew shield duration", - "functionType": "Action", - "group": "Shield configuration", - "name": "RenewShieldDuration", - "sentence": "Renew the shield duration on _PARAM0_", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HalfPeriodTime", + "name": "SetHalfPeriodTime", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -33846,11 +39597,13 @@ "actions": [ { "type": { - "value": "ResetObjectTimer" + "value": "Flash::Flash::SetPropertyHalfPeriodTime" }, "parameters": [ "Object", - "\"__Health.ShieldDuration\"" + "Behavior", + "=", + "Value" ] } ] @@ -33865,210 +39618,293 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::Flash", "type": "behavior" } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Half period ", + "description": "Time that the object is invisible", + "group": "", + "extraInformation": [], + "name": "HalfPeriodTime" }, { - "description": "Activate the shield by setting the shield points and renewing the shield duration (optional).", - "fullName": "Activate shield", + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsFlashing" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Flash duration", + "description": "Use \"0\" to keep flashing until stopped", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "FlashDuration" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Make an object flash a color tint for a period of time.", + "fullName": "Flash color tint", + "name": "FlashColor", + "objectType": "Sprite", + "eventsFunctions": [ + { + "fullName": "", "functionType": "Action", - "group": "Shield", - "name": "ActivateShield", - "sentence": "Activate the shield on _PARAM0_ with _PARAM2_ points (Renew shield duration: _PARAM3_)", + "name": "doStepPreEvents", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "Flash::FlashColor::PropertyIsFlashing" }, "parameters": [ "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"ShieldPoints\")" + "Behavior" ] } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Alternate states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Timer\"", + ">", + "HalfPeriodTime" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Timer\"" + ] + }, + { + "type": { + "value": "Flash::ToggleColorTint" + }, + "parameters": [ + "", + "Object", + "TintColor", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Stop flashing", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashColor::PropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Duration_Timer\"", + ">", + "FlashDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashColor::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [] + } ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashColor", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Make an object flash a color tint for a period of time.", + "fullName": "Flash a color tint", + "functionType": "Action", + "name": "Flash", + "sentence": "Make _PARAM0_ flash the color tint _PARAM3_ for _PARAM2_ seconds", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "Health::Health::PropertyMaxShieldPoints" + "inverted": true, + "value": "Flash::FlashColor::PropertyIsFlashing" }, "parameters": [ "Object", - "Behavior", - ">", - "0" + "Behavior" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "ModVarObjetTxt" }, "parameters": [ "Object", - "Behavior", + "__FlashColor_StartingTint", "=", - "min(GetArgumentAsNumber(\"ShieldPoints\"),Object.Behavior::MaxShield())" + "Flash::ColorTint(Object)" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "GetArgumentAsBoolean" + "value": "ResetObjectTimer" }, "parameters": [ - "\"RenewShieldDuration\"" + "Object", + "\"Flash_Color_Timer\"" ] - } - ], - "actions": [ + }, { "type": { - "value": "Health::Health::RenewShieldDuration" + "value": "Flash::ToggleColorTint" }, "parameters": [ + "", "Object", - "Behavior", + "NewColorTint", "" ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" - }, - { - "description": "Shield points", - "name": "ShieldPoints", - "type": "expression" - }, - { - "defaultValue": "yes", - "description": "Renew shield duration", - "name": "RenewShieldDuration", - "optional": true, - "type": "yesorno" - } - ], - "objectGroups": [] - }, - { - "description": "Change maximum shield points.", - "fullName": "Max shield points ", - "functionType": "Action", - "group": "Shield configuration", - "name": "SetMaxShieldPoints", - "sentence": "Change the maximum shield points on _PARAM0_ to _PARAM2_ points", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + }, { "type": { - "value": "Health::Health::SetPropertyMaxShieldPoints" + "value": "Flash::FlashColor::SetPropertyIsFlashing" }, "parameters": [ "Object", "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "yes" ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" }, - { - "description": "Shield points", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Enable (or disable) blocking excess damage when shield breaks.", - "fullName": "Block excess damage when shield breaks", - "functionType": "Action", - "group": "Shield configuration", - "name": "SetShieldBlockExcessDamage", - "sentence": "Shield on _PARAM0_ blocks excess damage when it breaks: _PARAM2_", - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "Health::Health::SetPropertyBlockExcessDamage" + "value": "ResetObjectTimer" }, "parameters": [ "Object", - "Behavior", - "no" + "\"Flash_Color_Duration_Timer\"" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "GetArgumentAsBoolean" + "value": "Flash::FlashColor::SetPropertyTintColor" }, "parameters": [ - "\"Value\"" + "Object", + "Behavior", + "=", + "NewColorTint" ] - } - ], - "actions": [ + }, { "type": { - "value": "Health::Health::SetPropertyBlockExcessDamage" + "value": "Flash::FlashColor::SetPropertyFlashDuration" }, "parameters": [ "Object", "Behavior", - "yes" + "=", + "NewFlashDuration" ] } ] @@ -34078,29 +39914,35 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashColor", "type": "behavior" }, { - "description": "Block excess damage", - "name": "Value", - "type": "yesorno" + "description": "Duration of the flashing, in seconds", + "longDescription": "Use \"0\" to keep flashing until stopped.", + "name": "NewFlashDuration", + "type": "expression" + }, + { + "description": "Color tint", + "name": "NewColorTint", + "type": "color" } ], "objectGroups": [] }, { - "description": "Check if the shield was just damaged previously in the events.", - "fullName": "Is shield just damaged", + "description": "Check if an object is flashing a color tint.", + "fullName": "Is object flashing a color tint", "functionType": "Condition", - "group": "Shield", - "name": "IsShieldJustDamaged", - "sentence": "Shield on _PARAM0_ has just been damaged", + "name": "IsFlashing", + "sentence": "_PARAM0_ is flashing a color tint", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -34121,7 +39963,7 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsShieldJustDamaged" + "value": "Flash::FlashColor::PropertyIsFlashing" }, "parameters": [ "Object", @@ -34145,24 +39987,23 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashColor", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if incoming damage was just dodged.", - "fullName": "Damage was just dodged", - "functionType": "Condition", - "group": "Health", - "name": "IsJustDodged", - "sentence": "_PARAM0_ just dodged incoming damage", + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -34170,34 +40011,12 @@ "actions": [ { "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "False" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyIsJustDodged" + "value": "Flash::FlashColor::Stop" }, "parameters": [ "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "Behavior", + "" ] } ] @@ -34207,143 +40026,74 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashColor", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if the shield is active (based on shield points and duration).", - "fullName": "Is shield active", - "functionType": "Condition", - "group": "Shield", - "name": "IsShieldActive", - "sentence": "Shield on _PARAM0_ is active", + "description": "Stop flashing a color tint on an object.", + "fullName": "Stop flashing color tint", + "functionType": "Action", + "name": "Stop", + "sentence": "Stop flashing color tint _PARAM0_", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SetReturnBoolean" + "value": "Flash::FlashColor::PropertyIsFlashing" }, "parameters": [ - "False" + "Object", + "Behavior" ] } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "To be considered \"active\", a shield must have positive points AND not exceed duration", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + ], + "actions": [ { "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" + "value": "Flash::FlashColor::SetPropertyIsFlashing" }, "parameters": [ "Object", "Behavior", - ">", - "0" + "no" ] - } - ], - "actions": [], - "events": [ + }, { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "ChangeColor" }, - "comment": "Don't check the timer when duration is zero (or negative)", - "comment2": "" + "parameters": [ + "Object", + "Object.VariableString(__FlashColor_StartingTint)" + ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyShieldDuration" - }, - "parameters": [ - "Object", - "Behavior", - "<=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Timer\"" ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyShieldDuration" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "0" - ] - }, - { - "type": { - "value": "CompareObjectTimer" - }, - "parameters": [ - "Object", - "\"__Health.ShieldDuration\"", - "<", - "Object.Behavior::PropertyShieldDuration()" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Duration_Timer\"" ] } ] @@ -34353,24 +40103,25 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashColor", "type": "behavior" } ], "objectGroups": [] }, { - "description": "maximum shield points of the object.", - "fullName": "Maximum shield points", + "description": "the half period (time between flashes) of the object.", + "fullName": "Half period", "functionType": "ExpressionAndCondition", - "group": "Shield", - "name": "MaxShield", - "sentence": "maximum shield points", + "group": "Flash color tint configuration", + "name": "HalfPeriodTime", + "sentence": "the half period (time between flashes)", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -34381,7 +40132,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxShieldPoints()" + "HalfPeriodTime" ] } ] @@ -34394,23 +40145,23 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashColor", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Duration of the shield (seconds).", - "fullName": "Duration of shield", - "functionType": "Expression", - "group": "Shield", - "name": "ShieldDuration", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HalfPeriodTime", + "name": "SetHalfPeriodTime", "sentence": "", "events": [ { @@ -34419,59 +40170,256 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "Flash::FlashColor::SetPropertyHalfPeriodTime" }, "parameters": [ - "Object.Behavior::PropertyShieldDuration()" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashColor", "type": "behavior" } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Half period", + "description": "Time between flashes", + "group": "", + "extraInformation": [], + "name": "HalfPeriodTime" }, { - "description": "Delay before shield regeneration starts after being hit (seconds).", - "fullName": "Shield regeneration delay", - "functionType": "Expression", - "group": "Shield", - "name": "ShieldRegenDelay", + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsFlashing" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Flash duration", + "description": "Use \"0\" to keep flashing until stopped", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "FlashDuration" + }, + { + "value": "\"255;255;255\"", + "type": "String", + "label": "Tint color", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TintColor" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Flash opacity smoothly (fade) in a repeating loop.", + "fullName": "Flash opacity smothly (fade)", + "name": "FlashOpacity", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SetReturnNumber" + "value": "Flash::FlashOpacity::IsFlashing" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenDelay()" + "Object", + "Behavior", + "" ] } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Alternate states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween::HasFinished" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectOpacityTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToStartingOpacity\"", + "StartingOpacity", + "\"easeInOutCubic\"", + "1000 * HalfPeriodTime", + "" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Tween::HasFinished" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToStartingOpacity\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Tween::AddObjectOpacityTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"", + "TargetOpacity", + "\"easeInOutCubic\"", + "1000 * HalfPeriodTime", + "" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToStartingOpacity\"" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Stop flashing", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashOpacity::PropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Opacity_Duration_Timer\"", + ">", + "FlashDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashOpacity::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [] + } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -34481,38 +40429,109 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashOpacity", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Rate of shield regeneration (points per second).", - "fullName": "Rate of shield regeneration", - "functionType": "Expression", - "group": "Shield", - "name": "ShieldRegenRate", - "sentence": "", + "description": "Make an object flash opacity smoothly (fade) in a repeating loop.", + "fullName": "Flash the opacity (fade)", + "functionType": "Action", + "name": "Flash", + "sentence": "Make _PARAM0_ flash opacity smoothly to _PARAM4_ in a loop for _PARAM3_ seconds", "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Flash::FlashOpacity::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyStartingOpacity" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Object.Opacity::Value()" + ] + }, + { + "type": { + "value": "Tween::AddObjectOpacityTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"", + "NewTargetOpacity", + "\"easeInOutCubic\"", + "1000 * HalfPeriodTime", + "" + ] + }, + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Opacity_Duration_Timer\"" + ] + }, + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyFlashDuration" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenRate()" + "Object", + "Behavior", + "=", + "NewFlashDuration" + ] + }, + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyTargetOpacity" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "NewTargetOpacity" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -34522,19 +40541,35 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashOpacity", "type": "behavior" + }, + { + "description": "Tween behavior (required)", + "name": "TweenBehavior", + "supplementaryInformation": "Tween::TweenBehavior", + "type": "behavior" + }, + { + "description": "Duration of the flashing, in seconds", + "longDescription": "Use \"0\" to keep flashing until stopped.", + "name": "NewFlashDuration", + "type": "expression" + }, + { + "description": "Target opacity", + "name": "NewTargetOpacity", + "type": "expression" } ], "objectGroups": [] }, { - "description": "Time before the shield duration ends (seconds).", - "fullName": "Time before shield duration ends", - "functionType": "Expression", - "group": "Shield", - "name": "ShieldTimeRemaining", - "sentence": "", + "description": "Check if an object is flashing opacity.", + "fullName": "Is object flashing opacity", + "functionType": "Condition", + "name": "IsFlashing", + "sentence": "_PARAM0_ is flashing opacity", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -34542,10 +40577,10 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" }, "parameters": [ - "0" + "False" ] } ] @@ -34555,31 +40590,26 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyShieldDuration" + "value": "Flash::FlashOpacity::PropertyIsFlashing" }, "parameters": [ "Object", - "Behavior", - ">", - "0" + "Behavior" ] } ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" }, "parameters": [ - "max(0,Object.Behavior::PropertyShieldDuration() - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" + "True" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -34589,19 +40619,17 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashOpacity", "type": "behavior" } ], "objectGroups": [] }, { - "description": "current shield points of the object.", - "fullName": "Shield points", - "functionType": "ExpressionAndCondition", - "group": "Shield", - "name": "ShieldPoints", - "sentence": "shield points", + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -34609,18 +40637,17 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "Flash::FlashOpacity::Stop" }, "parameters": [ - "Object.Behavior::PropertyCurrentShieldPoints()" + "Object", + "Behavior", + "" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -34630,19 +40657,109 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashOpacity", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Shield damage taken from most recent hit.", - "fullName": "Shield damage taken from most recent hit", - "functionType": "Expression", - "group": "Health", - "name": "PreviousDamageToShield", - "sentence": "", + "description": "Stop flashing opacity of an object.", + "fullName": "Stop flashing opacity", + "functionType": "Action", + "name": "Stop", + "sentence": "Stop flashing opacity of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashOpacity::IsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Duration_Timer\"" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToStartingOpacity\"" + ] + }, + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" + }, + "parameters": [ + "Object", + "Opacity", + "=", + "StartingOpacity" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashOpacity", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the half period (time between flashes) of the object.", + "fullName": "Half period", + "functionType": "ExpressionAndCondition", + "group": "Flash opacity smothly (fade) configuration", + "name": "HalfPeriodTime", + "sentence": "the half period (time between flashes)", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -34653,7 +40770,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDamageTaken()" + "HalfPeriodTime" ] } ] @@ -34671,18 +40788,17 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashOpacity", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Health points gained from previous heal.", - "fullName": "Health points gained from previous heal", - "functionType": "Expression", - "group": "Health", - "name": "PreviousHealAmount", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HalfPeriodTime", + "name": "SetHalfPeriodTime", "sentence": "", "events": [ { @@ -34691,18 +40807,18 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "Flash::FlashOpacity::SetPropertyHalfPeriodTime" }, "parameters": [ - "Object.Behavior::PropertyHealToBeApplied()" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -34712,7 +40828,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashOpacity", "type": "behavior" } ], @@ -34720,289 +40836,88 @@ } ], "propertyDescriptors": [ - { - "value": "100", - "type": "Number", - "label": "Starting health (life) points", - "description": "", - "group": "Health", - "extraInformation": [], - "hidden": false, - "name": "Health" - }, - { - "value": "0", - "type": "Number", - "label": "Current health (life) points", - "description": "", - "group": "Health", - "extraInformation": [], - "hidden": true, - "name": "CurrentHealth" - }, - { - "value": "100", - "type": "Number", - "label": "Maximum health (points) Use \"0\" for no maximum", - "description": "", - "group": "Health", - "extraInformation": [], - "hidden": false, - "name": "MaxHealth" - }, - { - "value": "0", - "type": "Number", - "label": "Damage cooldown (seconds) Use \"0\" for no cooldown", - "description": "", - "group": "Health", - "extraInformation": [], - "hidden": false, - "name": "DamageCooldown" - }, - { - "value": "", - "type": "Boolean", - "label": "", - "description": "", - "group": "Health", - "extraInformation": [], - "hidden": true, - "name": "IsHealthJustDamaged" - }, - { - "value": "0", - "type": "Number", - "label": "Rate of health regeneration (points per second)", - "description": "", - "group": "Health regeneration", - "extraInformation": [], - "hidden": false, - "name": "HealthRegenRate" - }, - { - "value": "0", - "type": "Number", - "label": "Delay before health regeneration starts after being hit (seconds)", - "description": "", - "group": "Health regeneration", - "extraInformation": [], - "hidden": false, - "name": "HealthRegenDelay" - }, - { - "value": "", - "type": "Boolean", - "label": "Allow heals to increase health above max health (regen will never exceed max health)", - "description": "", - "group": "Health", - "extraInformation": [], - "hidden": false, - "name": "AllowOverHealing" - }, - { - "value": "", - "type": "Boolean", - "label": "", - "description": "", - "group": "Health", - "extraInformation": [], - "hidden": true, - "name": "HitAtLeastOnce" - }, { "value": "", - "type": "Boolean", - "label": "", + "type": "Behavior", + "label": "Opacity capability", "description": "", "group": "", - "extraInformation": [], - "hidden": true, - "name": "IsJustHealed" - }, - { - "value": "", - "type": "Number", - "label": "Current shield points", - "description": "", - "group": "Shield", - "extraInformation": [], - "hidden": true, - "name": "CurrentShieldPoints" - }, - { - "value": "0", - "type": "Number", - "label": "Maximum shield (points) Use \"0\" for no maximum", - "description": "", - "group": "Shield", - "extraInformation": [], - "hidden": false, - "name": "MaxShieldPoints" - }, - { - "value": "5", - "type": "Number", - "label": "Duration of shield (seconds) Use \"0\" to make shield permanent", - "description": "", - "group": "Shield", - "extraInformation": [], - "hidden": false, - "name": "ShieldDuration" - }, - { - "value": "0", - "type": "Number", - "label": "Rate of shield regeneration (points per second)", - "description": "", - "group": "Shield regeneration", - "extraInformation": [], - "hidden": false, - "name": "ShieldRegenRate" + "extraInformation": [ + "OpacityCapability::OpacityBehavior" + ], + "name": "Opacity" }, { "value": "", - "type": "Boolean", - "label": "Block excess damage when shield is broken", + "type": "Behavior", + "label": "Tween Behavior (required)", "description": "", - "group": "Shield", - "extraInformation": [], - "hidden": false, - "name": "BlockExcessDamage" + "group": "", + "extraInformation": [ + "Tween::TweenBehavior" + ], + "name": "TweenBehavior" }, { - "value": "", + "value": "0.1", "type": "Number", - "label": "Delay before shield regeneration starts after being hit (seconds)", - "description": "", - "group": "Shield regeneration", + "unit": "Second", + "label": "Half period", + "description": "Time between flashes", + "group": "", "extraInformation": [], - "hidden": false, - "name": "ShieldRegenDelay" + "name": "HalfPeriodTime" }, { "value": "", "type": "Boolean", "label": "", "description": "", - "group": "Shield", + "group": "", "extraInformation": [], "hidden": true, - "name": "IsShieldJustDamaged" - }, - { - "value": "0", - "type": "Number", - "label": "Chance to dodge incoming damage (Range: 0 to 1) If damage is dodged, no damage is applied", - "description": "", - "group": "Health configuration", - "extraInformation": [], - "hidden": false, - "name": "ChanceToDodge" + "name": "IsFlashing" }, { "value": "0", "type": "Number", - "label": "Damage to health from the previous incoming damage", - "description": "", - "group": "Health", + "unit": "Second", + "label": "Flash duration", + "description": "Use \"0\" to keep flashing until stopped", + "group": "", "extraInformation": [], "hidden": true, - "name": "DamageToBeApplied" - }, - { - "value": "0", - "type": "Number", - "label": "Flat damage reduction from armor (incoming damage is reduced by this value)", - "description": "", - "group": "Armor", - "extraInformation": [], - "hidden": false, - "name": "FlatDamageReduction" + "name": "FlashDuration" }, { "value": "0", "type": "Number", - "label": "Percentage damage reduction from armor (Range: 0 to 1)", - "description": "", - "group": "Armor", - "extraInformation": [], - "hidden": false, - "name": "PercentDamageReduction" - }, - { - "value": "", - "type": "Boolean", - "label": "", - "description": "", + "unit": "Dimensionless", + "label": "Target opacity (Range: 0 - 255)", + "description": "Opacity will fade between the starting value and a target value", "group": "", "extraInformation": [], "hidden": true, - "name": "IsJustDodged" + "name": "TargetOpacity" }, { "value": "", "type": "Number", - "label": "Damage to shield from the previous incoming damage", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ShieldDamageTaken" - }, - { - "value": "0", - "type": "Number", - "label": "Health points gained from the previous heal", - "description": "", + "unit": "Dimensionless", + "label": "Starting opacity", + "description": "Opacity will fade between the starting value and a target value", "group": "", "extraInformation": [], "hidden": true, - "name": "HealToBeApplied" + "name": "StartingOpacity" } ], "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "@4ian", - "category": "", - "extensionNamespace": "", - "fullName": "Flash (blink)", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWZsYXNoLW91dGxpbmUiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNywySDE3TDEzLjUsOUgxN0wxMCwyMlYxNEg3VjJNOSw0VjEySDEyVjE0LjY2TDE0LDExSDEwLjI0TDEzLjc2LDRIOVoiIC8+PC9zdmc+", - "name": "Flash", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/flash-outline.svg", - "shortDescription": "Make the object flash (blink) for a period of time, so that it is alternately visible and invisible.\nTrigger the effect by using the Flash action.", - "version": "1.0.0", - "description": [ - "Make the object flash (blink) for a period of time, so that it is alternately visible and invisible.", - "After adding this to an object, you have to **trigger the effect** by using the **Flash action**." - ], - "origin": { - "identifier": "Flash", - "name": "gdevelop-extension-store" - }, - "tags": [ - "flash", - "blink", - "visible", - "invisible", - "hit", - "damage" - ], - "authorIds": [ - "wWP8BSlAW0UP4NeaHa2LcmmDzmH2" - ], - "dependencies": [], - "eventsFunctions": [], - "eventsBasedBehaviors": [ + }, { - "description": "Make the object flash (blink) for a period of time, so that it is alternately visible and invisible.\nTrigger the effect by using the Flash action.", - "fullName": "Flash (blink)", - "name": "Flash", + "description": "Make the object flash an effect for a period of time.", + "fullName": "Flash effect", + "name": "FlashEffect", "objectType": "", "eventsFunctions": [ { @@ -35016,54 +40931,233 @@ "conditions": [ { "type": { - "value": "Flash::Flash::PropertyIsFlashing" + "value": "Flash::FlashEffect::IsFlashing" }, "parameters": [ "Object", - "Behavior" + "Behavior", + "" ] } ], "actions": [], "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Alternate states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { - "type": { - "value": "ObjectTimer" - }, - "parameters": [ - "Object", - "\"FlashTimer\"", - "Object.Behavior::PropertyHalfPeriodTime()" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Timer\"", + ">", + "HalfPeriodTime" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Timer\"" + ] + }, + { + "type": { + "value": "Flash::FlashEffect::ToggleEffect" + }, + "parameters": [ + "Object", + "Behavior", + "EffectName", + "" + ] + } ] - }, + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Stop flashing", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { - "type": { - "value": "Visible" - }, - "parameters": [ - "Object" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashEffect::PropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Duration_Timer\"", + ">", + "FlashDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashEffect::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } ] } ], - "actions": [ + "parameters": [] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashEffect", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Make an object flash an effect for a period of time.", + "fullName": "Flash an effect", + "functionType": "Action", + "name": "Flash", + "sentence": "Make _PARAM0_ flash the effect _PARAM3_ for _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Stop flashing existing effects if the effect name changed" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashEffect::IsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "Flash::FlashEffect::PropertyEffectName" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "NewEffectName" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashEffect::Stop" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Flash::FlashEffect::IsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "Cache" + "value": "EffectCapability::EffectBehavior::IsEffectEnabled" }, "parameters": [ - "Object" + "Object", + "Effect", + "NewEffectName" ] - }, + } + ], + "actions": [ { "type": { - "value": "ResetObjectTimer" + "value": "SetObjectVariableAsBoolean" }, "parameters": [ "Object", - "\"FlashTimer\"" + "__FlashColor_StartingState", + "True" ] } ] @@ -35073,31 +41167,41 @@ "conditions": [ { "type": { - "value": "ObjectTimer" + "inverted": true, + "value": "EffectCapability::EffectBehavior::IsEffectEnabled" }, "parameters": [ "Object", - "\"FlashTimer\"", - "Object.Behavior::PropertyHalfPeriodTime()" + "Effect", + "NewEffectName" ] - }, + } + ], + "actions": [ { "type": { - "inverted": true, - "value": "Visible" + "value": "SetObjectVariableAsBoolean" }, "parameters": [ - "Object" + "Object", + "__FlashColor_StartingState", + "False" ] } - ], + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], "actions": [ { "type": { - "value": "Montre" + "value": "Flash::FlashEffect::ToggleEffect" }, "parameters": [ "Object", + "Behavior", + "NewEffectName", "" ] }, @@ -35107,77 +41211,26 @@ }, "parameters": [ "Object", - "\"FlashTimer\"" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ObjectTimer" - }, - "parameters": [ - "Object", - "\"FlashDurationTimer\"", - "Object.Behavior::PropertyFlashDuration()" + "\"Flash_Effect_Timer\"" ] - } - ], - "actions": [ + }, { "type": { - "value": "Flash::Flash::Stop" + "value": "Flash::FlashEffect::SetPropertyIsFlashing" }, "parameters": [ "Object", "Behavior", - "" + "yes" ] } ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Flash::Flash", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Make the specified object(s) blink for the given duration.", - "fullName": "Flash (blink)", - "functionType": "Action", - "name": "Flash", - "sentence": "Make _PARAM0_ blink for _PARAM2_ seconds", - "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "GetArgumentAsNumber(\"FlashDuration\")", - ">", - "0" - ] - } - ], + "conditions": [], "actions": [ { "type": { @@ -35185,28 +41238,29 @@ }, "parameters": [ "Object", - "\"FlashDurationTimer\"" + "\"Flash_Effect_Duration_Timer\"" ] }, { "type": { - "value": "Flash::Flash::SetPropertyFlashDuration" + "value": "Flash::FlashEffect::SetPropertyFlashDuration" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"FlashDuration\")" + "NewFlashDuration" ] }, { "type": { - "value": "Flash::Flash::SetPropertyIsFlashing" + "value": "Flash::FlashEffect::SetPropertyEffectName" }, "parameters": [ "Object", "Behavior", - "yes" + "=", + "NewEffectName" ] } ] @@ -35221,23 +41275,29 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Flash::Flash", + "supplementaryInformation": "Flash::FlashEffect", "type": "behavior" }, { - "description": "Duration of the blinking, in seconds", - "name": "FlashDuration", + "description": "Duration of the flashing, in seconds", + "longDescription": "Use \"0\" to keep flashing until stopped.", + "name": "NewFlashDuration", "type": "expression" + }, + { + "description": "Name of effect", + "name": "NewEffectName", + "type": "objectEffectName" } ], "objectGroups": [] }, { - "description": "Check if the specified objects are flashing.", - "fullName": "Is object flashing", + "description": "Check if an object is flashing an effect.", + "fullName": "Is object flashing an effect", "functionType": "Condition", "name": "IsFlashing", - "sentence": "_PARAM0_ is flashing", + "sentence": "_PARAM0_ is flashing an effect", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -35258,7 +41318,7 @@ "conditions": [ { "type": { - "value": "Flash::Flash::PropertyIsFlashing" + "value": "Flash::FlashEffect::PropertyIsFlashing" }, "parameters": [ "Object", @@ -35287,7 +41347,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Flash::Flash", + "supplementaryInformation": "Flash::FlashEffect", "type": "behavior" } ], @@ -35296,7 +41356,7 @@ { "fullName": "", "functionType": "Action", - "name": "onOwnerRemovedFromScene", + "name": "onDeActivate", "sentence": "", "events": [ { @@ -35305,7 +41365,7 @@ "actions": [ { "type": { - "value": "Flash::Flash::Stop" + "value": "Flash::FlashEffect::Stop" }, "parameters": [ "Object", @@ -35325,16 +41385,183 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Flash::Flash", + "supplementaryInformation": "Flash::FlashEffect", "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "", + "description": "Stop flashing an effect of an object.", + "fullName": "Stop flashing an effect", "functionType": "Action", - "name": "onDeActivate", + "name": "Stop", + "sentence": "Stop flashing an effect on _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashEffect::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "Flash::FlashEffect::SetPropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Timer\"" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Effect_Duration_Timer\"" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__FlashEffect_StartingState", + "True" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "EffectName", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__FlashEffect_StartingState", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "EffectName", + "" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashEffect", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the half period (time between flashes) of the object.", + "fullName": "Half period", + "functionType": "ExpressionAndCondition", + "group": "Flash effect configuration", + "name": "HalfPeriodTime", + "sentence": "the half period (time between flashes)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "HalfPeriodTime" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashEffect", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HalfPeriodTime", + "name": "SetHalfPeriodTime", "sentence": "", "events": [ { @@ -35343,12 +41570,13 @@ "actions": [ { "type": { - "value": "Flash::Flash::Stop" + "value": "Flash::FlashEffect::SetPropertyHalfPeriodTime" }, "parameters": [ "Object", "Behavior", - "" + "=", + "Value" ] } ] @@ -35363,50 +41591,109 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Flash::Flash", + "supplementaryInformation": "Flash::FlashEffect", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Stop the flashing of the specified object.", - "fullName": "Stop flashing", + "description": "Toggle an object effect.", + "fullName": "Toggle an object effect", "functionType": "Action", - "name": "Stop", - "sentence": "Stop flashing _PARAM0_", + "name": "ToggleEffect", + "private": true, + "sentence": "Toggle effect _PARAM2_ on _PARAM0_", "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_EffectToggled", + "False" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "Flash::Flash::PropertyIsFlashing" + "value": "EffectCapability::EffectBehavior::IsEffectEnabled" }, "parameters": [ "Object", - "Behavior" + "Effect", + "EffectName" ] } ], "actions": [ { "type": { - "value": "Montre" + "value": "EffectCapability::EffectBehavior::EnableEffect" }, "parameters": [ "Object", + "Effect", + "EffectName", "" ] }, { "type": { - "value": "Flash::Flash::SetPropertyIsFlashing" + "value": "SetObjectVariableAsBoolean" }, "parameters": [ "Object", - "Behavior", - "no" + "__Flash_EffectToggled", + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_EffectToggled", + "False" + ] + }, + { + "type": { + "inverted": true, + "value": "EffectCapability::EffectBehavior::IsEffectEnabled" + }, + "parameters": [ + "Object", + "Effect", + "EffectName" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "EffectName", + "yes" ] } ] @@ -35421,22 +41708,38 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Flash::Flash", + "supplementaryInformation": "Flash::FlashEffect", "type": "behavior" + }, + { + "description": "Effect name to toggle", + "name": "EffectName", + "type": "objectEffectName" } ], "objectGroups": [] } ], "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Effect capability", + "description": "", + "group": "", + "extraInformation": [ + "EffectCapability::EffectBehavior" + ], + "name": "Effect" + }, { "value": "0.1", "type": "Number", - "label": "Half period (time during which object is invisible), in seconds", - "description": "", + "unit": "Second", + "label": "Half period", + "description": "Time between flashes", "group": "", "extraInformation": [], - "hidden": false, "name": "HalfPeriodTime" }, { @@ -35452,12 +41755,23 @@ { "value": "0", "type": "Number", - "label": "", - "description": "", + "unit": "Second", + "label": "Flash duration", + "description": "Use \"0\" to keep flashing until stopped", "group": "", "extraInformation": [], "hidden": true, "name": "FlashDuration" + }, + { + "value": "", + "type": "String", + "label": "Name of effect", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "EffectName" } ], "sharedPropertyDescriptors": [] @@ -35467,34 +41781,24 @@ }, { "author": "Tristan Rhodes (https://victrisgames.itch.io/)", - "category": "", + "category": "Visual effect", "extensionNamespace": "", - "fullName": "Shake Object (position, angle, scale)", - "helpPath": "https://victrisgames.itch.io/gdevelop-camera-shake-example", + "fullName": "Shake object", + "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWFycm93LWFsbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMywxMUgxOEwxNi41LDkuNUwxNy45Miw4LjA4TDIxLjg0LDEyTDE3LjkyLDE1LjkyTDE2LjUsMTQuNUwxOCwxM0gxM1YxOEwxNC41LDE2LjVMMTUuOTIsMTcuOTJMMTIsMjEuODRMOC4wOCwxNy45Mkw5LjUsMTYuNUwxMSwxOFYxM0g2TDcuNSwxNC41TDYuMDgsMTUuOTJMMi4xNiwxMkw2LjA4LDguMDhMNy41LDkuNUw2LDExSDExVjZMOS41LDcuNUw4LjA4LDYuMDhMMTIsMi4xNkwxNS45Miw2LjA4TDE0LjUsNy41TDEzLDZWMTFaIiAvPjwvc3ZnPg==", "name": "ShakeObject", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/arrow-all.svg", - "shortDescription": "Shake an object, using one or more ways to shake (position, angle, scale).", - "version": "1.5.5", + "shortDescription": "Shake an object.", + "version": "1.5.7", "description": [ - "Select one or more methods of shaking:", - "- Position: Shake the X and/or Y position of the object ", - "- Angle: Shake the angle (rotation) of the object ", - "- Scale: Shake the scale of the object (must be a sprite)", + "Shake an object (position, angle or scale).", "", - "Control how the object shakes:", - "- Amplitude: How far the object moves during each shake", - "- Duration: Amount of time to shake the object", - "- Time between shakes: Amount of time between each movement of the object", - "- Keep shaking until stopped (boolean)", + "It can be used for:", + "- Hit or impact", + "- Object slowly rocking back and forth (like a ship)", + "- Simulate engine vibration, earthquake, or pulsing", "", - "Tips:", - "- For a single-shake effect, set the \"Time between shakes\" to be equal to \"Duration\" (great for a hit or impact)", - "- To make the single-shake move in the opposite direction, use negative numbers ", - "- To repeat a single-shake effect in a loop, add a condition \"Object is not shaking\" ", - "- Use a long \"Time between shakes\" to simulate a slow moving object (like a ship rocking back and forth)", - "- Make sure to \"Stop shaking\" before starting a new shake if it uses different parameters. ", - "- Use \"Shake until stopped\" to simulate engine vibration, earthquake, or pulsing" + "The top-down RPG example uses this extension for damage animations ([open the project online](https://editor.gdevelop.io/?project=example://top-down-rpg))." ], "origin": { "identifier": "ShakeObject", @@ -35514,16 +41818,18 @@ "gqDaZjCfevOOxBYkK6zlhtZnXCg1" ], "dependencies": [], + "globalVariables": [], + "sceneVariables": [], "eventsFunctions": [], "eventsBasedBehaviors": [ { - "description": "Shake an object, using one or more ways to shake (position, angle).\nThis behavior can be used on any type of object.", + "description": "Shake objects with translation and rotation.", "fullName": "Shake object (position, angle)", "name": "ShakeObject_PositionAngle", "objectType": "", "eventsFunctions": [ { - "description": "Shake an object, using one or more ways to shake (position, angle).", + "description": "Shake an object, using one or more ways to shake (position, angle). Make sure to \"Stop shaking\" before starting a new shake if it uses different parameters. ", "fullName": "Shake object (position, angle)", "functionType": "Action", "name": "ShakeObject_PositionAngle", @@ -35548,8 +41854,7 @@ "textG": 0, "textR": 0 }, - "comment": "Start/Reset duration timer", - "comment2": "" + "comment": "Start/Reset duration timer" }, { "type": "BuiltinCommonInstructions::Standard", @@ -35576,8 +41881,7 @@ "textG": 0, "textR": 0 }, - "comment": "Pass input parameters to global variables so that onScenePostEvents can use them", - "comment2": "" + "comment": "Pass input parameters to global variables so that onScenePostEvents can use them" }, { "type": "BuiltinCommonInstructions::Standard", @@ -35591,7 +41895,7 @@ "Object", "__ShakeObject_Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -35602,7 +41906,7 @@ "Object", "__ShakeObject_PowerX", "=", - "GetArgumentAsNumber(\"PowerX\")" + "PowerX" ] }, { @@ -35613,7 +41917,7 @@ "Object", "__ShakeObject_PowerY", "=", - "GetArgumentAsNumber(\"PowerY\")" + "PowerY" ] }, { @@ -35624,7 +41928,7 @@ "Object", "__ShakeObject_PowerAngle", "=", - "GetArgumentAsNumber(\"PowerAngle\")" + "PowerAngle" ] }, { @@ -35635,7 +41939,7 @@ "Object", "__ShakeObject_TimeBetweenShakes", "=", - "GetArgumentAsNumber(\"TimeBetweenShakes\")" + "TimeBetweenShakes" ] } ] @@ -35650,8 +41954,7 @@ "textG": 0, "textR": 0 }, - "comment": "Determine if the shake should keep going until stopped", - "comment2": "" + "comment": "Determine if the shake should keep going until stopped" }, { "type": "BuiltinCommonInstructions::Standard", @@ -35704,8 +42007,7 @@ "textG": 0, "textR": 0 }, - "comment": "Add default values if none were provided", - "comment2": "" + "comment": "Add default values if none were provided" }, { "type": "BuiltinCommonInstructions::Standard", @@ -35775,8 +42077,7 @@ "textG": 0, "textR": 0 }, - "comment": "If duration is less than a single shake, increase duration to make 1 full shake", - "comment2": "" + "comment": "If duration is less than a single shake, increase duration to make 1 full shake" }, { "type": "BuiltinCommonInstructions::Standard", @@ -35817,8 +42118,7 @@ "textG": 0, "textR": 0 }, - "comment": "Detect initial shake", - "comment2": "" + "comment": "Detect initial shake" }, { "type": "BuiltinCommonInstructions::Standard", @@ -35859,8 +42159,7 @@ "textG": 0, "textR": 0 }, - "comment": "Initiate the onScenePostEvents function", - "comment2": "" + "comment": "Initiate the onScenePostEvents function" }, { "type": "BuiltinCommonInstructions::Standard", @@ -35907,6 +42206,7 @@ }, { "description": "Amplitude of position shake in Y direction (in pixels) (For example: 5)", + "longDescription": "Use a negative number to make the single-shake move in the opposite direction.", "name": "PowerY", "type": "expression" }, @@ -35917,6 +42217,7 @@ }, { "description": "Amount of time between shakes (in seconds) (Default: 0.08)", + "longDescription": "For a single-shake effect, set it to the same value as \"Duration\".", "name": "TimeBetweenShakes", "type": "expression" }, @@ -35980,8 +42281,7 @@ "textG": 0, "textR": 0 }, - "comment": "Keep object shaking forever (if desired)", - "comment2": "" + "comment": "Keep object shaking forever (if desired)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36039,8 +42339,7 @@ "textG": 0, "textR": 0 }, - "comment": "Run once before every shake movement", - "comment2": "" + "comment": "Run once before every shake movement" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36117,8 +42416,7 @@ "textG": 0, "textR": 0 }, - "comment": "Move to correct any drift from previous shake", - "comment2": "" + "comment": "Move to correct any drift from previous shake" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36215,8 +42513,7 @@ "textG": 0, "textR": 0 }, - "comment": "Reset drift detection variables", - "comment2": "" + "comment": "Reset drift detection variables" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36270,8 +42567,7 @@ "textG": 0, "textR": 0 }, - "comment": "Calculate Position Shake", - "comment2": "" + "comment": "Calculate Position Shake" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36319,8 +42615,7 @@ "textG": 0, "textR": 0 }, - "comment": "PositionDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * [-1 or 1]", - "comment2": "" + "comment": "PositionDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * [-1 or 1]" }, { "type": "BuiltinCommonInstructions::Comment", @@ -36332,8 +42627,7 @@ "textG": 0, "textR": 0 }, - "comment": "Make initial shake NOT random so users can set a direction for a one-shake effect", - "comment2": "" + "comment": "Make initial shake NOT random so users can set a direction for a one-shake effect" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36422,8 +42716,7 @@ "textG": 0, "textR": 0 }, - "comment": "After initial shake pick a random direction", - "comment2": "" + "comment": "After initial shake pick a random direction" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36514,8 +42807,7 @@ "textG": 0, "textR": 0 }, - "comment": "Calculate Rotation (angle) shake ", - "comment2": "" + "comment": "Calculate Rotation (angle) shake " }, { "type": "BuiltinCommonInstructions::Standard", @@ -36544,8 +42836,7 @@ "textG": 0, "textR": 0 }, - "comment": "Every \"even\" shake, rotate clockwise", - "comment2": "" + "comment": "Every \"even\" shake, rotate clockwise" }, { "type": "BuiltinCommonInstructions::Comment", @@ -36557,8 +42848,7 @@ "textG": 0, "textR": 0 }, - "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude", - "comment2": "" + "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36598,8 +42888,7 @@ "textG": 0, "textR": 0 }, - "comment": "Every \"odd\" shake, rotate counter-clockwise", - "comment2": "" + "comment": "Every \"odd\" shake, rotate counter-clockwise" }, { "type": "BuiltinCommonInstructions::Comment", @@ -36611,8 +42900,7 @@ "textG": 0, "textR": 0 }, - "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude", - "comment2": "" + "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36654,8 +42942,7 @@ "textG": 0, "textR": 0 }, - "comment": "Save that initial shake has been processed", - "comment2": "" + "comment": "Save that initial shake has been processed" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36698,8 +42985,7 @@ "textG": 0, "textR": 0 }, - "comment": "Calculate the fraction of shake that occured during this frame", - "comment2": "" + "comment": "Calculate the fraction of shake that occured during this frame" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36728,8 +43014,7 @@ "textG": 0, "textR": 0 }, - "comment": "Increase change for the first half of the shake (move away from original values)", - "comment2": "" + "comment": "Increase change for the first half of the shake (move away from original values)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36758,8 +43043,7 @@ "textG": 0, "textR": 0 }, - "comment": "Change position", - "comment2": "" + "comment": "Change position" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36828,8 +43112,7 @@ "textG": 0, "textR": 0 }, - "comment": "Save movement to calculate drift", - "comment2": "" + "comment": "Save movement to calculate drift" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36871,8 +43154,7 @@ "textG": 0, "textR": 0 }, - "comment": "Change angle", - "comment2": "" + "comment": "Change angle" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36911,8 +43193,7 @@ "textG": 0, "textR": 0 }, - "comment": "Save movement to calculate drift", - "comment2": "" + "comment": "Save movement to calculate drift" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36945,8 +43226,7 @@ "textG": 0, "textR": 0 }, - "comment": "Decrease change the second half of the shake (return to original position)", - "comment2": "" + "comment": "Decrease change the second half of the shake (return to original position)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36974,8 +43254,7 @@ "textG": 0, "textR": 0 }, - "comment": "Change position", - "comment2": "" + "comment": "Change position" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37044,8 +43323,7 @@ "textG": 0, "textR": 0 }, - "comment": "Save movement to calculate drift", - "comment2": "" + "comment": "Save movement to calculate drift" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37087,8 +43365,7 @@ "textG": 0, "textR": 0 }, - "comment": "Change angle", - "comment2": "" + "comment": "Change angle" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37127,8 +43404,7 @@ "textG": 0, "textR": 0 }, - "comment": "Save movement to calculate drift", - "comment2": "" + "comment": "Save movement to calculate drift" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37178,8 +43454,7 @@ "textG": 0, "textR": 0 }, - "comment": "Stop shaking when the duration has been reached (or if the stop shaking function was called)", - "comment2": "" + "comment": "Stop shaking when the duration has been reached (or if the stop shaking function was called)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37264,8 +43539,7 @@ "textG": 0, "textR": 0 }, - "comment": "Move to correct any drift from previous shake", - "comment2": "" + "comment": "Move to correct any drift from previous shake" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37362,8 +43636,7 @@ "textG": 0, "textR": 0 }, - "comment": "Reset drift detection variables", - "comment2": "" + "comment": "Reset drift detection variables" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37536,13 +43809,13 @@ "sharedPropertyDescriptors": [] }, { - "description": "Shake an object, using one or more ways to shake (position, angle, scale)\nThis behavior can only be used on sprite objects.", + "description": "Shake objects with translation, rotation and scale.", "fullName": "Shake object (position, angle, scale)", "name": "ShakeObject_PositionAngleScale", - "objectType": "Sprite", + "objectType": "", "eventsFunctions": [ { - "description": "Shake an object, using one or more ways to shake (position, angle, scale).", + "description": "Shake an object, using one or more ways to shake (position, angle, scale). Make sure to \"Stop shaking\" before starting a new shake if it uses different parameters.", "fullName": "Shake object (position, angle, scale)", "functionType": "Action", "name": "ShakeObject_PositionAngleScale", @@ -37567,8 +43840,7 @@ "textG": 0, "textR": 0 }, - "comment": "Start/Reset duration timer", - "comment2": "" + "comment": "Start/Reset duration timer" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37595,8 +43867,7 @@ "textG": 0, "textR": 0 }, - "comment": "Pass input parameters to global variables so that onScenePostEvents can use them", - "comment2": "" + "comment": "Pass input parameters to global variables so that onScenePostEvents can use them" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37610,7 +43881,7 @@ "Object", "__ShakeObject_Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -37621,7 +43892,7 @@ "Object", "__ShakeObject_PowerX", "=", - "GetArgumentAsNumber(\"PowerX\")" + "PowerX" ] }, { @@ -37632,7 +43903,7 @@ "Object", "__ShakeObject_PowerY", "=", - "GetArgumentAsNumber(\"PowerY\")" + "PowerY" ] }, { @@ -37643,7 +43914,7 @@ "Object", "__ShakeObject_PowerAngle", "=", - "GetArgumentAsNumber(\"PowerAngle\")" + "PowerAngle" ] }, { @@ -37654,7 +43925,7 @@ "Object", "__ShakeObject_PowerScale", "=", - "GetArgumentAsNumber(\"PowerScale\")" + "PowerScale" ] }, { @@ -37665,7 +43936,7 @@ "Object", "__ShakeObject_TimeBetweenShakes", "=", - "GetArgumentAsNumber(\"TimeBetweenShakes\")" + "TimeBetweenShakes" ] } ] @@ -37680,8 +43951,7 @@ "textG": 0, "textR": 0 }, - "comment": "Determine if the shake should keep going until stopped", - "comment2": "" + "comment": "Determine if the shake should keep going until stopped" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37734,8 +44004,7 @@ "textG": 0, "textR": 0 }, - "comment": "Add default values if none were provided", - "comment2": "" + "comment": "Add default values if none were provided" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37805,8 +44074,7 @@ "textG": 0, "textR": 0 }, - "comment": "If duration is less than a single shake, increase duration to make 1 full shake", - "comment2": "" + "comment": "If duration is less than a single shake, increase duration to make 1 full shake" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37847,8 +44115,7 @@ "textG": 0, "textR": 0 }, - "comment": "Detect initial shake", - "comment2": "" + "comment": "Detect initial shake" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37889,8 +44156,7 @@ "textG": 0, "textR": 0 }, - "comment": "Initiate the onScenePostEvents function", - "comment2": "" + "comment": "Initiate the onScenePostEvents function" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37917,7 +44183,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -37938,6 +44203,7 @@ }, { "description": "Amplitude of position shake in Y direction (in pixels) (For example: 5)", + "longDescription": "Use a negative number to make the single-shake move in the opposite direction.", "name": "PowerY", "type": "expression" }, @@ -37953,6 +44219,7 @@ }, { "description": "Amount of time between shakes (in seconds) (Default: 0.08)", + "longDescription": "For a single-shake effect, set it to the same value as \"Duration\".", "name": "TimeBetweenShakes", "type": "expression" }, @@ -38016,8 +44283,7 @@ "textG": 0, "textR": 0 }, - "comment": "Keep object shaking forever (if desired)", - "comment2": "" + "comment": "Keep object shaking forever (if desired)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -38075,74 +44341,668 @@ "textG": 0, "textR": 0 }, - "comment": "Run once before every shake movement", - "comment2": "" + "comment": "Run once before every shake movement" }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { - "type": { - "value": "BuiltinCommonInstructions::Or" + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_InitialShake", + "=", + "1" + ] + }, + { + "type": { + "value": "ObjectTimer" + }, + "parameters": [ + "Object", + "\"__ShakeObject_ShakeTimer\"", + "Object.Variable(__ShakeObject_TimeBetweenShakes)" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"__ShakeObject_ShakeTimer\"" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_ShakeCounter", + "+", + "1" + ] + } + ], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "folded": true, + "name": "Correct for drift and reset drift tracking variables", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Move to correct any drift from previous shake" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_PowerX", + "!=", + "0" + ] + }, + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_PowerY", + "!=", + "0" + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "-", + "Object.Variable(__ShakeObject_DisplacementTravelledX)" + ] + }, + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "-", + "Object.Variable(__ShakeObject_DisplacementTravelledY)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_PowerAngle", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "-", + "Object.Variable(__ShakeObject_AngleTravelled)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_PowerScale", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetValue" + }, + "parameters": [ + "Object", + "Scale", + "-", + "Object.Variable(__ShakeObject_ScaleTravelled)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Reset drift detection variables" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_DisplacementTravelledX", + "=", + "0" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_DisplacementTravelledY", + "=", + "0" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_AngleTravelled", + "=", + "0" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_ScaleTravelled", + "=", + "0" + ] + } + ] + } + ], + "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [], - "subInstructions": [ + "comment": "Calculate Position Shake" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_PowerX", + "!=", + "0" + ] + }, + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_PowerY", + "!=", + "0" + ] + } + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "PositionDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * [-1 or 1]" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make initial shake NOT random so users can set a direction for a one-shake effect" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_InitialShake", + "=", + "1" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_PowerX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_DisplacementX", + "=", + "(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerX)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_PowerY", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_DisplacementY", + "=", + "(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerY)" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "After initial shake pick a random direction" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_InitialShake", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_PowerX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_DisplacementX", + "=", + "(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerX) * RandomWithStep(-1, 1, 2)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_PowerY", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_DisplacementY", + "=", + "(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerY) * RandomWithStep(-1, 1, 2)" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Calculate Rotation (angle) shake " + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { "value": "VarObjet" }, "parameters": [ "Object", - "__ShakeObject_InitialShake", - "=", - "1" + "__ShakeObject_PowerAngle", + "!=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Every \"even\" shake, rotate clockwise" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "mod(Object.Variable(__ShakeObject_ShakeCounter),2)", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_DisplacementAngle", + "=", + "-1 * (Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerAngle)" + ] + } ] }, { - "type": { - "value": "ObjectTimer" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "Object", - "\"__ShakeObject_ShakeTimer\"", - "Object.Variable(__ShakeObject_TimeBetweenShakes)" + "comment": "Every \"odd\" shake, rotate counter-clockwise" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "mod(Object.Variable(__ShakeObject_ShakeCounter),2)", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_DisplacementAngle", + "=", + "(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerAngle)" + ] + } ] } ] - } - ], - "actions": [ - { - "type": { - "value": "ResetObjectTimer" - }, - "parameters": [ - "Object", - "\"__ShakeObject_ShakeTimer\"" - ] }, { - "type": { - "value": "ModVarObjet" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "Object", - "__ShakeObject_ShakeCounter", - "+", - "1" - ] - } - ], - "events": [ + "comment": "Calculate Scale shake" + }, { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "folded": true, - "name": "Correct for drift and reset drift tracking variables", - "source": "", - "type": "BuiltinCommonInstructions::Group", + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_PowerScale", + "!=", + "0" + ] + } + ], + "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Comment", @@ -38154,122 +45014,284 @@ "textG": 0, "textR": 0 }, - "comment": "Move to correct any drift from previous shake", - "comment2": "" + "comment": "Calculate object scale displacement, with linear decay over time" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "ScaleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * 1/100" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Every even shake, increase scale" }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BuiltinCommonInstructions::Or" + "value": "Egal" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_PowerX", - "!=", - "0" - ] - }, - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_PowerY", - "!=", - "0" - ] - } + "parameters": [ + "mod(Object.Variable(__ShakeObject_ShakeCounter),2)", + "=", + "0" ] } ], "actions": [ { "type": { - "value": "MettreX" - }, - "parameters": [ - "Object", - "-", - "Object.Variable(__ShakeObject_DisplacementTravelledX)" - ] - }, - { - "type": { - "value": "MettreY" + "value": "ModVarObjet" }, "parameters": [ "Object", - "-", - "Object.Variable(__ShakeObject_DisplacementTravelledY)" + "__ShakeObject_DisplacementScale", + "=", + "-1 * (Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerScale) * (1/100)" ] } ] }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Every \"odd\" shake, decrease scale" + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "ScaleDisplacement = -1 * (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * 1/100" + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "VarObjet" + "value": "Egal" }, "parameters": [ - "Object", - "__ShakeObject_PowerAngle", - "!=", - "0" + "mod(Object.Variable(__ShakeObject_ShakeCounter),2)", + "=", + "1" ] } ], "actions": [ { "type": { - "value": "SetAngle" + "value": "ModVarObjet" }, "parameters": [ "Object", - "-", - "Object.Variable(__ShakeObject_AngleTravelled)" + "__ShakeObject_DisplacementScale", + "=", + "(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerScale) * (1/100)" ] } ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Save that initial shake has been processed" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_InitialShake", + "=", + "0" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Move object", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Calculate the fraction of shake that occured during this frame" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_PercentTimeElapsedThisFrame", + "=", + "min(1,TimeDelta()/Object.Variable(__ShakeObject_TimeBetweenShakes))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Increase change for the first half of the shake (move away from original values)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ObjectTimer" + }, + "parameters": [ + "Object", + "\"__ShakeObject_ShakeTimer\"", + "Object.Variable(__ShakeObject_TimeBetweenShakes)/2" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Change position" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ { "type": { "value": "VarObjet" }, "parameters": [ "Object", - "__ShakeObject_PowerScale", + "__ShakeObject_PowerX", "!=", "0" ] - } - ], - "actions": [ + }, { "type": { - "value": "ChangeScale" + "value": "VarObjet" }, "parameters": [ "Object", - "-", - "Object.Variable(__ShakeObject_ScaleTravelled)" + "__ShakeObject_PowerY", + "!=", + "0" ] } ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "+", + "round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" + ] }, + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "+", + "round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" + ] + } + ], + "events": [ { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -38280,8 +45302,7 @@ "textG": 0, "textR": 0 }, - "comment": "Reset drift detection variables", - "comment2": "" + "comment": "Save movement to calculate drift" }, { "type": "BuiltinCommonInstructions::Standard", @@ -38294,8 +45315,8 @@ "parameters": [ "Object", "__ShakeObject_DisplacementTravelledX", - "=", - "0" + "+", + "round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" ] }, { @@ -38305,10 +45326,69 @@ "parameters": [ "Object", "__ShakeObject_DisplacementTravelledY", - "=", - "0" + "+", + "round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" ] - }, + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Change angle" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.Variable(__ShakeObject_PowerAngle)", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Save movement to calculate drift" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { "type": { "value": "ModVarObjet" @@ -38316,10 +45396,70 @@ "parameters": [ "Object", "__ShakeObject_AngleTravelled", - "=", - "0" + "+", + "round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" ] - }, + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Change scale" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Egal" + }, + "parameters": [ + "Object.Variable(__ShakeObject_PowerScale)", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetValue" + }, + "parameters": [ + "Object", + "Scale", + "+", + "round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Save movement to calculate drift" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { "type": { "value": "ModVarObjet" @@ -38327,15 +45467,44 @@ "parameters": [ "Object", "__ShakeObject_ScaleTravelled", - "=", - "0" + "+", + "round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" ] } - ] - } - ], - "parameters": [] - }, + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Decrease change the second half of the shake (return to original position)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectTimer" + }, + "parameters": [ + "Object", + "\"__ShakeObject_ShakeTimer\"", + "Object.Variable(__ShakeObject_TimeBetweenShakes)/2" + ] + } + ], + "actions": [], + "events": [ { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -38346,8 +45515,7 @@ "textG": 0, "textR": 0 }, - "comment": "Calculate Position Shake", - "comment2": "" + "comment": "Change position" }, { "type": "BuiltinCommonInstructions::Standard", @@ -38383,21 +45551,29 @@ ] } ], - "actions": [], - "events": [ + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "MettreX" }, - "comment": "PositionDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * [-1 or 1]", - "comment2": "" + "parameters": [ + "Object", + "-", + "round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" + ] }, + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "-", + "round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" + ] + } + ], + "events": [ { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -38408,172 +45584,32 @@ "textG": 0, "textR": 0 }, - "comment": "Make initial shake NOT random so users can set a direction for a one-shake effect", - "comment2": "" + "comment": "Save movement to calculate drift" }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "VarObjet" + "value": "ModVarObjet" }, "parameters": [ "Object", - "__ShakeObject_InitialShake", - "=", - "1" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_PowerX", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_DisplacementX", - "=", - "(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerX)" - ] - } + "__ShakeObject_DisplacementTravelledX", + "-", + "round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" ] }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_PowerY", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_DisplacementY", - "=", - "(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerY)" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "After initial shake pick a random direction", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ { "type": { - "value": "VarObjet" + "value": "ModVarObjet" }, "parameters": [ "Object", - "__ShakeObject_InitialShake", - "=", - "0" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_PowerX", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_DisplacementX", - "=", - "(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerX) * RandomWithStep(-1, 1, 2)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_PowerY", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_DisplacementY", - "=", - "(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerY) * RandomWithStep(-1, 1, 2)" - ] - } + "__ShakeObject_DisplacementTravelledY", + "-", + "round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" ] } ] @@ -38590,93 +45626,35 @@ "textG": 0, "textR": 0 }, - "comment": "Calculate Rotation (angle) shake ", - "comment2": "" + "comment": "Change angle" }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "VarObjet" + "value": "Egal" }, "parameters": [ - "Object", - "__ShakeObject_PowerAngle", + "Object.Variable(__ShakeObject_PowerAngle)", "!=", "0" ] } ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Every \"even\" shake, rotate clockwise", - "comment2": "" - }, + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetAngle" }, - "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "mod(Object.Variable(__ShakeObject_ShakeCounter),2)", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_DisplacementAngle", - "=", - "-1 * (Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerAngle)" - ] - } + "parameters": [ + "Object", + "-", + "round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Every \"odd\" shake, rotate counter-clockwise", - "comment2": "" - }, + } + ], + "events": [ { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -38687,23 +45665,11 @@ "textG": 0, "textR": 0 }, - "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude", - "comment2": "" + "comment": "Save movement to calculate drift" }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "mod(Object.Variable(__ShakeObject_ShakeCounter),2)", - "=", - "1" - ] - } - ], + "conditions": [], "actions": [ { "type": { @@ -38711,9 +45677,9 @@ }, "parameters": [ "Object", - "__ShakeObject_DisplacementAngle", - "=", - "(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerAngle)" + "__ShakeObject_AngleTravelled", + "-", + "round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" ] } ] @@ -38730,52 +45696,36 @@ "textG": 0, "textR": 0 }, - "comment": "Calculate Scale shake", - "comment2": "" + "comment": "Change scale" }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "VarObjet" + "value": "Egal" }, "parameters": [ - "Object", - "__ShakeObject_PowerScale", + "Object.Variable(__ShakeObject_PowerScale)", "!=", "0" ] } ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Calculate object scale displacement, with linear decay over time", - "comment2": "" - }, + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "ScalableCapability::ScalableBehavior::SetValue" }, - "comment": "ScaleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * 1/100", - "comment2": "" - }, + "parameters": [ + "Object", + "Scale", + "-", + "round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" + ] + } + ], + "events": [ { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -38786,23 +45736,11 @@ "textG": 0, "textR": 0 }, - "comment": "Every even shake, increase scale", - "comment2": "" + "comment": "Save movement to calculate drift" }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "mod(Object.Variable(__ShakeObject_ShakeCounter),2)", - "=", - "0" - ] - } - ], + "conditions": [], "actions": [ { "type": { @@ -38810,1667 +45748,4214 @@ }, "parameters": [ "Object", - "__ShakeObject_DisplacementScale", - "=", - "-1 * (Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerScale) * (1/100)" + "__ShakeObject_ScaleTravelled", + "-", + "round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" ] } ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Every \"odd\" shake, decrease scale", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + } + ] + } + ] + } + ], + "parameters": [] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Stop shaking", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Stop shaking when the duration has been reached (or if the stop shaking function was called)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "ObjectTimer" + }, + "parameters": [ + "Object", + "\"__ShakeObject_DurationTimer\"", + "Object.Variable(__ShakeObject_Duration)" + ] + }, + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_ShakeInProgress", + "=", + "-1" + ] + } + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_ShakeInProgress", + "=", + "0" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_ShakeCounter", + "=", + "0" + ] + } + ], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Correct for drift and reset drift tracking variables", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Move to correct any drift from previous shake" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "VarObjet" }, - "comment": "ScaleDisplacement = -1 * (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * 1/100", - "comment2": "" + "parameters": [ + "Object", + "__ShakeObject_PowerX", + "!=", + "0" + ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "mod(Object.Variable(__ShakeObject_ShakeCounter),2)", - "=", - "1" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_DisplacementScale", - "=", - "(Object.Variable(__ShakeObject_Duration) - Object.ObjectTimerElapsedTime(\"__ShakeObject_DurationTimer\")) / Object.Variable(__ShakeObject_Duration) * Object.Variable(__ShakeObject_PowerScale) * (1/100)" - ] - } + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_PowerY", + "!=", + "0" ] } ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "-", + "Object.Variable(__ShakeObject_DisplacementTravelledX)" + ] }, { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "-", + "Object.Variable(__ShakeObject_DisplacementTravelledY)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_PowerAngle", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "-", + "Object.Variable(__ShakeObject_AngleTravelled)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_PowerScale", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetValue" + }, + "parameters": [ + "Object", + "Scale", + "-", + "Object.Variable(__ShakeObject_ScaleTravelled)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Reset drift detection variables" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ModVarObjet" }, - "comment": "Save that initial shake has been processed", - "comment2": "" + "parameters": [ + "Object", + "__ShakeObject_DisplacementTravelledX", + "=", + "0" + ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_InitialShake", - "=", - "0" - ] - } + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_DisplacementTravelledY", + "=", + "0" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_AngleTravelled", + "=", + "0" + ] + }, + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_ScaleTravelled", + "=", + "0" ] } ] } ], - "parameters": [] + "parameters": [] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngleScale", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Stop shaking an object.", + "fullName": "Stop shaking an object", + "functionType": "Action", + "name": "StopShaking", + "sentence": "Stop shaking _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject::ShakeObject_PositionAngleScale::IsShaking" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_ShakeInProgress", + "=", + "-1" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngleScale", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if an object is shaking.", + "fullName": "Check if an object is shaking", + "functionType": "Condition", + "name": "IsShaking", + "sentence": "_PARAM0_ is shaking", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_ShakeInProgress", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngleScale", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Scalable capability", + "description": "", + "group": "", + "extraInformation": [ + "ScalableCapability::ScalableBehavior" + ], + "name": "Scale" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "name": "Property" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "westboy31, Tristan Rhodes (https://victrisgames.itch.io/)", + "category": "Camera", + "extensionNamespace": "", + "fullName": "Camera shake", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZlY3Rvci1kaWZmZXJlbmNlLWFiIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTMsMUMxLjg5LDEgMSwxLjg5IDEsM1Y1SDNWM0g1VjFIM003LDFWM0gxMFYxSDdNMTIsMVYzSDE0VjVIMTZWM0MxNiwxLjg5IDE1LjExLDEgMTQsMUgxMk0xLDdWMTBIM1Y3SDFNMTQsN0MxNCw3IDE0LDExLjY3IDE0LDE0QzExLjY3LDE0IDcsMTQgNywxNEM3LDE0IDcsMTggNywyMEM3LDIxLjExIDcuODksMjIgOSwyMkgyMEMyMS4xMSwyMiAyMiwyMS4xMSAyMiwyMFY5QzIyLDcuODkgMjEuMTEsNyAyMCw3QzE4LDcgMTQsNyAxNCw3TTE2LDlIMjBWMjBIOVYxNkgxNEMxNS4xMSwxNiAxNiwxNS4xMSAxNiwxNFY5TTEsMTJWMTRDMSwxNS4xMSAxLjg5LDE2IDMsMTZINVYxNEgzVjEySDFaIiAvPjwvc3ZnPg==", + "name": "CameraShake", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/vector-difference-ab.svg", + "shortDescription": "Shake layer cameras.", + "version": "3.1.2", + "description": [ + "Shake layer cameras with translation, rotation and zoom.", + "", + "- Short shaking can be used to give impact (explosion, hit)", + "- Shaking can go indefinitely to set an ambiance (engine vibration, earthquake, pulsing)", + "- Low frequency shaking allows to simulate slow moving objects (ship rocking back and forth)", + "", + "Release notes:", + "- Version 3.0.0", + " - No adaptation of the game events is needed.", + " - It fixes an issue when used with scrolling, the amplitude will feel bigger in this case.", + " - The shaking relies on noise which could feel a bit different.", + " - This extension can no longer do impulses. For this, another extension \"Camera impulse\" can be used." + ], + "origin": { + "identifier": "CameraShake", + "name": "gdevelop-extension-store" + }, + "tags": [ + "shaking", + "camera", + "effect", + "screen", + "shake" + ], + "authorIds": [ + "gqDaZjCfevOOxBYkK6zlhtZnXCg1", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "m4hBMBTUilft4s1V4FQQPakVDGx1" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [ + { + "folded": true, + "name": "DefaultFrequency", + "type": "number", + "value": 12 + }, + { + "folded": true, + "name": "DefaultAmplitudeX", + "type": "number", + "value": 4 + }, + { + "folded": true, + "name": "DefaultAmplitudeY", + "type": "number", + "value": 4 + }, + { + "folded": true, + "name": "DefaultAmplitudeAngle", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "DefaultAmplitudeZoom", + "type": "number", + "value": 1 + }, + { + "folded": true, + "name": "Duration", + "type": "number", + "value": 0 + }, + { + "name": "Layers", + "type": "structure", + "children": [] + }, + { + "name": "Layer", + "type": "structure", + "children": [ + { + "name": "AmplitudeAngle", + "type": "number", + "value": 0 + }, + { + "name": "AmplitudeX", + "type": "number", + "value": 0 + }, + { + "name": "AmplitudeY", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "AmplitudeZoom", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaAngle", + "type": "number", + "value": 0 + }, + { + "name": "CameraDeltaX", + "type": "number", + "value": 0 + }, + { + "name": "CameraDeltaY", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaZoom", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "Frequency", + "type": "number", + "value": 0 + } + ] + }, + { + "folded": true, + "name": "LayerName", + "type": "string", + "value": "" + }, + { + "folded": true, + "name": "Time", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "StartEaseDuration", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "StopEaseDuration", + "type": "number", + "value": 0 + } + ], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "CameraShake::SetLayerShakable" + }, + "parameters": [ + "", + "", + "\"\"", + "" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onScenePostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Step time counters." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "+", + "TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraShake::IsShaking" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Time", + "<", + "StartEaseDuration" + ] + }, + { + "type": { + "inverted": true, + "value": "NumberVariable" + }, + "parameters": [ + "Time", + ">", + "Duration - StopEaseDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "EaseFactor", + "=", + "clamp(Time / StartEaseDuration, 0, 1)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Time", + ">", + "Duration - StopEaseDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "EaseFactor", + "=", + "clamp((Duration - Time) / StopEaseDuration, 0, 1)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "Layers", + "valueIteratorVariableName": "Layer", + "keyIteratorVariableName": "LayerName", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Layer.Shakable", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ActualLayerName", + "=", + "LayerName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ActualLayerName", + "=", + "\"\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Use user defined default values when there is no layer specific value set." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "CameraShake::SetFrequency" + }, + "parameters": [ + "", + "DefaultFrequency", + "\"\"", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeX", + "=", + "DefaultAmplitudeX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeY", + "=", + "DefaultAmplitudeY" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeAngle", + "=", + "DefaultAmplitudeAngle" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeZoom", + "=", + "DefaultAmplitudeZoom" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaX", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaY", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaAngle", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaZoom", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"Frequency\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "CameraShake::SetFrequency" + }, + "parameters": [ + "", + "Layer.Frequency", + "\"\"", + "" + ] + } + ] }, { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Move object", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "VariableChildExists2" }, - "comment": "Calculate the fraction of shake that occured during this frame", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_PercentTimeElapsedThisFrame", - "=", - "min(1,TimeDelta()/Object.Variable(__ShakeObject_TimeBetweenShakes))" - ] - } + "parameters": [ + "Layer", + "\"AmplitudeX\"" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetNumberVariable" }, - "comment": "Increase change for the first half of the shake (move away from original values)", - "comment2": "" - }, + "parameters": [ + "AmplitudeX", + "=", + "Layer.AmplitudeX" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "ObjectTimer" - }, - "parameters": [ - "Object", - "\"__ShakeObject_ShakeTimer\"", - "Object.Variable(__ShakeObject_TimeBetweenShakes)/2" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Change position", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_PowerX", - "!=", - "0" - ] - }, - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_PowerY", - "!=", - "0" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Object", - "+", - "round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - }, - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Object", - "+", - "round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Save movement to calculate drift", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_DisplacementTravelledX", - "+", - "round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_DisplacementTravelledY", - "+", - "round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Change angle", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "Object.Variable(__ShakeObject_PowerAngle)", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "Object", - "+", - "round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Save movement to calculate drift", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_AngleTravelled", - "+", - "round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Change scale", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "Object.Variable(__ShakeObject_PowerScale)", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ChangeScale" - }, - "parameters": [ - "Object", - "+", - "round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Save movement to calculate drift", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_ScaleTravelled", - "+", - "round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ] - } - ] - } + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"AmplitudeY\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeY", + "=", + "Layer.AmplitudeY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"AmplitudeAngle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeAngle", + "=", + "Layer.AmplitudeAngle" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"AmplitudeZoom\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeZoom", + "=", + "Layer.AmplitudeZoom" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Shake the layer camera.\nSave the camera displacement to revert it in onScenePostEvents." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaX", + "=", + "CameraShake::Noise2d(\"\", TimeFromStart(), 1000) * AmplitudeX * EaseFactor" ] }, { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "+", + "Layers[LayerName].CameraDeltaX", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeY", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" }, - "comment": "Decrease change the second half of the shake (return to original position)", - "comment2": "" + "parameters": [ + "Layers[LayerName].CameraDeltaY", + "=", + "CameraShake::Noise2d(\"\", TimeFromStart(), 2000) * AmplitudeY * EaseFactor" + ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ObjectTimer" - }, - "parameters": [ - "Object", - "\"__ShakeObject_ShakeTimer\"", - "Object.Variable(__ShakeObject_TimeBetweenShakes)/2" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Change position", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_PowerX", - "!=", - "0" - ] - }, - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_PowerY", - "!=", - "0" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Object", - "-", - "round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - }, - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Object", - "-", - "round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Save movement to calculate drift", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_DisplacementTravelledX", - "-", - "round(1024 * Object.Variable(__ShakeObject_DisplacementX) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_DisplacementTravelledY", - "-", - "round(1024 * Object.Variable(__ShakeObject_DisplacementY) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Change angle", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "Object.Variable(__ShakeObject_PowerAngle)", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "Object", - "-", - "round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Save movement to calculate drift", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_AngleTravelled", - "-", - "round(1024 * Object.Variable(__ShakeObject_DisplacementAngle) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Change scale", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "Object.Variable(__ShakeObject_PowerScale)", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ChangeScale" - }, - "parameters": [ - "Object", - "-", - "round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Save movement to calculate drift", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_ScaleTravelled", - "-", - "round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ] - } - ] - } + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "+", + "Layers[LayerName].CameraDeltaY", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeAngle", + "!=", + "0" ] } ], - "parameters": [] + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaAngle", + "=", + "CameraShake::Noise2d(\"\", TimeFromStart(), 3000) * AmplitudeAngle * EaseFactor" + ] + }, + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "+", + "Layers[LayerName].CameraDeltaAngle", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeZoom", + "!=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaZoom", + "=", + "pow(AmplitudeZoom, CameraShake::Noise2d(\"\", TimeFromStart(), 4000) * EaseFactor)" + ] + }, + { + "type": { + "value": "ZoomCamera" + }, + "parameters": [ + "", + "CameraZoom(ActualLayerName, 0) * Layers[LayerName].CameraDeltaZoom", + "ActualLayerName", + "0" + ] + } + ] } ] } + ] + } + ], + "variables": [ + { + "folded": true, + "name": "AmplitudeX", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "AmplitudeY", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "AmplitudeAngle", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "AmplitudeZoom", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "EaseFactor", + "type": "number", + "value": 1 + }, + { + "folded": true, + "name": "ActualLayerName", + "type": "string", + "value": "" + } + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onScenePreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Revert the shaking." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraShake::IsShaking" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "Layers", + "valueIteratorVariableName": "Layer", + "keyIteratorVariableName": "LayerName", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Layer.Shakable", + "True", + "" + ] + } ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Stop shaking", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraDeltaX", + "=", + "Layer.CameraDeltaX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraDeltaY", + "=", + "Layer.CameraDeltaY" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraDeltaAngle", + "=", + "Layer.CameraDeltaAngle" + ] + }, + { + "type": { + "value": "SetNumberVariable" }, - "comment": "Stop shaking when the duration has been reached (or if the stop shaking function was called)", - "comment2": "" + "parameters": [ + "CameraDeltaZoom", + "=", + "Layer.CameraDeltaZoom" + ] }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ActualLayerName", + "=", + "LayerName" + ] + } + ], + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BuiltinCommonInstructions::Or" + "value": "StringVariable" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "ObjectTimer" - }, - "parameters": [ - "Object", - "\"__ShakeObject_DurationTimer\"", - "Object.Variable(__ShakeObject_Duration)" - ] - }, - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_ShakeInProgress", - "=", - "-1" - ] - } + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" ] - }, + } + ], + "actions": [ { "type": { - "value": "BuiltinCommonInstructions::Once" + "value": "SetStringVariable" }, - "parameters": [] + "parameters": [ + "ActualLayerName", + "=", + "\"\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraDeltaX", + "!=", + "0" + ] } ], "actions": [ { "type": { - "value": "ModVarObjet" + "value": "SetCameraCenterX" }, "parameters": [ - "Object", - "__ShakeObject_ShakeInProgress", - "=", + "", + "-", + "CameraDeltaX", + "ActualLayerName", "0" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "ModVarObjet" + "value": "NumberVariable" }, "parameters": [ - "Object", - "__ShakeObject_ShakeCounter", - "=", + "CameraDeltaY", + "!=", "0" ] } ], - "events": [ + "actions": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Correct for drift and reset drift tracking variables", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Move to correct any drift from previous shake", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_PowerX", - "!=", - "0" - ] - }, - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_PowerY", - "!=", - "0" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Object", - "-", - "Object.Variable(__ShakeObject_DisplacementTravelledX)" - ] - }, - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Object", - "-", - "Object.Variable(__ShakeObject_DisplacementTravelledY)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_PowerAngle", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetAngle" - }, - "parameters": [ - "Object", - "-", - "Object.Variable(__ShakeObject_AngleTravelled)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_PowerScale", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ChangeScale" - }, - "parameters": [ - "Object", - "-", - "Object.Variable(__ShakeObject_ScaleTravelled)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Reset drift detection variables", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_DisplacementTravelledX", - "=", - "0" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_DisplacementTravelledY", - "=", - "0" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_AngleTravelled", - "=", - "0" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_ScaleTravelled", - "=", - "0" - ] - } - ] - } - ], - "parameters": [] + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "-", + "CameraDeltaY", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraDeltaAngle", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "-", + "CameraDeltaAngle", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraDeltaZoom", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ZoomCamera" + }, + "parameters": [ + "", + "CameraZoom(ActualLayerName) / CameraDeltaZoom", + "ActualLayerName", + "0" + ] } ] } + ] + } + ], + "variables": [ + { + "folded": true, + "name": "ActualLayerName", + "type": "string", + "value": "" + }, + { + "folded": true, + "name": "CameraDeltaX", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaY", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaAngle", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaZoom", + "type": "number", + "value": 0 + } + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Shake the camera on layers chosen with configuration actions.", + "fullName": "Shake camera", + "functionType": "Action", + "name": "ShakeCamera", + "sentence": "Shake camera for _PARAM1_ seconds with _PARAM2_ seconds of easing to start and _PARAM3_ seconds to stop", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "NewDuration" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StartEaseDuration", + "=", + "NewStartEaseDuration" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StopEaseDuration", + "=", + "NewStopEaseDuration" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Duration", + "<", + "StartEaseDuration + StopEaseDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StartEaseDuration", + "=", + "StartEaseDuration * Duration / (StartEaseDuration + StopEaseDuration)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StopEaseDuration", + "=", + "StopEaseDuration * Duration / (StartEaseDuration + StopEaseDuration)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Duration (in seconds)", + "name": "NewDuration", + "type": "expression" + }, + { + "description": "Ease duration to start (in seconds)", + "name": "NewStartEaseDuration", + "type": "expression" + }, + { + "description": "Ease duration to stop (in seconds)", + "name": "NewStopEaseDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Shake the camera on the specified layer, using one or more ways to shake (position, angle, zoom). This action is deprecated. Please use the other one with the same name.", + "fullName": "Shake camera (deprecated)", + "functionType": "Action", + "name": "CameraShake", + "private": true, + "sentence": "Shake camera on _PARAM3_ layer for _PARAM5_ seconds. Use an amplitude of _PARAM1_px on X axis and _PARAM2_px on Y axis, angle rotation amplitude _PARAM6_ degrees, and zoom amplitude _PARAM7_ percent. Wait _PARAM8_ seconds between shakes. Keep shaking until stopped: _PARAM9_", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Camera Shake", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ClearVariableChildren" + }, + "parameters": [ + "Layers" + ] + }, + { + "type": { + "value": "CameraShake::SetLayerShakable" + }, + "parameters": [ + "", + "", + "Layer", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "=", + "0" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Layer", + "=", + "Layer" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "Duration" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StartEaseDuration", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StopEaseDuration", + "=", + "Duration" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultAmplitudeX", + "=", + "abs(AmplitudeX)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultAmplitudeY", + "=", + "abs(AmplitudeY)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultAmplitudeAngle", + "=", + "AmplitudeAngle" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultAmplitudeZoom", + "=", + "1 + AmplitudeZoom / 100" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "ShakePeriod", + "!=", + "0" + ] + } ], - "parameters": [] + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultFrequency", + "=", + "1 / ShakePeriod" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "ShakePeriod", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultFrequency", + "=", + "1 / 0.08" + ] + } + ] } - ], - "parameters": [] - } - ], - "parameters": [ + ] + }, { - "description": "Object", - "name": "Object", - "supplementaryInformation": "Sprite", - "type": "object" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Determine if the shake should keep going until stopped" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngleScale", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Stop shaking an object.", - "fullName": "Stop shaking an object", - "functionType": "Action", - "name": "StopShaking", - "sentence": "Stop shaking _PARAM0_", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShakeForever\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "1234567890" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Add default values if none were provided" + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "ShakeObject::ShakeObject_PositionAngleScale::IsShaking" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", - "" + "Duration", + "=", + "0" ] } ], "actions": [ { "type": { - "value": "ModVarObjet" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "__ShakeObject_ShakeInProgress", + "Duration", "=", - "-1" + "0.5" ] } ] } ], - "parameters": [ + "parameters": [] + } + ], + "parameters": [ + { + "description": "Amplitude of shaking on the X axis (in pixels)", + "name": "AmplitudeX", + "type": "expression" + }, + { + "description": "Amplitude of shaking on the Y axis (in pixels)", + "name": "AmplitudeY", + "type": "expression" + }, + { + "description": "Layer (base layer if empty)", + "name": "Layer", + "type": "layer" + }, + { + "description": "Camera index (Default: 0)", + "name": "Camera", + "type": "expression" + }, + { + "description": "Duration (in seconds) (Default: 0.5)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Angle rotation amplitude (in degrees) (For example: 2)", + "name": "AmplitudeAngle", + "type": "expression" + }, + { + "description": "Zoom factor amplitude", + "name": "AmplitudeZoom", + "type": "expression" + }, + { + "description": "Period between shakes (in seconds) (Default: 0.08)", + "name": "ShakePeriod", + "type": "expression" + }, + { + "description": "Keep shaking until stopped", + "longDescription": "Duration value will be ignored", + "name": "ShakeForever", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Start shaking the camera indefinitely.", + "fullName": "Start camera shaking", + "functionType": "Action", + "name": "StartShaking", + "sentence": "Start shaking the camera with _PARAM1_ seconds of easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "description": "Object", - "name": "Object", - "supplementaryInformation": "Sprite", - "type": "object" + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "1234567890" + ] }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngleScale", - "type": "behavior" + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StartEaseDuration", + "=", + "EaseDuration" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Ease duration (in seconds)", + "name": "EaseDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Stop shaking the camera.", + "fullName": "Stop camera shaking", + "functionType": "Action", + "name": "StopShaking", + "sentence": "Stop shaking the camera with _PARAM1_ seconds of easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "EaseDuration" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StopEaseDuration", + "=", + "EaseDuration" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Ease duration (in seconds)", + "name": "EaseDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Mark a layer as shakable.", + "fullName": "Shakable layer", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetLayerShakable", + "sentence": "Mark the layer: _PARAM2_ as shakable: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "NewLayerName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "NewLayerName", + "=", + "\"\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Shakable\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "Layers[LayerName].Shakable", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Shakable\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "Layers[LayerName].Shakable", + "True", + "" + ] + } + ] + } + ], + "parameters": [ + { + "defaultValue": "yes", + "description": "Shakable", + "name": "Shakable", + "optional": true, + "type": "yesorno" + }, + { + "description": "Layer", + "name": "NewLayerName", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the camera is shaking.", + "fullName": "Camera is shaking", + "functionType": "Condition", + "name": "IsShaking", + "sentence": "Camera is shaking", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Time", + "<", + "Duration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Change the translation amplitude of the shaking (in pixels).", + "fullName": "Layer translation amplitude", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetLayerTranslationAmplitude", + "sentence": "Change the translation amplitude of the shaking to _PARAM1_; _PARAM2_ (layer: _PARAM3_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "NewLayerName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "NewLayerName", + "=", + "\"\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].AmplitudeX", + "=", + "AmplitudeX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].AmplitudeY", + "=", + "AmplitudeY" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Amplitude of shaking on the X axis (in pixels)", + "name": "AmplitudeX", + "type": "expression" + }, + { + "description": "Amplitude of shaking on the Y axis (in pixels)", + "name": "AmplitudeY", + "type": "expression" + }, + { + "description": "Layer", + "name": "NewLayerName", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Change the rotation amplitude of the shaking (in degrees).", + "fullName": "Layer rotation amplitude", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetLayerRotationAmplitude", + "sentence": "Change the rotation amplitude of the shaking to _PARAM1_ degrees (layer: _PARAM2_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "NewLayerName" + ] } - ], - "objectGroups": [] + ] }, { - "description": "Check if an object is shaking.", - "fullName": "Check if an object is shaking", - "functionType": "Condition", - "name": "IsShaking", - "sentence": "_PARAM0_ is shaking", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_ShakeInProgress", - "=", - "1" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "NewLayerName", + "=", + "\"\"" ] } ], - "parameters": [ + "actions": [ { - "description": "Object", - "name": "Object", - "supplementaryInformation": "Sprite", - "type": "object" - }, + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngleScale", - "type": "behavior" + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].AmplitudeAngle", + "=", + "AmplitudeAngle" + ] } - ], - "objectGroups": [] + ] } ], - "propertyDescriptors": [], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "westboy31, Tristan Rhodes (https://victrisgames.itch.io/)", - "category": "", - "extensionNamespace": "", - "fullName": "Camera Shake", - "helpPath": "https://victrisgames.itch.io/gdevelop-camera-shake-example", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZlY3Rvci1kaWZmZXJlbmNlLWFiIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTMsMUMxLjg5LDEgMSwxLjg5IDEsM1Y1SDNWM0g1VjFIM003LDFWM0gxMFYxSDdNMTIsMVYzSDE0VjVIMTZWM0MxNiwxLjg5IDE1LjExLDEgMTQsMUgxMk0xLDdWMTBIM1Y3SDFNMTQsN0MxNCw3IDE0LDExLjY3IDE0LDE0QzExLjY3LDE0IDcsMTQgNywxNEM3LDE0IDcsMTggNywyMEM3LDIxLjExIDcuODksMjIgOSwyMkgyMEMyMS4xMSwyMiAyMiwyMS4xMSAyMiwyMFY5QzIyLDcuODkgMjEuMTEsNyAyMCw3QzE4LDcgMTQsNyAxNCw3TTE2LDlIMjBWMjBIOVYxNkgxNEMxNS4xMSwxNiAxNiwxNS4xMSAxNiwxNFY5TTEsMTJWMTRDMSwxNS4xMSAxLjg5LDE2IDMsMTZINVYxNEgzVjEySDFaIiAvPjwvc3ZnPg==", - "name": "CameraShake", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/vector-difference-ab.svg", - "shortDescription": "Shake the camera on the specified layer using one or more methods of shaking (position, angle, zoom).", - "version": "2.6.5", - "description": [ - "Ideal for explosions, hit/impacts, earthquake, etc.", - "", - "Select one or more methods of shaking:", - "- Position: Shake the X and/or Y position of the camera ", - "- Angle: Shake the rotation of the camera ", - "- Zoom: Shake the zoom level of the camera ", - "", - "Control how the camera shakes:", - "- Amplitude: How far the camera moves during each shake", - "- Duration: Amount of time to shake the camera", - "- Time between shakes: Amount of time between each change of the movement of the camera", - "- Keep shaking until stopped (boolean)", - "", - "Tips:", - "- For a single-shake effect, set the \"Time between shakes\" to be equal to \"Duration\" (great for a hit or impact)", - "- To make the single-shake move in the opposite direction, use negative numbers ", - "- To repeat a single-shake effect in a loop, add a condition \"Camera is not shaking\" ", - "- Use a long \"Time between shakes\" to simulate a slow moving object (like a ship rocking back and forth)", - "- Make sure to \"Stop shaking\" before starting a new shake if it uses different parameters. ", - "- Use \"Shake until stopped\" to simulate engine vibration, earthquake, or pulsing", - "" - ], - "origin": { - "identifier": "CameraShake", - "name": "gdevelop-extension-store" - }, - "tags": [ - "shaking", - "camera", - "effect", - "screen", - "shake", - "zoom", - "position", - "rotate" - ], - "authorIds": [ - "gqDaZjCfevOOxBYkK6zlhtZnXCg1" - ], - "dependencies": [], - "eventsFunctions": [ + "parameters": [ + { + "description": "Angle (in degree)", + "name": "AmplitudeAngle", + "type": "expression" + }, + { + "description": "NewLayerName", + "name": "NewLayerName", + "type": "layer" + } + ], + "objectGroups": [] + }, { - "description": "Shake the camera on the specified layer, using one or more ways to shake (position, angle, zoom).", - "fullName": "Camera Shake", + "description": "Change the zoom factor amplitude of the shaking. The shaking will zoom and unzoom by this factor (for instance 1.0625 is a valid value).", + "fullName": "Layer zoom amplitude", "functionType": "Action", - "name": "CameraShake", - "sentence": "Shake camera on _PARAM3_ layer for _PARAM5_ seconds. Use an amplitude of _PARAM1_px on X axis and _PARAM2_px on Y axis, angle rotation amplitude _PARAM6_ degrees, and zoom amplitude _PARAM7_ percent. Wait _PARAM8_ seconds between shakes. Keep shaking until stopped: _PARAM9_", + "group": "Camera shake configuration", + "name": "SetLayerZoomAmplitude", + "sentence": "Change the zoom factor amplitude of the shaking to _PARAM1_ (layer: _PARAM2_)", "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Camera Shake", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetStringVariable" }, - "comment": "Start/Reset duration timer", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ResetTimer" - }, - "parameters": [ - "", - "\"__CameraShake_DurationTimer\"" - ] - } + "parameters": [ + "LayerName", + "=", + "NewLayerName" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" }, - "comment": "Pass input parameters to global variables so that onScenePostEvents can use them", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_PowerX", - "=", - "GetArgumentAsNumber(\"PowerX\")" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_PowerY", - "=", - "GetArgumentAsNumber(\"PowerY\")" - ] - }, - { - "type": { - "value": "ModVarGlobalTxt" - }, - "parameters": [ - "__CameraShake_Layer", - "=", - "GetArgumentAsString(\"Layer\")" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_Camera", - "=", - "GetArgumentAsNumber(\"Camera\")" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_Duration", - "=", - "GetArgumentAsNumber(\"Duration\")" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_PowerAngle", - "=", - "GetArgumentAsNumber(\"PowerAngle\")" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_PowerZoom", - "=", - "GetArgumentAsNumber(\"PowerZoom\")" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_TimeBetweenShakes", - "=", - "GetArgumentAsNumber(\"TimeBetweenShakes\")" - ] - } + "parameters": [ + "NewLayerName", + "=", + "\"\"" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetStringVariable" }, - "comment": "Determine if the shake should keep going until stopped", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetGlobalVariableAsBoolean" - }, - "parameters": [ - "__CameraShake_ShakeForever", - "False" - ] - } + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"ShakeForever\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetGlobalVariableAsBoolean" - }, - "parameters": [ - "__CameraShake_ShakeForever", - "True" - ] - } + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].AmplitudeZoom", + "=", + "AmplitudeZoom" ] - }, + } + ] + } + ], + "parameters": [ + { + "description": "Zoom factor", + "name": "AmplitudeZoom", + "type": "expression" + }, + { + "description": "NewLayerName", + "name": "NewLayerName", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Change the number of back and forth per seconds.", + "fullName": "Layer shaking frequency", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetLayerShakingFrequency", + "sentence": "Change the shaking frequency to _PARAM1_ (layer: _PARAM2_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetStringVariable" }, - "comment": "Add default values if none were provided", - "comment2": "" - }, + "parameters": [ + "LayerName", + "=", + "NewLayerName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_Duration", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_Duration", - "=", - "0.5" - ] - } + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "NewLayerName", + "=", + "\"\"" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_TimeBetweenShakes", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_TimeBetweenShakes", - "=", - "0.08" - ] - } + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetNumberVariable" }, - "comment": "If duration is less than a single shake, increase duration to make 1 full shake", - "comment2": "" - }, + "parameters": [ + "Layers[LayerName].Frequency", + "=", + "Frequency" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Frequency", + "name": "Frequency", + "type": "expression" + }, + { + "description": "NewLayerName", + "name": "NewLayerName", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Change the default translation amplitude of the shaking (in pixels).", + "fullName": "Default translation amplitude", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetDefaultTranslationAmplitude", + "sentence": "Change the default translation amplitude of the shaking to _PARAM1_; _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_Duration", - "<", - "GlobalVariable(__CameraShake_TimeBetweenShakes)" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_Duration", - "=", - "GlobalVariable(__CameraShake_TimeBetweenShakes)" - ] - } + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultAmplitudeX", + "=", + "AmplitudeX" ] }, { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetNumberVariable" }, - "comment": "Detect initial shake", - "comment2": "" - }, + "parameters": [ + "DefaultAmplitudeY", + "=", + "AmplitudeY" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Amplitude of shaking on the X axis (in pixels)", + "name": "AmplitudeX", + "type": "expression" + }, + { + "description": "Amplitude of shaking on the Y axis (in pixels)", + "name": "AmplitudeY", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the default rotation amplitude of the shaking (in degrees).", + "fullName": "Default rotation amplitude", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetDefaultRotationAmplitude", + "sentence": "Change the default rotation amplitude of the shaking to _PARAM1_ degrees", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_ShakeInProgress", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_InitialShake", - "=", - "1" - ] - } + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultAmplitudeAngle", + "=", + "AmplitudeAngle" ] - }, + } + ] + } + ], + "parameters": [ + { + "description": "Angle (in degree)", + "name": "AmplitudeAngle", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the default zoom factor amplitude of the shaking. The shaking will zoom and unzoom by this factor (for instance 1.0625 is a valid value).", + "fullName": "Default zoom amplitude", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetDefaultZoomAmplitude", + "sentence": "Change the default zoom factor amplitude of the shaking to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetNumberVariable" }, - "comment": "Initiate the onScenePostEvents function", - "comment2": "" - }, + "parameters": [ + "DefaultAmplitudeZoom", + "=", + "AmplitudeZoom" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Zoom factor", + "name": "AmplitudeZoom", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the default number of back and forth per seconds.", + "fullName": "Default shaking frequency", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetDefaultShakingFrequency", + "sentence": "Change the default shaking frequency to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_ShakeInProgress", - "=", - "1" - ] - } + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DefaultFrequency", + "=", + "Frequency" ] } + ] + } + ], + "parameters": [ + { + "description": "Frequency", + "name": "Frequency", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "if (gdjs._cameraShakeExtension) {", + " return;", + "}", + "", + "/** Noise generator manager. */", + "class NoiseManager {", + " /**", + " * Create the manager of noise generators.", + " */", + " constructor() {", + " this.seed = gdjs.randomInRange(1, Number.MAX_SAFE_INTEGER);", + " /** @type {Map} */", + " this.generators = new Map();", + " }", + "", + " /**", + " * @param name {string}", + " * @return {NoiseGenerator}", + " */", + " getGenerator(name) {", + " let generator = this.generators.get(name);", + " if (!generator) {", + " generator = new NoiseGenerator(name + this.seed);", + " this.generators.set(name, generator);", + " }", + " return generator;", + " }", + "", + " /**", + " * @param seed {number}", + " */", + " setSeed(seed) {", + " this.seed = seed;", + " this.generators.forEach(generator => generator.setSeed(name + this.seed));", + " }", + "", + " /**", + " * @param name {string}", + " */", + " deleteGenerator(name) {", + " this.generators.delete(name);", + " }", + "", + " /**", + " */", + " deleteAllGenerators() {", + " this.generators.clear();", + " }", + "}", + "", + "/** Noise generator with octaves. */", + "class NoiseGenerator {", + " /**", + " * Create a noise generator with a seed.", + " * @param seed {string}", + " */", + " constructor(seed) {", + " this.simplexNoise = new SimplexNoise(seed);", + " this.frequency = 1;", + " this.octaves = 1;", + " this.persistence = 0.5;", + " this.lacunarity = 2;", + " this.xLoopPeriod = 0;", + " this.yLoopPeriod = 0;", + " }", + "", + " /**", + " * @param seed {string}", + " */", + " setSeed(seed) {", + " this.simplexNoise = new SimplexNoise(seed);", + " }", + "", + " /**", + " * @param x {float}", + " * @param y {float}", + " * @param z {float} optionnal", + " * @param w {float} optionnal", + " * @return {float}", + " */", + " noise(x, y, z, w) {", + " if (this.xLoopPeriod && this.yLoopPeriod) {", + " const circleRatioX = 2 * Math.PI / this.xLoopPeriod;", + " const circleRatioY = 2 * Math.PI / this.yLoopPeriod;", + " const angleX = circleRatioX * x;", + " const angleY = circleRatioY * y;", + " x = Math.cos(angleX) / circleRatioX;", + " y = Math.sin(angleX) / circleRatioX;", + " z = Math.cos(angleY) / circleRatioY;", + " w = Math.sin(angleY) / circleRatioY;", + " }", + " else if (this.xLoopPeriod) {", + " const circleRatio = 2 * Math.PI / this.xLoopPeriod;", + " const angleX = circleRatio * x;", + " w = z;", + " z = y;", + " x = Math.cos(angleX) / circleRatio;", + " y = Math.sin(angleX) / circleRatio;", + " }", + " else if (this.yLoopPeriod) {", + " const circleRatio = 2 * Math.PI / this.xLoopPeriod;", + " const angleX = circleRatio * x;", + " w = z;", + " // Make the circle perimeter equals to the looping period", + " // to keep the same perceived frequency with or without looping.", + " y = Math.cos(angleX) / circleRatio;", + " z = Math.sin(angleX) / circleRatio;", + " }", + " let noiseFunction = this.simplexNoise.noise4D.bind(this.simplexNoise);", + " if (z === undefined) {", + " noiseFunction = this.simplexNoise.noise2D.bind(this.simplexNoise);", + " }", + " else if (w === undefined) {", + " noiseFunction = this.simplexNoise.noise3D.bind(this.simplexNoise);", + " }", + " let frequency = this.frequency;", + " let noiseSum = 0;", + " let amplitudeSum = 0;", + " let amplitude = 1;", + " for (let i = 0; i < this.octaves; i++) {", + " noiseSum += noiseFunction(x * frequency, y * frequency, z * frequency, w * frequency) * amplitude;", + " amplitudeSum += Math.abs(amplitude);", + " amplitude *= this.persistence;", + " frequency *= this.lacunarity;", + " }", + " return noiseSum / amplitudeSum;", + " }", + "}", + "", + "/*", + "A fast javascript implementation of simplex noise by Jonas Wagner", + "https://github.com/jwagner/simplex-noise.js", + "", + "Based on a speed-improved simplex noise algorithm for 2D, 3D and 4D in Java.", + "Which is based on example code by Stefan Gustavson (stegu@itn.liu.se).", + "With Optimisations by Peter Eastman (peastman@drizzle.stanford.edu).", + "Better rank ordering method by Stefan Gustavson in 2012.", + "", + " Copyright (c) 2021 Jonas Wagner", + "", + " Permission is hereby granted, free of charge, to any person obtaining a copy", + " of this software and associated documentation files (the \"Software\"), to deal", + " in the Software without restriction, including without limitation the rights", + " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", + " copies of the Software, and to permit persons to whom the Software is", + " furnished to do so, subject to the following conditions:", + "", + " The above copyright notice and this permission notice shall be included in all", + " copies or substantial portions of the Software.", + "", + " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", + " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", + " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", + " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE", + " SOFTWARE.", + " */", + "", + "const F2 = 0.5 * (Math.sqrt(3.0) - 1.0);", + "const G2 = (3.0 - Math.sqrt(3.0)) / 6.0;", + "const F3 = 1.0 / 3.0;", + "const G3 = 1.0 / 6.0;", + "const F4 = (Math.sqrt(5.0) - 1.0) / 4.0;", + "const G4 = (5.0 - Math.sqrt(5.0)) / 20.0;", + "const grad3 = new Float32Array([1, 1, 0,", + " -1, 1, 0,", + " 1, -1, 0,", + " -1, -1, 0,", + " 1, 0, 1,", + " -1, 0, 1,", + " 1, 0, -1,", + " -1, 0, -1,", + " 0, 1, 1,", + " 0, -1, 1,", + " 0, 1, -1,", + " 0, -1, -1]);", + "const grad4 = new Float32Array([0, 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1,", + " 0, -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1,", + " 1, 0, 1, 1, 1, 0, 1, -1, 1, 0, -1, 1, 1, 0, -1, -1,", + " -1, 0, 1, 1, -1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, -1,", + " 1, 1, 0, 1, 1, 1, 0, -1, 1, -1, 0, 1, 1, -1, 0, -1,", + " -1, 1, 0, 1, -1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, -1,", + " 1, 1, 1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, -1, 0,", + " -1, 1, 1, 0, -1, 1, -1, 0, -1, -1, 1, 0, -1, -1, -1, 0]);", + "", + "", + "/**", + " * Builds a random permutation table.", + " * This is exported only for (internal) testing purposes.", + " * Do not rely on this export.", + " * @param {() => number} random", + " * @private", + " */", + "function buildPermutationTable(random) {", + " const p = new Uint8Array(256);", + " for (let i = 0; i < 256; i++) {", + " p[i] = i;", + " }", + " for (let i = 0; i < 255; i++) {", + " const r = i + ~~(random() * (256 - i));", + " const aux = p[i];", + " p[i] = p[r];", + " p[r] = aux;", + " }", + " return p;", + "}", + "", + "/*", + "The ALEA PRNG and masher code used by simplex-noise.js", + "is based on code by Johannes Baagøe, modified by Jonas Wagner.", + "See alea.md for the full license.", + "@param {string|number} seed", + "*/", + "function alea(seed) {", + " let s0 = 0;", + " let s1 = 0;", + " let s2 = 0;", + " let c = 1;", + " const mash = masher();", + " s0 = mash(' ');", + " s1 = mash(' ');", + " s2 = mash(' ');", + " s0 -= mash(seed);", + " if (s0 < 0) {", + " s0 += 1;", + " }", + " s1 -= mash(seed);", + " if (s1 < 0) {", + " s1 += 1;", + " }", + " s2 -= mash(seed);", + " if (s2 < 0) {", + " s2 += 1;", + " }", + " return function () {", + " const t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32", + " s0 = s1;", + " s1 = s2;", + " return s2 = t - (c = t | 0);", + " };", + "}", + "", + "function masher() {", + " let n = 0xefc8249d;", + " return function (data) {", + " data = data.toString();", + " for (let i = 0; i < data.length; i++) {", + " n += data.charCodeAt(i);", + " let h = 0.02519603282416938 * n;", + " n = h >>> 0;", + " h -= n;", + " h *= n;", + " n = h >>> 0;", + " h -= n;", + " n += h * 0x100000000; // 2^32", + " }", + " return (n >>> 0) * 2.3283064365386963e-10; // 2^-32", + " };", + "}", + "", + "/** Deterministic simplex noise generator suitable for 2D, 3D and 4D spaces. */", + "class SimplexNoise {", + " /**", + " * Creates a new `SimplexNoise` instance.", + " * This involves some setup. You can save a few cpu cycles by reusing the same instance.", + " * @param {(() => number)|string|number} randomOrSeed A random number generator or a seed (string|number).", + " * Defaults to Math.random (random irreproducible initialization).", + " */", + " constructor(randomOrSeed) {", + " if (randomOrSeed === void 0) { randomOrSeed = Math.random; }", + " const random = typeof randomOrSeed == 'function' ? randomOrSeed : alea(randomOrSeed);", + " this.p = buildPermutationTable(random);", + " this.perm = new Uint8Array(512);", + " this.permMod12 = new Uint8Array(512);", + " for (let i = 0; i < 512; i++) {", + " this.perm[i] = this.p[i & 255];", + " this.permMod12[i] = this.perm[i] % 12;", + " }", + " }", + "", + " /**", + " * Samples the noise field in 2 dimensions", + " * @param {number} x", + " * @param {number} y", + " * @returns a number in the interval [-1, 1]", + " */", + " noise2D(x, y) {", + " const permMod12 = this.permMod12;", + " const perm = this.perm;", + " let n0 = 0; // Noise contributions from the three corners", + " let n1 = 0;", + " let n2 = 0;", + " // Skew the input space to determine which simplex cell we're in", + " const s = (x + y) * F2; // Hairy factor for 2D", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const t = (i + j) * G2;", + " const X0 = i - t; // Unskew the cell origin back to (x,y) space", + " const Y0 = j - t;", + " const x0 = x - X0; // The x,y distances from the cell origin", + " const y0 = y - Y0;", + " // For the 2D case, the simplex shape is an equilateral triangle.", + " // Determine which simplex we are in.", + " let i1, j1; // Offsets for second (middle) corner of simplex in (i,j) coords", + " if (x0 > y0) {", + " i1 = 1;", + " j1 = 0;", + " } // lower triangle, XY order: (0,0)->(1,0)->(1,1)", + " else {", + " i1 = 0;", + " j1 = 1;", + " } // upper triangle, YX order: (0,0)->(0,1)->(1,1)", + " // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and", + " // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where", + " // c = (3-sqrt(3))/6", + " const x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed coords", + " const y1 = y0 - j1 + G2;", + " const x2 = x0 - 1.0 + 2.0 * G2; // Offsets for last corner in (x,y) unskewed coords", + " const y2 = y0 - 1.0 + 2.0 * G2;", + " // Work out the hashed gradient indices of the three simplex corners", + " const ii = i & 255;", + " const jj = j & 255;", + " // Calculate the contribution from the three corners", + " let t0 = 0.5 - x0 * x0 - y0 * y0;", + " if (t0 >= 0) {", + " const gi0 = permMod12[ii + perm[jj]] * 3;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad3[gi0] * x0 + grad3[gi0 + 1] * y0); // (x,y) of grad3 used for 2D gradient", + " }", + " let t1 = 0.5 - x1 * x1 - y1 * y1;", + " if (t1 >= 0) {", + " const gi1 = permMod12[ii + i1 + perm[jj + j1]] * 3;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad3[gi1] * x1 + grad3[gi1 + 1] * y1);", + " }", + " let t2 = 0.5 - x2 * x2 - y2 * y2;", + " if (t2 >= 0) {", + " const gi2 = permMod12[ii + 1 + perm[jj + 1]] * 3;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad3[gi2] * x2 + grad3[gi2 + 1] * y2);", + " }", + " // Add contributions from each corner to get the final noise value.", + " // The result is scaled to return values in the interval [-1,1].", + " return 70.0 * (n0 + n1 + n2);", + " }", + "", + " /**", + " * Samples the noise field in 3 dimensions", + " * @param {number} x", + " * @param {number} y", + " * @param {number} z", + " * @returns a number in the interval [-1, 1]", + " */", + " noise3D(x, y, z) {", + " const permMod12 = this.permMod12;", + " const perm = this.perm;", + " let n0, n1, n2, n3; // Noise contributions from the four corners", + " // Skew the input space to determine which simplex cell we're in", + " const s = (x + y + z) * F3; // Very nice and simple skew factor for 3D", + " const i = Math.floor(x + s);", + " const j = Math.floor(y + s);", + " const k = Math.floor(z + s);", + " const t = (i + j + k) * G3;", + " const X0 = i - t; // Unskew the cell origin back to (x,y,z) space", + " const Y0 = j - t;", + " const Z0 = k - t;", + " const x0 = x - X0; // The x,y,z distances from the cell origin", + " const y0 = y - Y0;", + " const z0 = z - Z0;", + " // For the 3D case, the simplex shape is a slightly irregular tetrahedron.", + " // Determine which simplex we are in.", + " let i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) coords", + " let i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords", + " if (x0 >= y0) {", + " if (y0 >= z0) {", + " i1 = 1;", + " j1 = 0;", + " k1 = 0;", + " i2 = 1;", + " j2 = 1;", + " k2 = 0;", + " } // X Y Z order", + " else if (x0 >= z0) {", + " i1 = 1;", + " j1 = 0;", + " k1 = 0;", + " i2 = 1;", + " j2 = 0;", + " k2 = 1;", + " } // X Z Y order", + " else {", + " i1 = 0;", + " j1 = 0;", + " k1 = 1;", + " i2 = 1;", + " j2 = 0;", + " k2 = 1;", + " } // Z X Y order", + " }", + " else { // x0 y0)", + " rankx++;", + " else", + " ranky++;", + " if (x0 > z0)", + " rankx++;", + " else", + " rankz++;", + " if (x0 > w0)", + " rankx++;", + " else", + " rankw++;", + " if (y0 > z0)", + " ranky++;", + " else", + " rankz++;", + " if (y0 > w0)", + " ranky++;", + " else", + " rankw++;", + " if (z0 > w0)", + " rankz++;", + " else", + " rankw++;", + " // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some order.", + " // Many values of c will never occur, since e.g. x>y>z>w makes x= 3 ? 1 : 0;", + " const j1 = ranky >= 3 ? 1 : 0;", + " const k1 = rankz >= 3 ? 1 : 0;", + " const l1 = rankw >= 3 ? 1 : 0;", + " // The integer offsets for the third simplex corner", + " const i2 = rankx >= 2 ? 1 : 0;", + " const j2 = ranky >= 2 ? 1 : 0;", + " const k2 = rankz >= 2 ? 1 : 0;", + " const l2 = rankw >= 2 ? 1 : 0;", + " // The integer offsets for the fourth simplex corner", + " const i3 = rankx >= 1 ? 1 : 0;", + " const j3 = ranky >= 1 ? 1 : 0;", + " const k3 = rankz >= 1 ? 1 : 0;", + " const l3 = rankw >= 1 ? 1 : 0;", + " // The fifth corner has all coordinate offsets = 1, so no need to compute that.", + " const x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) coords", + " const y1 = y0 - j1 + G4;", + " const z1 = z0 - k1 + G4;", + " const w1 = w0 - l1 + G4;", + " const x2 = x0 - i2 + 2.0 * G4; // Offsets for third corner in (x,y,z,w) coords", + " const y2 = y0 - j2 + 2.0 * G4;", + " const z2 = z0 - k2 + 2.0 * G4;", + " const w2 = w0 - l2 + 2.0 * G4;", + " const x3 = x0 - i3 + 3.0 * G4; // Offsets for fourth corner in (x,y,z,w) coords", + " const y3 = y0 - j3 + 3.0 * G4;", + " const z3 = z0 - k3 + 3.0 * G4;", + " const w3 = w0 - l3 + 3.0 * G4;", + " const x4 = x0 - 1.0 + 4.0 * G4; // Offsets for last corner in (x,y,z,w) coords", + " const y4 = y0 - 1.0 + 4.0 * G4;", + " const z4 = z0 - 1.0 + 4.0 * G4;", + " const w4 = w0 - 1.0 + 4.0 * G4;", + " // Work out the hashed gradient indices of the five simplex corners", + " const ii = i & 255;", + " const jj = j & 255;", + " const kk = k & 255;", + " const ll = l & 255;", + " // Calculate the contribution from the five corners", + " let t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0;", + " if (t0 < 0)", + " n0 = 0.0;", + " else {", + " const gi0 = (perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32) * 4;", + " t0 *= t0;", + " n0 = t0 * t0 * (grad4[gi0] * x0 + grad4[gi0 + 1] * y0 + grad4[gi0 + 2] * z0 + grad4[gi0 + 3] * w0);", + " }", + " let t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1;", + " if (t1 < 0)", + " n1 = 0.0;", + " else {", + " const gi1 = (perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32) * 4;", + " t1 *= t1;", + " n1 = t1 * t1 * (grad4[gi1] * x1 + grad4[gi1 + 1] * y1 + grad4[gi1 + 2] * z1 + grad4[gi1 + 3] * w1);", + " }", + " let t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2;", + " if (t2 < 0)", + " n2 = 0.0;", + " else {", + " const gi2 = (perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32) * 4;", + " t2 *= t2;", + " n2 = t2 * t2 * (grad4[gi2] * x2 + grad4[gi2 + 1] * y2 + grad4[gi2 + 2] * z2 + grad4[gi2 + 3] * w2);", + " }", + " let t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3;", + " if (t3 < 0)", + " n3 = 0.0;", + " else {", + " const gi3 = (perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32) * 4;", + " t3 *= t3;", + " n3 = t3 * t3 * (grad4[gi3] * x3 + grad4[gi3 + 1] * y3 + grad4[gi3 + 2] * z3 + grad4[gi3 + 3] * w3);", + " }", + " let t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4;", + " if (t4 < 0)", + " n4 = 0.0;", + " else {", + " const gi4 = (perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32) * 4;", + " t4 *= t4;", + " n4 = t4 * t4 * (grad4[gi4] * x4 + grad4[gi4 + 1] * y4 + grad4[gi4 + 2] * z4 + grad4[gi4 + 3] * w4);", + " }", + " // Sum up and scale the result to cover the range [-1,1]", + " return 27.0 * (n0 + n1 + n2 + n3 + n4);", + " };", + "}", + "", + "gdjs._cameraShakeExtension = {", + " noiseManager: new NoiseManager(),", + "};", + "" ], - "parameters": [] + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Generate a number from 2 dimensional simplex noise.", + "fullName": "2D noise", + "functionType": "Expression", + "name": "Noise2d", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "const x = eventsFunctionContext.getArgument(\"X\");\r", + "const y = eventsFunctionContext.getArgument(\"Y\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).noise(x, y);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { - "description": "Amplitude of shaking on the X axis (pixels) (For example: 5)", - "name": "PowerX", + "description": "Generator name", + "name": "Name", + "type": "string" + }, + { + "description": "X coordinate", + "name": "X", "type": "expression" }, { - "description": "Amplitude of shaking on the Y axis (pixels) (For example: 5)", - "name": "PowerY", + "description": "Y coordinate", + "name": "Y", "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Generate a number from 3 dimensional simplex noise.", + "fullName": "3D noise", + "functionType": "Expression", + "name": "Noise3d", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "const x = eventsFunctionContext.getArgument(\"X\");\r", + "const y = eventsFunctionContext.getArgument(\"Y\");\r", + "const z = eventsFunctionContext.getArgument(\"Z\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).noise(x, y, z);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" }, { - "description": "Layer (base layer if empty)", - "name": "Layer", - "type": "layer" + "description": "X coordinate", + "name": "X", + "type": "expression" }, { - "description": "Camera index (Default: 0)", - "name": "Camera", + "description": "Y coordinate", + "name": "Y", "type": "expression" }, { - "description": "Duration (seconds) (Default: 0.5)", - "name": "Duration", + "description": "Z coordinate", + "name": "Z", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Generate a number from 4 dimensional simplex noise.", + "fullName": "4D noise", + "functionType": "Expression", + "name": "Noise4d", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "const x = eventsFunctionContext.getArgument(\"X\");\r", + "const y = eventsFunctionContext.getArgument(\"Y\");\r", + "const z = eventsFunctionContext.getArgument(\"Z\");\r", + "const w = eventsFunctionContext.getArgument(\"W\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).noise(x, y, z, w);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + }, + { + "description": "X coordinate", + "name": "X", "type": "expression" }, { - "description": "Angle rotation amplitude (degrees) (For example: 2)", - "name": "PowerAngle", + "description": "Y coordinate", + "name": "Y", "type": "expression" }, { - "description": "Zoom amplitude (percent change) (For example: 3)", - "name": "PowerZoom", + "description": "Z coordinate", + "name": "Z", + "type": "expression" + }, + { + "description": "W coordinate", + "name": "W", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Create a noise generator with default settings (frequency = 1, octaves = 1, persistence = 0.5, lacunarity = 2).", + "fullName": "Create a noise generator", + "functionType": "Action", + "name": "Create", + "private": true, + "sentence": "Create a noise generator named _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Delete a noise generator and loose its settings.", + "fullName": "Delete a noise generator", + "functionType": "Action", + "name": "Delete", + "private": true, + "sentence": "Delete _PARAM1_ noise generator", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.deleteGenerator(name);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Delete all noise generators and loose their settings.", + "fullName": "Delete all noise generators", + "functionType": "Action", + "name": "DeleteAll", + "private": true, + "sentence": "Delete all noise generators", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "gdjs._cameraShakeExtension.noiseManager.deleteAllGenerators();", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "The seed is a number used to generate the random noise. Setting the same seed will result in the same random noise generation. It's for example useful to generate the same world, by saving this seed value and reusing it later to generate again a world.", + "fullName": "Noise seed", + "functionType": "Action", + "name": "SetSeed", + "private": true, + "sentence": "Change the noise seed to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "gdjs._cameraShakeExtension.noiseManager.setSeed(eventsFunctionContext.getArgument(\"Seed\"));", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Seed", + "longDescription": "15 digits numbers maximum", + "name": "Seed", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the looping period on X used for noise generation. The noise will wrap-around on X.", + "fullName": "Noise looping period on X", + "functionType": "Action", + "name": "SetLoopPeriodX", + "private": true, + "sentence": "Change the looping period on X of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).xLoopPeriod = eventsFunctionContext.getArgument(\"LoopPeriod\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Looping period on X", + "name": "LoopPeriod", "type": "expression" }, { - "description": "Amount of time between shakes (seconds) (Default: 0.08)", - "name": "TimeBetweenShakes", + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the looping period on Y used for noise generation. The noise will wrap-around on Y.", + "fullName": "Noise looping period on Y", + "functionType": "Action", + "name": "SetLoopPeriodY", + "private": true, + "sentence": "Change the looping period on Y of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).yLoopPeriod = eventsFunctionContext.getArgument(\"LoopPeriod\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Looping period on Y", + "name": "LoopPeriod", "type": "expression" }, { - "description": "Keep shaking until stopped", - "longDescription": "Duration value will be ignored", - "name": "ShakeForever", - "type": "yesorno" + "description": "Generator name", + "name": "Name", + "type": "string" } ], "objectGroups": [] }, { - "fullName": "", + "description": "Change the base frequency used for noise generation. A lower frequency will zoom in the noise.", + "fullName": "Noise base frequency", "functionType": "Action", - "name": "onScenePostEvents", + "name": "SetFrequency", + "private": true, + "sentence": "Change the noise frequency of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).frequency = eventsFunctionContext.getArgument(\"Frequency\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Frequency", + "name": "Frequency", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the number of octaves used for noise generation. It can be seen as layers of noise with different zoom.", + "fullName": "Noise octaves", + "functionType": "Action", + "name": "SetOctaves", + "private": true, + "sentence": "Change the number of noise octaves of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).octaves = eventsFunctionContext.getArgument(\"Octaves\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Octaves", + "name": "Octaves", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the persistence used for noise generation. At its default value \"0.5\", it halves the noise amplitude at each octave.", + "fullName": "Noise persistence", + "functionType": "Action", + "name": "SetPersistence", + "private": true, + "sentence": "Change the noise persistence of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).persistence = eventsFunctionContext.getArgument(\"Persistence\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Persistence", + "name": "Persistence", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the lacunarity used for noise generation. At its default value \"2\", it doubles the frequency at each octave.", + "fullName": "Noise lacunarity", + "functionType": "Action", + "name": "SetLacunarity", + "private": true, + "sentence": "Change the noise lacunarity of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).lacunarity = eventsFunctionContext.getArgument(\"Lacunarity\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Lacunarity", + "name": "Lacunarity", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "The seed used for noise generation.", + "fullName": "Noise seed", + "functionType": "Expression", + "name": "Seed", + "private": true, "sentence": "", "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Camera Shake", - "source": "", - "type": "BuiltinCommonInstructions::Group", + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.seed;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "The base frequency used for noise generation.", + "fullName": "Noise base frequency", + "functionType": "Expression", + "name": "Frequency", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).frequency;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "The number of octaves used for noise generation.", + "fullName": "Noise octaves number", + "functionType": "Expression", + "name": "Octaves", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).octaves;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "The persistence used for noise generation.", + "fullName": "Noise persistence", + "functionType": "Expression", + "name": "Persistence", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).persistence;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "The lacunarity used for noise generation.", + "fullName": "Noise lacunarity", + "functionType": "Expression", + "name": "Lacunarity", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).lacunarity;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "User interface", + "extensionNamespace": "", + "fullName": "Button states and effects", + "helpPath": "/objects/button", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWdlc3R1cmUtdGFwLWJ1dHRvbiIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMyA1QzE1LjIxIDUgMTcgNi43OSAxNyA5QzE3IDEwLjUgMTYuMiAxMS43NyAxNSAxMi40NlYxMS4yNEMxNS42MSAxMC42OSAxNiA5Ljg5IDE2IDlDMTYgNy4zNCAxNC42NiA2IDEzIDZTMTAgNy4zNCAxMCA5QzEwIDkuODkgMTAuMzkgMTAuNjkgMTEgMTEuMjRWMTIuNDZDOS44IDExLjc3IDkgMTAuNSA5IDlDOSA2Ljc5IDEwLjc5IDUgMTMgNU0yMCAyMC41QzE5Ljk3IDIxLjMyIDE5LjMyIDIxLjk3IDE4LjUgMjJIMTNDMTIuNjIgMjIgMTIuMjYgMjEuODUgMTIgMjEuNTdMOCAxNy4zN0w4Ljc0IDE2LjZDOC45MyAxNi4zOSA5LjIgMTYuMjggOS41IDE2LjI4SDkuN0wxMiAxOFY5QzEyIDguNDUgMTIuNDUgOCAxMyA4UzE0IDguNDUgMTQgOVYxMy40N0wxNS4yMSAxMy42TDE5LjE1IDE1Ljc5QzE5LjY4IDE2LjAzIDIwIDE2LjU2IDIwIDE3LjE0VjIwLjVNMjAgMkg0QzIuOSAyIDIgMi45IDIgNFYxMkMyIDEzLjExIDIuOSAxNCA0IDE0SDhWMTJMNCAxMkw0IDRIMjBMMjAgMTJIMThWMTRIMjBWMTMuOTZMMjAuMDQgMTRDMjEuMTMgMTQgMjIgMTMuMDkgMjIgMTJWNEMyMiAyLjkgMjEuMTEgMiAyMCAyWiIgLz48L3N2Zz4=", + "name": "ButtonStates", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/753a9a794bd885058159b7509f06f5a8f67f72decfccb9a1b0efee26f41c3c4c_gesture-tap-button.svg", + "shortDescription": "Use any object as a button and change appearance according to user interactions.", + "version": "1.2.0", + "description": [ + "Use the \"Button states\" behavior to track user interactions with an object, including:", + "", + "- Hovered", + "- Pressed", + "- Clicked", + "- Idle", + "", + "Add additional behaviors to make juicy buttons with animated responses to user input:", + "", + "- Size", + "- Color", + "- Animation", + "- Object effects" + ], + "origin": { + "identifier": "ButtonStates", + "name": "gdevelop-extension-store" + }, + "tags": [ + "ui", + "button" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Use objects as buttons.", + "fullName": "Button states", + "name": "ButtonFSM", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", "events": [ { "colorB": 228, "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Start shaking", + "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": "VarGlobal" + "value": "ButtonStates::ButtonFSM::PropertyState" }, "parameters": [ - "__CameraShake_ShakeInProgress", + "Object", + "Behavior", "=", - "1" + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Check position", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Make sure the cursor position is only checked once per frame." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyShouldCheckHovering" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "MouseOnlyCursorX(Object.Layer(), 0)", + "MouseOnlyCursorY(Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } ] - } - ], - "actions": [], - "events": [ + }, { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -40481,1872 +49966,6923 @@ "textG": 0, "textR": 0 }, - "comment": "Keep shaking forever (if desired)", - "comment2": "" + "comment": "Touches are always pressed, so ShouldCheckHovering doesn't matter." }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "GlobalVariableAsBoolean" + "value": "ButtonStates::ButtonFSM::SetPropertyTouchIsInside" }, "parameters": [ - "__CameraShake_ShakeForever", - "True" + "Object", + "Behavior", + "no" ] } - ], - "actions": [ + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "ModVarGlobal" + "value": "ButtonStates::ButtonFSM::PropertyTouchId" }, "parameters": [ - "__CameraShake_Duration", - "=", - "100" + "Object", + "Behavior", + "!=", + "0" ] }, { "type": { - "value": "ResetTimer" + "value": "CollisionPoint" }, "parameters": [ - "", - "\"__CameraShake_DurationTimer\"" + "Object", + "TouchX(TouchId, Object.Layer(), 0)", + "TouchY(TouchId, Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior", + "yes" ] } ] - }, + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Handle touch start", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Calculate movement of the shake", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "HasAnyTouchOrMouseStarted" }, - "comment": "Run once before every shake movement", - "comment2": "" - }, + "parameters": [ + "" + ] + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_InitialShake", - "=", - "1" - ] - }, - { - "type": { - "value": "Timer" - }, - "parameters": [ - "", - "GlobalVariable(__CameraShake_TimeBetweenShakes)", - "\"__CameraShake_ShakeTimer\"" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "ResetTimer" - }, - "parameters": [ - "", - "\"__CameraShake_ShakeTimer\"" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_ShakeCounter", - "+", - "1" - ] - } - ], - "events": [ - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "folded": true, - "name": "Correct for drift and reset drift tracking variables", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Move to correct any drift from previous shake", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerAngle", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "RotateCamera" - }, - "parameters": [ - "", - "-", - "GlobalVariable(__CameraShake_AngleTravelled)", - "GlobalVariableString(__CameraShake_Layer)", - "GlobalVariable(__CameraShake_Camera)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerZoom", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ZoomCamera" - }, - "parameters": [ - "", - "CameraZoom(GlobalVariableString(__CameraShake_Layer),GlobalVariable(__CameraShake_Camera)) - GlobalVariable(__CameraShake_ZoomTravelled)", - "GlobalVariableString(__CameraShake_Layer)", - "GlobalVariable(__CameraShake_Camera)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerX", - "!=", - "0" - ] - }, - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerY", - "!=", - "0" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "SetCameraX" - }, - "parameters": [ - "Object", - "-", - "GlobalVariable(__CameraShake_DisplacementTravelledX)", - "GlobalVariableString(__CameraShake_Layer)", - "GlobalVariable(__CameraShake_Camera)" - ] - }, - { - "type": { - "value": "SetCameraY" - }, - "parameters": [ - "Object", - "-", - "GlobalVariable(__CameraShake_DisplacementTravelledY)", - "GlobalVariableString(__CameraShake_Layer)", - "GlobalVariable(__CameraShake_Camera)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Reset drift detection variables", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementTravelledX", - "=", - "0" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementTravelledY", - "=", - "0" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_AngleTravelled", - "=", - "0" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_ZoomTravelled", - "=", - "0" - ] - } - ] - } - ], - "parameters": [] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Calculate Position Shake", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerX", - "!=", - "0" - ] - }, - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerY", - "!=", - "0" - ] - } - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "PositionDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * [-1 or 1]", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Make initial shake NOT random so users can set a direction for a one-shake effect", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_InitialShake", - "=", - "1" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerX", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementX", - "=", - "(GlobalVariable(__CameraShake_Duration) - TimerElapsedTime(\"__CameraShake_DurationTimer\")) / GlobalVariable(__CameraShake_Duration) * GlobalVariable(__CameraShake_PowerX)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerY", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementY", - "=", - "(GlobalVariable(__CameraShake_Duration) - TimerElapsedTime(\"__CameraShake_DurationTimer\")) / GlobalVariable(__CameraShake_Duration) * GlobalVariable(__CameraShake_PowerY)" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "After initial shake pick a random direction", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_InitialShake", - "=", - "0" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerX", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementX", - "=", - "(GlobalVariable(__CameraShake_Duration) - TimerElapsedTime(\"__CameraShake_DurationTimer\")) / GlobalVariable(__CameraShake_Duration) * GlobalVariable(__CameraShake_PowerX) * RandomWithStep(-1, 1, 2)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerY", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementY", - "=", - "(GlobalVariable(__CameraShake_Duration) - TimerElapsedTime(\"__CameraShake_DurationTimer\")) / GlobalVariable(__CameraShake_Duration) * GlobalVariable(__CameraShake_PowerY) * RandomWithStep(-1, 1, 2)" - ] - } - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Calculate Rotation (angle) shake ", - "comment2": "" - }, + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StartedTouchOrMouseCount()", + "conditions": [], + "actions": [], + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "VarGlobal" + "value": "CollisionPoint" }, "parameters": [ - "__CameraShake_PowerAngle", - "!=", - "0" + "Object", + "TouchX(StartedTouchOrMouseId(Index), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Index), Object.Layer(), 0)" ] } ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Every \"even\" shake, rotate counter-clockwise", - "comment2": "" - }, + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyTouchId" }, - "comment": "DisplacementAngle = ((DesiredDuration - RunningTimer) / DesiredDuration) * Amplitude", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "mod(GlobalVariable(__CameraShake_ShakeCounter),2)", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementAngle", - "=", - "(GlobalVariable(__CameraShake_Duration) - TimerElapsedTime(\"__CameraShake_DurationTimer\")) / GlobalVariable(__CameraShake_Duration) * GlobalVariable(__CameraShake_PowerAngle)" - ] - } + "parameters": [ + "Object", + "Behavior", + "=", + "StartedTouchOrMouseId(Index)" ] }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Every \"odd\" shake, rotate clockwise (this includes the initial shake and can be used for a one shake effect)", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "DisplacementAngle = -1 * ((DesiredDuration - RunningTimer) / DesiredDuration) * Amplitude", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "mod(GlobalVariable(__CameraShake_ShakeCounter),2)", - "=", - "1" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementAngle", - "=", - "-1 * (GlobalVariable(__CameraShake_Duration) - TimerElapsedTime(\"__CameraShake_DurationTimer\")) / GlobalVariable(__CameraShake_Duration) * GlobalVariable(__CameraShake_PowerAngle)" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Calculate Zoom shake", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ { "type": { - "value": "VarGlobal" + "value": "ButtonStates::ButtonFSM::SetPropertyTouchIsInside" }, "parameters": [ - "__CameraShake_PowerZoom", - "!=", - "0" + "Object", + "Behavior", + "yes" ] } ], - "actions": [], "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Calculate camera zoom displacement, with linear decay over time", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "ZoomDisplacement = ((DesiredDuration - RunningTimer) / DesiredDuration) * Amplitude * 1/100", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Every even shake, increase zoom", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "mod(GlobalVariable(__CameraShake_ShakeCounter),2)", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementZoom", - "=", - "-1 * (GlobalVariable(__CameraShake_Duration) - TimerElapsedTime(\"__CameraShake_DurationTimer\")) / GlobalVariable(__CameraShake_Duration) * GlobalVariable(__CameraShake_PowerZoom) * (1/100)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Every \"odd\" shake, decrease scale", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "ZoomDisplacement = -1 * ((DesiredDuration - RunningTimer) / DesiredDuration) * Amplitude * 1/100", - "comment2": "" - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "Egal" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "mod(GlobalVariable(__CameraShake_ShakeCounter),2)", - "=", - "1" + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } ] } ], "actions": [ { "type": { - "value": "ModVarGlobal" + "value": "ButtonStates::ButtonFSM::SetPropertyState" }, "parameters": [ - "__CameraShake_DisplacementZoom", + "Object", + "Behavior", "=", - "(GlobalVariable(__CameraShake_Duration) - TimerElapsedTime(\"__CameraShake_DurationTimer\")) / GlobalVariable(__CameraShake_Duration) * GlobalVariable(__CameraShake_PowerZoom) * (1/100)" + "\"PressedInside\"" ] } ] } ] }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Save that initial shake has been processed", - "comment2": "" - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "ModVarGlobal" + "value": "ButtonStates::ButtonFSM::SetPropertyIndex" }, "parameters": [ - "__CameraShake_InitialShake", - "=", - "0" + "Object", + "Behavior", + "+", + "1" ] } ] } ] } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Apply position changes", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ButtonStates::ButtonFSM::PropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyMouseIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ButtonStates::ButtonFSM::PropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyTouchIsInside" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Handle touch end", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasTouchEnded" + }, + "parameters": [ + "", + "TouchId" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + }, + { + "type": { + "inverted": true, + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::ResetState" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Reset the state of the button.", + "fullName": "Reset state", + "functionType": "Action", + "name": "ResetState", + "private": true, + "sentence": "Reset the button state of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is not used.", + "fullName": "Is idle", + "functionType": "Condition", + "name": "IsIdle", + "sentence": "_PARAM0_ is idle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button was just clicked.", + "fullName": "Is clicked", + "functionType": "Condition", + "name": "IsClicked", + "sentence": "_PARAM0_ is clicked", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the cursor is hovered over the button.", + "fullName": "Is hovered", + "functionType": "Condition", + "name": "IsHovered", + "sentence": "_PARAM0_ is hovered", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is either hovered or pressed but not hovered.", + "fullName": "Is focused", + "functionType": "Condition", + "name": "IsFocused", + "sentence": "_PARAM0_ is focused", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Hovered\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is currently being pressed with mouse or touch.", + "fullName": "Is pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "_PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedInside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the button is currently being pressed outside with mouse or touch.", + "fullName": "Is held outside", + "functionType": "Condition", + "name": "IsPressedOutside", + "sentence": "_PARAM0_ is held outside", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::PropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"PressedOutside\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the touch id that is using the button or 0 if none.", + "fullName": "Touch id", + "functionType": "ExpressionAndCondition", + "name": "TouchId", + "sentence": "the touch id", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TouchId" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonFSM", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "true", + "type": "Boolean", + "label": "", + "description": "Should check hovering", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShouldCheckHovering" + }, + { + "value": "Idle", + "type": "Choice", + "label": "State", + "description": "", + "group": "", + "extraInformation": [ + "Idle", + "Hovered", + "PressedInside", + "PressedOutside", + "Validated" + ], + "hidden": true, + "name": "State" + }, + { + "value": "0", + "type": "Number", + "label": "Touch id", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchId" + }, + { + "value": "", + "type": "Boolean", + "label": "Touch is inside", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchIsInside" + }, + { + "value": "", + "type": "Boolean", + "label": "Mouse is inside", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "MouseIsInside" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "Index" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Enable effects on buttons based on their state.", + "fullName": "Button object effects", + "name": "ButtonObjectEffects", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "IdleEffect", + "yes" + ] + }, + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "FocusedEffect", + "no" + ] + }, + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "PressedEffect", + "no" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffects", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "States", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "IdleEffect", + "no" + ] + }, + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "FocusedEffect", + "no" + ] + }, + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "PressedEffect", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffects::PropertyIdleEffect" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::IsIdle" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "IdleEffect", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffects::PropertyFocusedEffect" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::IsFocused" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "FocusedEffect", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffects::PropertyPressedEffect" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonFSM::IsPressed" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "PressedEffect", + "yes" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffects", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the idle state effect of the object.", + "fullName": "Idle state effect", + "functionType": "ExpressionAndCondition", + "group": "Button object effects configuration", + "name": "IdleEffect", + "sentence": "the idle state effect", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "IdleEffect" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffects", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "IdleEffect", + "name": "SetIdleEffect", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffects::SetPropertyIdleEffect" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffects", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the focused state effect of the object. The state is Focused when the button is hovered or held outside.", + "fullName": "Focused state effect", + "functionType": "ExpressionAndCondition", + "group": "Button object effects configuration", + "name": "FocusedEffect", + "sentence": "the focused state effect", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "FocusedEffect" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffects", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FocusedEffect", + "name": "SetFocusedEffect", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffects::SetPropertyFocusedEffect" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffects", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the pressed state effect of the object.", + "fullName": "Pressed state effect", + "functionType": "ExpressionAndCondition", + "group": "Button object effects configuration", + "name": "PressedEffect", + "sentence": "the pressed state effect", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "PressedEffect" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffects", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "PressedEffect", + "name": "SetPressedEffect", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffects::SetPropertyPressedEffect" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffects", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Button states", + "description": "", + "group": "", + "extraInformation": [ + "ButtonStates::ButtonFSM" + ], + "name": "ButtonFSM" + }, + { + "value": "", + "type": "Behavior", + "label": "Effect capability", + "description": "", + "group": "", + "extraInformation": [ + "EffectCapability::EffectBehavior" + ], + "name": "Effect" + }, + { + "value": "", + "type": "String", + "label": "Idle state effect", + "description": "", + "group": "Effects", + "extraInformation": [], + "name": "IdleEffect" + }, + { + "value": "", + "type": "String", + "label": "Focused state effect", + "description": "The state is Focused when the button is hovered or held outside.", + "group": "Effects", + "extraInformation": [], + "name": "FocusedEffect" + }, + { + "value": "", + "type": "String", + "label": "Pressed state effect", + "description": "", + "group": "Effects", + "extraInformation": [], + "name": "PressedEffect" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Change the animation of buttons according to their state.", + "fullName": "Button animation", + "name": "ButtonAnimationName", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "IdleAnimationName" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAnimationName", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Change based on state", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsIdle" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "IdleAnimationName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsFocused" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "FocusedAnimationName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsPressed" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "PressedAnimationName" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAnimationName", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the idle state animation name of the object.", + "fullName": "Idle state animation name", + "functionType": "ExpressionAndCondition", + "group": "Button animation configuration", + "name": "IdleAnimationName", + "sentence": "the idle state animation name", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "IdleAnimationName" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAnimationName", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "IdleAnimationName", + "name": "SetIdleAnimationName", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonAnimationName::SetPropertyIdleAnimationName" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAnimationName", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the focused state animation name of the object. The state is Focused when the button is hovered or held outside.", + "fullName": "Focused state animation name", + "functionType": "ExpressionAndCondition", + "group": "Button animation configuration", + "name": "FocusedAnimationName", + "sentence": "the focused state animation name", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "FocusedAnimationName" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAnimationName", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FocusedAnimationName", + "name": "SetFocusedAnimationName", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonAnimationName::SetPropertyFocusedAnimationName" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAnimationName", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the pressed state animation name of the object.", + "fullName": "Pressed state animation name", + "functionType": "ExpressionAndCondition", + "group": "Button animation configuration", + "name": "PressedAnimationName", + "sentence": "the pressed state animation name", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "PressedAnimationName" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAnimationName", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "PressedAnimationName", + "name": "SetPressedAnimationName", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonAnimationName::SetPropertyPressedAnimationName" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonAnimationName", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Animatable capability", + "description": "", + "group": "", + "extraInformation": [ + "AnimatableCapability::AnimatableBehavior" + ], + "name": "Animation" + }, + { + "value": "", + "type": "Behavior", + "label": "Button states", + "description": "", + "group": "", + "extraInformation": [ + "ButtonStates::ButtonFSM" + ], + "name": "ButtonFSM" + }, + { + "value": "Idle", + "type": "String", + "label": "Idle state animation name", + "description": "", + "group": "Animation", + "extraInformation": [], + "name": "IdleAnimationName" + }, + { + "value": "Focused", + "type": "String", + "label": "Focused state animation name", + "description": "The state is Focused when the button is hovered or held outside.", + "group": "Animation", + "extraInformation": [], + "name": "FocusedAnimationName" + }, + { + "value": "Pressed", + "type": "String", + "label": "Pressed state animation name", + "description": "", + "group": "Animation", + "extraInformation": [], + "name": "PressedAnimationName" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Smoothly change an effect on buttons according to their state.", + "fullName": "Button object effect tween", + "name": "ButtonObjectEffectTween", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyEffectValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "IdleValue" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "States", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsIdle" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "IdleValue", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsFocused" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "FocusedValue", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "FocusedValue", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsPressed" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "PressedValue", + "" + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Tween", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PropertyTweenState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"FadeIn\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PlayTween" + }, + "parameters": [ + "Object", + "Behavior", + "FadeInDuration", + "FadeInEasing", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PropertyTweenState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"FadeOut\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PlayTween" + }, + "parameters": [ + "Object", + "Behavior", + "FadeOutDuration", + "FadeOutEasing", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Time delta", + "functionType": "Expression", + "name": "TimeDelta", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TimeDelta() * LayerTimeScale(Object.Layer())" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade in", + "functionType": "Action", + "name": "FadeIn", + "private": true, + "sentence": "_PARAM0_ fade in to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"FadeIn\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "EffectValue" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenTargetedValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade out", + "functionType": "Action", + "name": "FadeOut", + "private": true, + "sentence": "_PARAM0_ fade out to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"FadeOut\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenInitialValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "EffectValue" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenTargetedValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "Play tween", + "functionType": "Action", + "name": "PlayTween", + "private": true, + "sentence": "Tween the effect property of object _PARAM0_ over _PARAM2_ seconds with _PARAM3_ easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PropertyTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "<", + "Duration" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "Object.Behavior::TimeDelta()" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyEffectValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Tween::Ease(Easing, TweenInitialValue, TweenTargetedValue, TweenTime / Duration)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::PropertyTweenTime" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "Duration" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyTweenState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"NoTween\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyEffectValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "TweenTargetedValue" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::SetEffectDoubleParameter" + }, + "parameters": [ + "Object", + "Effect", + "EffectName", + "EffectProperty", + "EffectValue" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + }, + { + "description": "Duration (in seconds)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Easing", + "name": "Easing", + "supplementaryInformation": "[]", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "the effect name of the object.", + "fullName": "Effect name", + "functionType": "ExpressionAndCondition", + "group": "Button effect tween configuration", + "name": "EffectName", + "sentence": "the effect name", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "EffectName" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the effect parameter of the object. The effect parameter names can be found in the effects tab with the \"Show parameter names\" action of the drop down menu.", + "fullName": "Effect parameter", + "functionType": "ExpressionAndCondition", + "group": "Button effect tween configuration", + "name": "EffectProperty", + "sentence": "the effect parameter", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "EffectProperty" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Change the effect parameter of the object. The effect parameter names can be found in the effects tab with the \"Show parameter names\" action of the drop down menu.", + "fullName": "Effect parameter", + "functionType": "Action", + "getterName": "EffectName", + "group": "Button effect tween configuration", + "name": "SetEffectProperty", + "sentence": "Change the tweened effect of _PARAM0_ to _PARAM2_ with parameter _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyEffectName" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "NewEffectName" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyEffectProperty" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "NewPropertyName" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + }, + { + "description": "Effect name", + "name": "NewEffectName", + "type": "string" + }, + { + "description": "Parameter name", + "name": "NewPropertyName", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "the idle effect parameter value of the object.", + "fullName": "Idle effect parameter value", + "functionType": "ExpressionAndCondition", + "group": "Button effect tween configuration", + "name": "IdleValue", + "sentence": "the idle effect parameter value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "IdleValue" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "IdleValue", + "name": "SetIdleValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyIdleValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the focused effect parameter value of the object. The state is Focused when the button is hovered or held outside.", + "fullName": "Focused effect parameter value", + "functionType": "ExpressionAndCondition", + "group": "Button effect tween configuration", + "name": "FocusedValue", + "sentence": "the focused effect parameter value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FocusedValue" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FocusedValue", + "name": "SetFocusedValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyFocusedValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the pressed effect parameter value of the object.", + "fullName": "Pressed effect parameter value", + "functionType": "ExpressionAndCondition", + "group": "Button effect tween configuration", + "name": "PressedValue", + "sentence": "the pressed effect parameter value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "PressedValue" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "PressedValue", + "name": "SetPressedValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyPressedValue" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the fade-in easing of the object.", + "fullName": "Fade-in easing", + "functionType": "ExpressionAndCondition", + "group": "Button effect tween configuration", + "name": "FadeInEasing", + "sentence": "the fade-in easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "FadeInEasing" + ] + } + ] + } + ], + "expressionType": { + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FadeInEasing", + "name": "SetFadeInEasing", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyFadeInEasing" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the fade-out easing of the object.", + "fullName": "Fade-out easing", + "functionType": "ExpressionAndCondition", + "group": "Button effect tween configuration", + "name": "FadeOutEasing", + "sentence": "the fade-out easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "FadeOutEasing" + ] + } + ] + } + ], + "expressionType": { + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FadeOutEasing", + "name": "SetFadeOutEasing", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyFadeOutEasing" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the fade-in duration of the object.", + "fullName": "Fade-in duration", + "functionType": "ExpressionAndCondition", + "group": "Button effect tween configuration", + "name": "FadeInDuration", + "sentence": "the fade-in duration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FadeInDuration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FadeInDuration", + "name": "SetFadeInDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyFadeInDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the fade-out duration of the object.", + "fullName": "Fade-out duration", + "functionType": "ExpressionAndCondition", + "group": "Button effect tween configuration", + "name": "FadeOutDuration", + "sentence": "the fade-out duration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FadeOutDuration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FadeOutDuration", + "name": "SetFadeOutDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonObjectEffectTween::SetPropertyFadeOutDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonObjectEffectTween", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Button states", + "description": "", + "group": "", + "extraInformation": [ + "ButtonStates::ButtonFSM" + ], + "name": "ButtonFSM" + }, + { + "value": "", + "type": "Behavior", + "label": "Effect capability", + "description": "", + "group": "", + "extraInformation": [ + "EffectCapability::EffectBehavior" + ], + "name": "Effect" + }, + { + "value": "Effect", + "type": "String", + "label": "Effect name", + "description": "", + "group": "Effect", + "extraInformation": [], + "name": "EffectName" + }, + { + "value": "", + "type": "String", + "label": "Effect parameter", + "description": "The effect parameter names can be found in the effects tab with the \"Show parameter names\" action of the drop down menu.", + "group": "Effect", + "extraInformation": [], + "name": "EffectProperty" + }, + { + "value": "0", + "type": "Number", + "label": "Idle effect parameter value", + "description": "", + "group": "Value", + "extraInformation": [], + "name": "IdleValue" + }, + { + "value": "0", + "type": "Number", + "label": "Focused effect parameter value", + "description": "The state is Focused when the button is hovered or held outside.", + "group": "Value", + "extraInformation": [], + "name": "FocusedValue" + }, + { + "value": "0", + "type": "Number", + "label": "Pressed effect parameter value", + "description": "", + "group": "Value", + "extraInformation": [], + "name": "PressedValue" + }, + { + "value": "easeInOutQuad", + "type": "Choice", + "label": "Fade-in easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "linear", + "easeInQuad", + "easeOutQuad", + "easeInOutQuad", + "easeInCubic", + "easeOutCubic", + "easeInOutCubic", + "easeInQuart", + "easeOutQuart", + "easeInOutQuart", + "easeInQuint", + "easeOutQuint", + "easeInOutQuint", + "easeInOutSine", + "easeInExpo", + "easeOutExpo", + "easeInOutExpo", + "easeInCirc", + "easeOutCirc", + "easeInOutCirc", + "easeOutBounce", + "easeInBack", + "easeOutBack", + "easeInOutBack", + "elastic", + "swingFromTo", + "swingFrom", + "swingTo", + "bounce", + "bouncePast", + "easeFromTo", + "easeFrom", + "easeTo" + ], + "name": "FadeInEasing" + }, + { + "value": "easeInOutQuad", + "type": "Choice", + "label": "Fade-out easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "linear", + "easeInQuad", + "easeOutQuad", + "easeInOutQuad", + "easeInCubic", + "easeOutCubic", + "easeInOutCubic", + "easeInQuart", + "easeOutQuart", + "easeInOutQuart", + "easeInQuint", + "easeOutQuint", + "easeInOutQuint", + "easeInOutSine", + "easeInExpo", + "easeOutExpo", + "easeInOutExpo", + "easeInCirc", + "easeOutCirc", + "easeInOutCirc", + "easeOutBounce", + "easeInBack", + "easeOutBack", + "easeInOutBack", + "elastic", + "swingFromTo", + "swingFrom", + "swingTo", + "bounce", + "bouncePast", + "easeFromTo", + "easeFrom", + "easeTo" + ], + "name": "FadeOutEasing" + }, + { + "value": "0.125", + "type": "Number", + "unit": "Second", + "label": "Fade-in duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "name": "FadeInDuration" + }, + { + "value": "0.5", + "type": "Number", + "unit": "Second", + "label": "Fade-out duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "name": "FadeOutDuration" + }, + { + "value": "Idle", + "type": "Choice", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "Idle", + "Focused", + "Pressed" + ], + "hidden": true, + "name": "PreviousState" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TweenInitialValue" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TweenTargetedValue" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TweenTime" + }, + { + "value": "NoTween", + "type": "Choice", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "NoTween", + "FadeIn", + "FadeOut" + ], + "hidden": true, + "name": "TweenState" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "EffectValue" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Smoothly resize buttons according to their state.", + "fullName": "Button scale tween", + "name": "ButtonScaleTween", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetValue" + }, + "parameters": [ + "Object", + "Scale", + "=", + "IdleScale" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Change based on state", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsIdle" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonScaleTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonScaleTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "IdleScale", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsFocused" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } ], - "parameters": [] + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonScaleTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "FocusedScale", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonScaleTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "FocusedScale", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsPressed" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonScaleTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonScaleTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "PressedScale", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade in", + "functionType": "Action", + "name": "FadeIn", + "private": true, + "sentence": "_PARAM0_ fade in to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectScaleTween" + }, + "parameters": [ + "Object", + "Tween", + "\"__ButtonScaleTween.Fade\"", + "Value", + "Value", + "FadeInEasing", + "1000 * FadeInDuration", + "no", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade out", + "functionType": "Action", + "name": "FadeOut", + "private": true, + "sentence": "_PARAM0_ fade out to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectScaleTween" + }, + "parameters": [ + "Object", + "Tween", + "\"__ButtonScaleTween.Fade\"", + "Value", + "Value", + "FadeOutEasing", + "1000 * FadeOutDuration", + "no", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the idle state size scale of the object.", + "fullName": "Idle state size scale", + "functionType": "ExpressionAndCondition", + "group": "Button scale tween configuration", + "name": "IdleScale", + "sentence": "the idle state size scale", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "IdleScale" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "IdleScale", + "name": "SetIdleScale", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::SetPropertyIdleScale" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the focused state size scale of the object. The state is Focused when the button is hovered or held outside.", + "fullName": "Focused state size scale", + "functionType": "ExpressionAndCondition", + "group": "Button scale tween configuration", + "name": "FocusedScale", + "sentence": "the focused state size scale", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FocusedScale" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FocusedScale", + "name": "SetFocusedScale", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::SetPropertyFocusedScale" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the pressed state size scale of the object.", + "fullName": "Pressed state size scale", + "functionType": "ExpressionAndCondition", + "group": "Button scale tween configuration", + "name": "PressedScale", + "sentence": "the pressed state size scale", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "PressedScale" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "PressedScale", + "name": "SetPressedScale", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::SetPropertyPressedScale" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the fade-in duration of the object.", + "fullName": "Fade-in duration", + "functionType": "ExpressionAndCondition", + "group": "Button scale tween configuration", + "name": "FadeInDuration", + "sentence": "the fade-in duration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FadeInDuration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FadeInDuration", + "name": "SetFadeInDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::SetPropertyFadeInDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the fade-out duration of the object.", + "fullName": "Fade-out duration", + "functionType": "ExpressionAndCondition", + "group": "Button scale tween configuration", + "name": "FadeOutDuration", + "sentence": "the fade-out duration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FadeOutDuration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FadeOutDuration", + "name": "SetFadeOutDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::SetPropertyFadeOutDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the fade-in easing of the object.", + "fullName": "Fade-in easing", + "functionType": "ExpressionAndCondition", + "group": "Button scale tween configuration", + "name": "FadeInEasing", + "sentence": "the fade-in easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "FadeInEasing" + ] + } + ] + } + ], + "expressionType": { + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FadeInEasing", + "name": "SetFadeInEasing", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::SetPropertyFadeInEasing" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the fade-out easing of the object.", + "fullName": "Fade-out easing", + "functionType": "ExpressionAndCondition", + "group": "Button scale tween configuration", + "name": "FadeOutEasing", + "sentence": "the fade-out easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "FadeOutEasing" + ] + } + ] + } + ], + "expressionType": { + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FadeOutEasing", + "name": "SetFadeOutEasing", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonScaleTween::SetPropertyFadeOutEasing" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonScaleTween", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Scalable capability", + "description": "", + "group": "", + "extraInformation": [ + "ScalableCapability::ScalableBehavior" + ], + "name": "Scale" + }, + { + "value": "", + "type": "Behavior", + "label": "Button states behavior (required)", + "description": "", + "group": "", + "extraInformation": [ + "ButtonStates::ButtonFSM" + ], + "name": "ButtonFSM" + }, + { + "value": "", + "type": "Behavior", + "label": "Tween behavior (required)", + "description": "", + "group": "", + "extraInformation": [ + "Tween::TweenBehavior" + ], + "name": "Tween" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Idle state size scale", + "description": "", + "group": "Size", + "extraInformation": [], + "name": "IdleScale" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Focused state size scale", + "description": "The state is Focused when the button is hovered or held outside.", + "group": "Size", + "extraInformation": [], + "name": "FocusedScale" + }, + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Fade-in duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "name": "FadeInDuration" + }, + { + "value": "0.2", + "type": "Number", + "unit": "Second", + "label": "Fade-out duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "name": "FadeOutDuration" + }, + { + "value": "0.95", + "type": "Number", + "unit": "Dimensionless", + "label": "Pressed state size scale", + "description": "", + "group": "Size", + "extraInformation": [], + "name": "PressedScale" + }, + { + "value": "easeInOutQuad", + "type": "Choice", + "label": "Fade-in easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "linear", + "easeInQuad", + "easeOutQuad", + "easeInOutQuad", + "easeInCubic", + "easeOutCubic", + "easeInOutCubic", + "easeInQuart", + "easeOutQuart", + "easeInOutQuart", + "easeInQuint", + "easeOutQuint", + "easeInOutQuint", + "easeInOutSine", + "easeInExpo", + "easeOutExpo", + "easeInOutExpo", + "easeInCirc", + "easeOutCirc", + "easeInOutCirc", + "easeOutBounce", + "easeInBack", + "easeOutBack", + "easeInOutBack", + "elastic", + "swingFromTo", + "swingFrom", + "swingTo", + "bounce", + "bouncePast", + "easeFromTo", + "easeFrom", + "easeTo" + ], + "name": "FadeInEasing" + }, + { + "value": "easeInOutQuad", + "type": "Choice", + "label": "Fade-out easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "linear", + "easeInQuad", + "easeOutQuad", + "easeInOutQuad", + "easeInCubic", + "easeOutCubic", + "easeInOutCubic", + "easeInQuart", + "easeOutQuart", + "easeInOutQuart", + "easeInQuint", + "easeOutQuint", + "easeInOutQuint", + "easeInOutSine", + "easeInExpo", + "easeOutExpo", + "easeInOutExpo", + "easeInCirc", + "easeOutCirc", + "easeInOutCirc", + "easeOutBounce", + "easeInBack", + "easeOutBack", + "easeInOutBack", + "elastic", + "swingFromTo", + "swingFrom", + "swingTo", + "bounce", + "bouncePast", + "easeFromTo", + "easeFrom", + "easeTo" + ], + "name": "FadeOutEasing" + }, + { + "value": "Idle", + "type": "Choice", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "Idle", + "Focused", + "Pressed" + ], + "hidden": true, + "name": "PreviousState" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Smoothly change the color tint of buttons according to their state.", + "fullName": "Button color tint tween", + "name": "ButtonColorTintTween", + "objectType": "Sprite", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ChangeColor" + }, + "parameters": [ + "Object", + "IdleColorTint" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "States", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsIdle" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] }, { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Move camera", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "type": { + "value": "ButtonStates::ButtonColorTintTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Idle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "IdleColorTint", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsFocused" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "ButtonStates::ButtonColorTintTween::PropertyPreviousState" }, - "comment": "Calculate the fraction of shake that occured during this frame", - "comment2": "" - }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" + ] + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake_PercentTimeElapsedThisFrame", - "=", - "min(1,TimeDelta()/GlobalVariable(__CameraShake_TimeBetweenShakes))" - ] - } + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" ] }, { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "ButtonStates::ButtonColorTintTween::FadeIn" }, - "comment": "Increase change for the first half of the shake (move away from original values)", - "comment2": "" - }, + "parameters": [ + "Object", + "Behavior", + "FocusedColorTint", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "Timer" - }, - "parameters": [ - "", - "GlobalVariable(__CameraShake_TimeBetweenShakes)/2", - "\"__CameraShake_ShakeTimer\"" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Change position", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerX", - "!=", - "0" - ] - }, - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerY", - "!=", - "0" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "CameraX" - }, - "parameters": [ - "", - "-", - "round(1024 * GlobalVariable(__CameraShake_DisplacementX) * Variable(__CameraShake_PercentTimeElapsedThisFrame)) / 1024", - "GlobalVariableString(__CameraShake_Layer)", - "GlobalVariable(__CameraShake_Camera)" - ] - }, - { - "type": { - "value": "CameraY" - }, - "parameters": [ - "", - "-", - "round(1024 * GlobalVariable(__CameraShake_DisplacementY) * Variable(__CameraShake_PercentTimeElapsedThisFrame)) / 1024", - "GlobalVariableString(__CameraShake_Layer)", - "GlobalVariable(__CameraShake_Camera)" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Save movement to calculate drift", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementTravelledX", - "-", - "round(1024 * GlobalVariable(__CameraShake_DisplacementX) * Variable(__CameraShake_PercentTimeElapsedThisFrame)) / 1024" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementTravelledY", - "-", - "round(1024 * GlobalVariable(__CameraShake_DisplacementY) * Variable(__CameraShake_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Change angle", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "GlobalVariable(__CameraShake_PowerAngle)", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "RotateCamera" - }, - "parameters": [ - "", - "+", - "round(1024 * (GlobalVariable(__CameraShake_DisplacementAngle) * Variable(__CameraShake_PercentTimeElapsedThisFrame))) / 1024", - "", - "" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Save movement to calculate drift", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_AngleTravelled", - "+", - "round(1024 * (GlobalVariable(__CameraShake_DisplacementAngle) * Variable(__CameraShake_PercentTimeElapsedThisFrame))) / 1024" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Change zoom", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "GlobalVariable(__CameraShake_PowerZoom)", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ZoomCamera" - }, - "parameters": [ - "", - "CameraZoom(GlobalVariableString(__CameraShake_Layer),GlobalVariable(__CameraShake_Camera)) + round(1024 * GlobalVariable(__CameraShake_DisplacementZoom) * Variable(__CameraShake_PercentTimeElapsedThisFrame)) / 1024", - "GlobalVariableString(__CameraShake_Layer)", - "GlobalVariable(__CameraShake_Camera)" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Save movement to calculate drift", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_ZoomTravelled", - "+", - "round(1024 * GlobalVariable(__CameraShake_DisplacementZoom) * Variable(__CameraShake_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ] - } - ] - } + "type": { + "value": "ButtonStates::ButtonColorTintTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyPreviousState" }, - "comment": "Decrease change the second half of the shake (return to original position)", - "comment2": "" + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Timer" - }, - "parameters": [ - "", - "GlobalVariable(__CameraShake_TimeBetweenShakes)/2", - "\"__CameraShake_ShakeTimer\"" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Change position", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerX", - "!=", - "0" - ] - }, - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerY", - "!=", - "0" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "CameraX" - }, - "parameters": [ - "", - "+", - "round(1024 * GlobalVariable(__CameraShake_DisplacementX) * Variable(__CameraShake_PercentTimeElapsedThisFrame)) / 1024", - "GlobalVariableString(__CameraShake_Layer)", - "GlobalVariable(__CameraShake_Camera)" - ] - }, - { - "type": { - "value": "CameraY" - }, - "parameters": [ - "", - "+", - "round(1024 * GlobalVariable(__CameraShake_DisplacementY) * Variable(__CameraShake_PercentTimeElapsedThisFrame)) / 1024", - "GlobalVariableString(__CameraShake_Layer)", - "GlobalVariable(__CameraShake_Camera)" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Save the amount of change to calculate drift", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementTravelledX", - "+", - "round(1024 * GlobalVariable(__CameraShake_DisplacementX) * Variable(__CameraShake_PercentTimeElapsedThisFrame)) / 1024" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementTravelledY", - "+", - "round(1024 * GlobalVariable(__CameraShake_DisplacementY) * Variable(__CameraShake_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Change angle", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "GlobalVariable(__CameraShake_PowerAngle)", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "RotateCamera" - }, - "parameters": [ - "", - "-", - "round(1024 * (GlobalVariable(__CameraShake_DisplacementAngle) * Variable(__CameraShake_PercentTimeElapsedThisFrame))) / 1024", - "", - "" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Save the amount of change to calculate drift", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_AngleTravelled", - "-", - "round(1024 * (GlobalVariable(__CameraShake_DisplacementAngle) * Variable(__CameraShake_PercentTimeElapsedThisFrame))) / 1024" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Change zoom", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Egal" - }, - "parameters": [ - "GlobalVariable(__CameraShake_PowerZoom)", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ZoomCamera" - }, - "parameters": [ - "", - "CameraZoom(GlobalVariableString(__CameraShake_Layer),GlobalVariable(__CameraShake_Camera)) - round(1024 * GlobalVariable(__CameraShake_DisplacementZoom) * Variable(__CameraShake_PercentTimeElapsedThisFrame)) / 1024", - "GlobalVariableString(__CameraShake_Layer)", - "GlobalVariable(__CameraShake_Camera)" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Save the amount of change to calculate drift", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_ZoomTravelled", - "-", - "round(1024 * GlobalVariable(__CameraShake_DisplacementZoom) * Variable(__CameraShake_PercentTimeElapsedThisFrame)) / 1024" - ] - } - ] - } - ] - } + "type": { + "value": "ButtonStates::ButtonColorTintTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "FocusedColorTint", + "" ] } - ], - "parameters": [] + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::IsPressed" + }, + "parameters": [ + "Object", + "ButtonFSM", + "" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "PressedColorTint", + "" + ] } ] } - ], - "parameters": [] + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade in", + "functionType": "Action", + "name": "FadeIn", + "private": true, + "sentence": "_PARAM0_ fade in to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectColorTween" + }, + "parameters": [ + "Object", + "Tween", + "\"__ButtonColorTintTween.Fade\"", + "Value", + "FadeInEasing", + "1000 * FadeInDuration", + "no", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "color" + } + ], + "objectGroups": [] + }, + { + "fullName": "Fade out", + "functionType": "Action", + "name": "FadeOut", + "private": true, + "sentence": "_PARAM0_ fade out to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::AddObjectColorTween" + }, + "parameters": [ + "Object", + "Tween", + "\"__ButtonColorTintTween.Fade\"", + "Value", + "FadeOutEasing", + "1000 * FadeOutDuration", + "no", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + }, + { + "description": "Value", + "name": "Value", + "type": "color" + } + ], + "objectGroups": [] + }, + { + "description": "the idle state color tint of the object.", + "fullName": "Idle state color tint", + "functionType": "ExpressionAndCondition", + "group": "Button color tint tween", + "name": "IdleColorTint", + "sentence": "the idle state color tint", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "IdleColorTint" + ] + } + ] + } + ], + "expressionType": { + "type": "color" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "IdleColorTint", + "name": "SetIdleColorTint", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyIdleColorTint" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the focused state color tint of the object. The state is Focused when the button is hovered or held outside.", + "fullName": "Focused state color tint", + "functionType": "ExpressionAndCondition", + "group": "Button color tint tween", + "name": "FocusedColorTint", + "sentence": "the focused state color tint", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "FocusedColorTint" + ] + } + ] + } + ], + "expressionType": { + "type": "color" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FocusedColorTint", + "name": "SetFocusedColorTint", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyFocusedColorTint" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the pressed state color tint of the object.", + "fullName": "Pressed state color tint", + "functionType": "ExpressionAndCondition", + "group": "Button color tint tween", + "name": "PressedColorTint", + "sentence": "the pressed state color tint", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "PressedColorTint" + ] + } + ] + } + ], + "expressionType": { + "type": "color" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "PressedColorTint", + "name": "SetPressedColorTint", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyPressedColorTint" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the fade-in duration of the object.", + "fullName": "Fade-in duration", + "functionType": "ExpressionAndCondition", + "group": "Button color tint tween", + "name": "FadeInDuration", + "sentence": "the fade-in duration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FadeInDuration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FadeInDuration", + "name": "SetFadeInDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyFadeInDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the fade-out duration of the object.", + "fullName": "Fade-out duration", + "functionType": "ExpressionAndCondition", + "group": "Button color tint tween", + "name": "FadeOutDuration", + "sentence": "the fade-out duration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FadeOutDuration" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FadeOutDuration", + "name": "SetFadeOutDuration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyFadeOutDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the fade-in easing of the object.", + "fullName": "Fade-in easing", + "functionType": "ExpressionAndCondition", + "group": "Button color tint tween", + "name": "FadeInEasing", + "sentence": "the fade-in easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "FadeInEasing" + ] + } + ] + } + ], + "expressionType": { + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FadeInEasing", + "name": "SetFadeInEasing", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyFadeInEasing" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" }, { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Stop shaking", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the fade-out easing of the object.", + "fullName": "Fade-out easing", + "functionType": "ExpressionAndCondition", + "group": "Button color tint tween", + "name": "FadeOutEasing", + "sentence": "the fade-out easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetReturnString" }, - "comment": "Stop shaking when the duration has been reached or if stop shaking has been requested", - "comment2": "" - }, + "parameters": [ + "FadeOutEasing" + ] + } + ] + } + ], + "expressionType": { + "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FadeOutEasing", + "name": "SetFadeOutEasing", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyFadeOutEasing" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Button states", + "description": "", + "group": "", + "extraInformation": [ + "ButtonStates::ButtonFSM" + ], + "name": "ButtonFSM" + }, + { + "value": "", + "type": "Behavior", + "label": "Tween", + "description": "", + "group": "", + "extraInformation": [ + "Tween::TweenBehavior" + ], + "name": "Tween" + }, + { + "value": "255;255;255", + "type": "Color", + "label": "Idle state color tint", + "description": "", + "group": "Color", + "extraInformation": [], + "name": "IdleColorTint" + }, + { + "value": "192;192;192", + "type": "Color", + "label": "Focused state color tint", + "description": "The state is Focused when the button is hovered or held outside.", + "group": "Color", + "extraInformation": [], + "name": "FocusedColorTint" + }, + { + "value": "64;64;64", + "type": "Color", + "label": "Pressed state color tint", + "description": "", + "group": "Color", + "extraInformation": [], + "name": "PressedColorTint" + }, + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Fade-in duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "name": "FadeInDuration" + }, + { + "value": "0.2", + "type": "Number", + "unit": "Second", + "label": "Fade-out duration", + "description": "", + "group": "Speed", + "extraInformation": [], + "name": "FadeOutDuration" + }, + { + "value": "easeInOutQuad", + "type": "Choice", + "label": "Fade-in easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "linear", + "easeInQuad", + "easeOutQuad", + "easeInOutQuad", + "easeInCubic", + "easeOutCubic", + "easeInOutCubic", + "easeInQuart", + "easeOutQuart", + "easeInOutQuart", + "easeInQuint", + "easeOutQuint", + "easeInOutQuint", + "easeInOutSine", + "easeInExpo", + "easeOutExpo", + "easeInOutExpo", + "easeInCirc", + "easeOutCirc", + "easeInOutCirc", + "easeOutBounce", + "easeInBack", + "easeOutBack", + "easeInOutBack", + "elastic", + "swingFromTo", + "swingFrom", + "swingTo", + "bounce", + "bouncePast", + "easeFromTo", + "easeFrom", + "easeTo" + ], + "name": "FadeInEasing" + }, + { + "value": "easeInOutQuad", + "type": "Choice", + "label": "Fade-out easing", + "description": "", + "group": "Speed", + "extraInformation": [ + "linear", + "easeInQuad", + "easeOutQuad", + "easeInOutQuad", + "easeInCubic", + "easeOutCubic", + "easeInOutCubic", + "easeInQuart", + "easeOutQuart", + "easeInOutQuart", + "easeInQuint", + "easeOutQuint", + "easeInOutQuint", + "easeInOutSine", + "easeInExpo", + "easeOutExpo", + "easeInOutExpo", + "easeInCirc", + "easeOutCirc", + "easeInOutCirc", + "easeOutBounce", + "easeInBack", + "easeOutBack", + "easeInOutBack", + "elastic", + "swingFromTo", + "swingFrom", + "swingTo", + "bounce", + "bouncePast", + "easeFromTo", + "easeFrom", + "easeTo" + ], + "name": "FadeOutEasing" + }, + { + "value": "Idle", + "type": "Choice", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "Idle", + "Focused", + "Pressed" + ], + "hidden": true, + "name": "PreviousState" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Input", + "extensionNamespace": "", + "fullName": "Screen Orientation Checker", + "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.0.2", + "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": [ + { + "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", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "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::Or" + "value": "BuiltinCommonInstructions::CompareNumbers" }, - "parameters": [], - "subInstructions": [ + "parameters": [ + "SceneWindowWidth()", + ">", + "SceneWindowHeight()" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "Timer" + "value": "StringVariable" }, "parameters": [ - "", - "GlobalVariable(__CameraShake_Duration)", - "\"__CameraShake_DurationTimer\"" + "TargetOrientation", + "=", + "\"portrait\"" ] - }, + } + ], + "actions": [ { "type": { - "value": "VarGlobal" + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" }, "parameters": [ - "__CameraShake_ShakeInProgress", - "=", - "-1" + "Object", + "yes" ] } ] }, { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "!=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] } - ], - "actions": [ + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "ModVarGlobal" + "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "__CameraShake_ShakeInProgress", - "=", - "0" + "SceneWindowWidth()", + "<=", + "SceneWindowHeight()" ] } ], + "actions": [], "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Correct for drift and reset drift tracking variables", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "StringVariable" }, - "comment": "Move to correct drift from previous shake", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerAngle", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "RotateCamera" - }, - "parameters": [ - "", - "-", - "GlobalVariable(__CameraShake_AngleTravelled)", - "GlobalVariableString(__CameraShake_Layer)", - "GlobalVariable(__CameraShake_Camera)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerZoom", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ZoomCamera" - }, - "parameters": [ - "", - "CameraZoom(GlobalVariableString(__CameraShake_Layer),GlobalVariable(__CameraShake_Camera)) - GlobalVariable(__CameraShake_ZoomTravelled)", - "GlobalVariableString(__CameraShake_Layer)", - "GlobalVariable(__CameraShake_Camera)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerX", - "!=", - "0" - ] - }, - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerY", - "!=", - "0" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "SetCameraX" - }, - "parameters": [ - "Object", - "-", - "GlobalVariable(__CameraShake_DisplacementTravelledX)", - "GlobalVariableString(__CameraShake_Layer)", - "GlobalVariable(__CameraShake_Camera)" - ] - }, - { - "type": { - "value": "SetCameraY" - }, - "parameters": [ - "Object", - "-", - "GlobalVariable(__CameraShake_DisplacementTravelledY)", - "GlobalVariableString(__CameraShake_Layer)", - "GlobalVariable(__CameraShake_Camera)" - ] - } + "parameters": [ + "TargetOrientation", + "=", + "\"landscape\"" ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Reset drift detection variables", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementTravelledX", - "=", - "0" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementTravelledY", - "=", - "0" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_AngleTravelled", - "=", - "0" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_ZoomTravelled", - "=", - "0" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_ShakeCounter", - "=", - "0" - ] - } + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "\"portrait\"" ] } ], - "parameters": [] + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + } + ] + } + ] + }, + { + "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": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsShown" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" + ] } ] } ], - "parameters": [] + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::FillColor" + }, + "parameters": [ + "BackgroundPainter", + "BackgroundColor" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::RoundedRectangle" + }, + "parameters": [ + "BackgroundPainter", + "Padding", + "Padding", + "Object.Width()-Padding", + "Object.Height()-Padding", + "CornerRadius" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsShown" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "inverted": true, + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" + ] + } + ], + "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": [] - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Check if camera is shaking.", - "fullName": "Check if camera is shaking", - "functionType": "Condition", - "name": "IsShaking", - "sentence": " Camera is shaking", - "events": [ + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + } + ], + "objectGroups": [] + }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "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", + "group": "Screen Orientation Checker configuration", + "name": "IsForceShown", + "sentence": "_PARAM0_ is forced to be shown", + "events": [ { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_ShakeInProgress", - "=", - "1" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } ] } ], - "actions": [ + "parameters": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "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", + "group": "Screen Orientation Checker configuration", + "name": "SetIsForceShown", + "sentence": "Force _PARAM0_ to be shown: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsForceShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsForceShown" + }, + "parameters": [ + "Object", + "yes" + ] + } ] } - ] + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + }, + { + "defaultValue": "yes", + "description": "Force show the screen?", + "name": "Value", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] } ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Stop shaking the camera.", - "fullName": "Stop shaking the camera", - "functionType": "Action", - "name": "StopShaking", - "sentence": "Stop shaking the camera", - "events": [ + "propertyDescriptors": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsShown" + }, + { + "value": "", + "type": "Boolean", + "label": "Force show the screen", + "description": "Use this to test the screen in your game", + "group": "", + "extraInformation": [], + "name": "IsForceShown" + }, + { + "value": "5", + "type": "Number", + "unit": "Pixel", + "label": "Padding", + "description": "", + "group": "Appearance", + "extraInformation": [], + "name": "Padding" + }, + { + "value": "10", + "type": "Number", + "unit": "Pixel", + "label": "Corner radius", + "description": "Corner radius for the background", + "group": "Appearance", + "extraInformation": [], + "name": "CornerRadius" + }, + { + "value": "0;0;0", + "type": "Color", + "label": "Background color", + "description": "", + "group": "Appearance", + "extraInformation": [], + "name": "BackgroundColor" + } + ], + "objects": [ + { + "assetStoreId": "", + "bold": true, + "italic": false, + "name": "Text", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ { - "type": { - "value": "CameraShake::IsShaking" - }, - "parameters": [ - "", - "" - ] + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 0, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" } ], - "actions": [ + "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, + "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": [ { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_ShakeInProgress", - "=", - "-1" + "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 + } + ] + ] + } + ] + } ] } ] } ], - "parameters": [], - "objectGroups": [] + "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": [] + } + ] } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [] + ] } ], - "externalLayouts": [], - "externalSourceFiles": [] + "externalLayouts": [] } \ No newline at end of file diff --git a/examples/multiplayer-platformer-arrow-fight/multiplayer-platformer-arrow-fight.json b/examples/multiplayer-platformer-arrow-fight/multiplayer-platformer-arrow-fight.json index 61345095d..7d303a1f1 100644 --- a/examples/multiplayer-platformer-arrow-fight/multiplayer-platformer-arrow-fight.json +++ b/examples/multiplayer-platformer-arrow-fight/multiplayer-platformer-arrow-fight.json @@ -1,9 +1,9 @@ { "firstLayout": "", "gdVersion": { - "build": 209, + "build": 221, "major": 5, - "minor": 4, + "minor": 5, "revision": 0 }, "properties": { @@ -18,7 +18,6 @@ "scaleMode": "linear", "sizeOnStartupMode": "", "templateSlug": "multiplayer-platformer-arrow-fight", - "useExternalSourceFiles": false, "version": "1.0.0", "name": "ArrowFight Multiplayer", "description": "A player vs player platformer game where up to 4 players or bots fire arrows at each other in order to be the last player left.\n\nControls:\n\nMove\n- Arrow keys\n- Left-stick of gamepad\n- D-pad on gamepad\n- Left virtual joystick (mobile)\n\nJump (and Double Jump)\n- Up arrow\n- Up on left-stick of gamepad\n- Up on D-pad of gamepad\n- Up on left virtual joystick (mobile)\n\nAiming\n- Left-Click and mouse cursor\n- Right-stick of gamepad\n- Right virtual joystick (mobile)\n\nFire arrow (while aiming):\n- Release left-click on mouse\n- Right-Bumper or Right-Trigger on gamepad\n- Release right virtual joystick (mobile)\n\nThis game example includes:\n-Multiplayer lobby\n-Platformer behavior\n-Screen wrap behavior\n-Sound effects\n-Resource bars\n-Forces", @@ -112,7 +111,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/CameraCenter.png", "kind": "image", "metadata": "{\"extension\":\".png\"}", @@ -121,7 +119,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Platform_JumpThrough.png", "kind": "image", "metadata": "", @@ -130,7 +127,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Idle1.png", "kind": "image", "metadata": "", @@ -139,7 +135,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Idle2.png", "kind": "image", "metadata": "", @@ -148,7 +143,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Idle3.png", "kind": "image", "metadata": "", @@ -157,7 +151,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Idle4.png", "kind": "image", "metadata": "", @@ -166,7 +159,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Arrow_Spinning_1.png", "kind": "image", "metadata": "", @@ -179,7 +171,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Arrow_Spinning_2.png", "kind": "image", "metadata": "", @@ -188,7 +179,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Arrow_symbol.png", "kind": "image", "metadata": "", @@ -197,7 +187,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Arrow_symbol_Background.png", "kind": "image", "metadata": "", @@ -206,7 +195,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Roll3.png", "kind": "image", "metadata": "", @@ -215,7 +203,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Roll4.png", "kind": "image", "metadata": "", @@ -224,7 +211,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Roll5.png", "kind": "image", "metadata": "", @@ -233,7 +219,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Roll6.png", "kind": "image", "metadata": "", @@ -242,7 +227,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Roll7.png", "kind": "image", "metadata": "", @@ -251,7 +235,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Roll8.png", "kind": "image", "metadata": "", @@ -260,7 +243,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run1.png", "kind": "image", "metadata": "", @@ -269,7 +251,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run2.png", "kind": "image", "metadata": "", @@ -278,7 +259,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Run3.png", "kind": "image", "metadata": "", @@ -287,7 +267,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Run4.png", "kind": "image", "metadata": "", @@ -296,7 +275,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run5.png", "kind": "image", "metadata": "", @@ -305,7 +283,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Run6.png", "kind": "image", "metadata": "", @@ -314,7 +291,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run7.png", "kind": "image", "metadata": "", @@ -323,7 +299,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run8.png", "kind": "image", "metadata": "", @@ -332,7 +307,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run9.png", "kind": "image", "metadata": "", @@ -341,7 +315,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run10.png", "kind": "image", "metadata": "", @@ -350,7 +323,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run11.png", "kind": "image", "metadata": "", @@ -359,7 +331,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run12.png", "kind": "image", "metadata": "", @@ -368,7 +339,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run13.png", "kind": "image", "metadata": "", @@ -377,7 +347,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run14.png", "kind": "image", "metadata": "", @@ -386,7 +355,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Run15.png", "kind": "image", "metadata": "", @@ -395,7 +363,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run16.png", "kind": "image", "metadata": "", @@ -404,7 +371,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Death1.png", "kind": "image", "metadata": "", @@ -413,7 +379,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Death2.png", "kind": "image", "metadata": "", @@ -422,7 +387,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Death3.png", "kind": "image", "metadata": "", @@ -431,7 +395,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Death4.png", "kind": "image", "metadata": "", @@ -480,7 +443,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Medieval Button Beige_Hovered.png", "kind": "image", "metadata": "", @@ -493,7 +455,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Medieval Button Beige_Idle.png", "kind": "image", "metadata": "", @@ -506,7 +467,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Medieval Button Beige_Pressed.png", "kind": "image", "metadata": "", @@ -519,7 +479,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Transparent light joystick border.png", "kind": "image", "metadata": "", @@ -532,7 +491,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Transparent light joystick thumb.png", "kind": "image", "metadata": "", @@ -545,7 +503,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Platform_Stone_Big.png", "kind": "image", "metadata": "", @@ -554,7 +511,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/GreenPlayer_Menu.png", "kind": "image", "metadata": "", @@ -563,7 +519,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/RedPlayer_Menu.png", "kind": "image", "metadata": "", @@ -572,7 +527,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Title.png", "kind": "image", "metadata": "", @@ -581,7 +535,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Floating Out Button Dark Blue_Idle.png", "kind": "image", "metadata": "", @@ -590,7 +543,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Floating Out Button Dark Blue_Hovered.png", "kind": "image", "metadata": "", @@ -599,7 +551,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Floating Out Button Dark Blue_Pressed.png", "kind": "image", "metadata": "", @@ -608,7 +559,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/thumbnail.png", "kind": "image", "metadata": "", @@ -617,7 +567,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/world_tileset.png", "kind": "image", "metadata": "", @@ -909,6 +858,7 @@ "text": "Join Lobby", "font": "CantoraOne-Regular.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 60, "color": "255;255;255" } @@ -962,6 +912,7 @@ "text": "Be the last archer standing", "font": "CantoraOne-Regular.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 30, "color": "255;255;255" } @@ -1394,7 +1345,7 @@ "gridColor": 10401023, "gridAlpha": 0.8, "snap": true, - "zoomFactor": 1.6337626779315204, + "zoomFactor": 0.5843784410741002, "windowMask": false }, "objectsGroups": [ @@ -1808,25 +1759,6 @@ } ], "objects": [ - { - "assetStoreId": "", - "height": 16, - "name": "Tile", - "texture": "Platform_Stone2.png", - "type": "TiledSpriteObject::TiledSprite", - "width": 16, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Platform", - "type": "PlatformBehavior::PlatformBehavior", - "canBeGrabbed": false, - "platformType": "NormalPlatform", - "yGrabOffset": 0 - } - ] - }, { "adaptCollisionMaskAutomatically": true, "assetStoreId": "", @@ -3587,6 +3519,7 @@ "text": "Leave Game", "font": "CantoraOne-Regular.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 40, "color": "133;99;64" } @@ -3645,6 +3578,7 @@ "text": "Paused", "font": "CantoraOne-Regular.ttf", "textAlignment": "right", + "verticalTextAlignment": "top", "characterSize": 80, "color": "255;255;255" } @@ -3710,6 +3644,7 @@ "text": "P1: ", "font": "CantoraOne-Regular.ttf", "textAlignment": "left", + "verticalTextAlignment": "top", "characterSize": 30, "color": "255;255;255" } @@ -3758,6 +3693,7 @@ "text": "Press P to pause", "font": "CantoraOne-Regular.ttf", "textAlignment": "left", + "verticalTextAlignment": "top", "characterSize": 30, "color": "255;255;255" } @@ -5295,9 +5231,6 @@ { "objectName": "JumpThrough" }, - { - "objectName": "Tile" - }, { "objectName": "LevelTiles" } @@ -5406,29 +5339,6 @@ } ], "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "SystemInfo::IsMobile" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "Delete" - }, - "parameters": [ - "MobileControls", - "" - ] - } - ] - }, { "colorB": 228, "colorG": 176, @@ -5708,18 +5618,138 @@ } ], "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SystemInfo::IsMobile" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "MobileControls", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "MovementJoystick" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "AimingJoystick" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "MovementJoystick", + "", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "AimingJoystick", + "", + "" + ] + } + ] + } + ] } ] } ], "parameters": [] }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "MovementJoystick", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "MovementJoystick", + "CursorX(\"UI\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "AimingJoystick", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "AimingJoystick", + "CursorX(\"UI\")" + ] + } + ] + }, { "colorB": 228, "colorG": 176, "colorR": 74, "creationTime": 0, - "folded": true, "name": "Controls", "source": "", "type": "BuiltinCommonInstructions::Group", @@ -5753,11 +5783,11 @@ "conditions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "w" + "\"w\"" ] } ], @@ -5778,11 +5808,11 @@ "conditions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "a" + "\"a\"" ] } ], @@ -5803,11 +5833,11 @@ "conditions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "s" + "\"s\"" ] } ], @@ -5828,11 +5858,11 @@ "conditions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "d" + "\"d\"" ] } ], @@ -5871,11 +5901,11 @@ "subInstructions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "Up" + "\"Up\"" ] }, { @@ -5913,11 +5943,11 @@ }, { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "w" + "\"w\"" ] } ] @@ -6014,11 +6044,11 @@ "conditions": [ { "type": { - "value": "MouseButtonPressed" + "value": "MouseButtonFromTextPressed" }, "parameters": [ "", - "Left" + "\"Left\"" ] } ], @@ -6052,11 +6082,11 @@ "conditions": [ { "type": { - "value": "MouseButtonReleased" + "value": "MouseButtonFromTextReleased" }, "parameters": [ "", - "Left" + "\"Left\"" ] } ], @@ -7441,11 +7471,11 @@ "conditions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "p" + "\"p\"" ] }, { @@ -8028,7 +8058,7 @@ "name": "BehaviorRemapper", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/alpha-w-box-outline.svg", "shortDescription": "Quickly remap Behavior controls to different keys. ", - "version": "1.0.0", + "version": "1.0.1", "description": [ "Make sure to disable default controls unless you want two keys to do the same action.", "", @@ -8107,7 +8137,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyUp()" + "Up" ] } ], @@ -8132,7 +8162,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyLeft()" + "Left" ] } ], @@ -8157,7 +8187,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyRight()" + "Right" ] } ], @@ -8182,7 +8212,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyDown()" + "Down" ] } ], @@ -8240,7 +8270,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"up\")" + "up" ] }, { @@ -8251,7 +8281,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"left\")" + "left" ] }, { @@ -8262,7 +8292,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"right\")" + "right" ] }, { @@ -8273,7 +8303,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"down\")" + "down" ] } ] @@ -8341,7 +8371,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"WASD\"" ] @@ -8414,7 +8444,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"ZQSD\"" ] @@ -8487,7 +8517,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"Numpad\"" ] @@ -8560,7 +8590,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"IJKL\"" ] @@ -8708,7 +8738,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyUp()" + "Up" ] } ], @@ -8742,7 +8772,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyLeft()" + "Left" ] } ], @@ -8767,7 +8797,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyRight()" + "Right" ] } ], @@ -8792,7 +8822,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyDown()" + "Down" ] } ], @@ -8826,7 +8856,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyJump()" + "Jump" ] } ], @@ -8884,7 +8914,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"up\")" + "up" ] }, { @@ -8895,7 +8925,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"left\")" + "left" ] }, { @@ -8906,7 +8936,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"right\")" + "right" ] }, { @@ -8917,7 +8947,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"down\")" + "down" ] }, { @@ -8928,7 +8958,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"jump\")" + "jump" ] } ] @@ -9001,7 +9031,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"WASD\"" ] @@ -9085,7 +9115,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"ZQSD\"" ] @@ -9169,7 +9199,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"Numpad\"" ] @@ -9253,7 +9283,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"IJKL\"" ] @@ -9413,7 +9443,7 @@ "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.2.2", + "version": "1.6.1", "description": [ "Multitouch joysticks can be used the same way as physical gamepads:", "- 4 or 8 directions", @@ -9448,8 +9478,458 @@ ], "dependencies": [], "globalVariables": [], - "sceneVariables": [], + "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": [ + { + "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": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"TargetedSpeed\"", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(0, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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 is pressed on a gamepad.", "fullName": "Multitouch controller button pressed", @@ -9462,10 +9942,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Pressed\"" ] @@ -9510,10 +9990,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Released\"" ] @@ -9560,12 +10040,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", - "GetArgumentAsString(\"ButtonState\")" + "ButtonState" ] } ] @@ -9605,12 +10085,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", "=", - "GetArgumentAsNumber(\"DeadZoneRadius\")" + "DeadZoneRadius" ] } ] @@ -9653,7 +10133,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone" ] } ] @@ -9693,7 +10173,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 4 / 360), 4)" + "mod(round(Angle * 4 / 360), 4)" ] } ] @@ -9728,7 +10208,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 8 / 360), 8)" + "mod(round(Angle * 8 / 360), 8)" ] } ] @@ -9762,7 +10242,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -9775,7 +10255,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9799,7 +10279,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -9812,7 +10292,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9836,7 +10316,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -9849,7 +10329,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9873,7 +10353,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -9886,7 +10366,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9934,7 +10414,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -9947,7 +10427,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9971,7 +10451,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownRight\"" ] @@ -9984,7 +10464,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10008,7 +10488,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -10021,7 +10501,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10045,7 +10525,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownLeft\"" ] @@ -10058,7 +10538,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10082,7 +10562,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -10095,7 +10575,7 @@ "", "=", "4", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10119,7 +10599,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpLeft\"" ] @@ -10132,7 +10612,7 @@ "", "=", "5", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10156,7 +10636,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -10169,7 +10649,7 @@ "", "=", "6", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10193,7 +10673,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpRight\"" ] @@ -10206,7 +10686,7 @@ "", "=", "7", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10267,9 +10747,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -10279,8 +10759,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -10347,9 +10827,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -10359,8 +10839,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -10415,7 +10895,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -10435,6 +10915,11 @@ "name": "JoystickIdentifier", "supplementaryInformation": "[\"Primary\",\"Secondary\"]", "type": "stringWithSelector" + }, + { + "description": "", + "name": "Coucou", + "type": "expression" } ], "objectGroups": [] @@ -10455,7 +10940,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Force)" + "max(0, Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier)) / (1 - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -10493,12 +10978,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Force", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -10540,7 +11025,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -10580,7 +11065,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle" ] } ] @@ -10618,12 +11103,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -10664,7 +11149,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::JoystickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\")) * cos(ToRad(SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))))" + "XFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -10704,7 +11189,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::JoystickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\")) * sin(ToRad(SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))))" + "YFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -10727,6 +11212,123 @@ } ], "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": "CompareArgumentAsString" + }, + "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": "CompareArgumentAsString" + }, + "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": [ @@ -10753,9 +11355,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyDeadZoneRadius()", + "ControllerIdentifier", + "JoystickIdentifier", + "DeadZoneRadius", "" ] }, @@ -10917,8 +11519,8 @@ }, "parameters": [ "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)" + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)" ] } ], @@ -10931,7 +11533,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] } ] @@ -10978,7 +11580,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -11030,8 +11632,8 @@ "parameters": [ "Object", "Behavior", - "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))", - "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))" + "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))" ] }, { @@ -11042,7 +11644,7 @@ "Object", "Behavior", "=", - "clamp(2 * DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)) / Object.Width(), 0, 1)", + "clamp(2 * DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(TouchId, Object.Layer(), 0), TouchY(TouchId, Object.Layer(), 0)) / Object.Width(), 0, 1)", "" ] } @@ -11083,7 +11685,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickForce()" + "max(0, JoystickForce - DeadZoneRadius) / (1 - DeadZoneRadius)" ] } ] @@ -11127,7 +11729,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -11136,9 +11738,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickForce()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickForce", "" ] } @@ -11156,6 +11758,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "", + "name": "Parameter", + "type": "objectList" } ], "objectGroups": [] @@ -11176,7 +11783,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickAngle()" + "JoystickAngle" ] } ] @@ -11220,7 +11827,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -11229,9 +11836,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickAngle()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickAngle", "" ] } @@ -11350,13 +11957,14 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyJoystickForce" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" }, "parameters": [ "Object", "Behavior", ">", - "Object.Behavior::PropertyDeadZoneRadius()" + "0", + "" ] }, { @@ -11365,8 +11973,8 @@ }, "parameters": [ "", - "Object.Behavior::JoystickAngle()", - "GetArgumentAsString(\"Direction\")", + "JoystickAngle", + "Direction", "" ] } @@ -11416,13 +12024,14 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyJoystickForce" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" }, "parameters": [ "Object", "Behavior", ">", - "Object.Behavior::PropertyDeadZoneRadius()" + "0", + "" ] }, { @@ -11431,8 +12040,8 @@ }, "parameters": [ "", - "Object.Behavior::JoystickAngle()", - "GetArgumentAsString(\"Direction\")", + "JoystickAngle", + "Direction", "" ] } @@ -11589,7 +12198,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyControllerIdentifier()" + "ControllerIdentifier" ] } ] @@ -11632,7 +12241,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -11670,7 +12279,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyJoystickIdentifier()" + "JoystickIdentifier" ] } ] @@ -11713,7 +12322,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -11751,7 +12360,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDeadZoneRadius()" + "DeadZoneRadius" ] } ] @@ -11794,7 +12403,59 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "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": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -11811,6 +12472,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "Touch identifier", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -11985,12 +12651,31 @@ "conditions": [ { "type": { - "value": "CollisionPoint" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)" + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer())", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer())" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyRadius" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer()), TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer()))" + ] + } ] } ], @@ -12003,7 +12688,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] }, { @@ -12059,7 +12744,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -12227,9 +12912,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyButtonIdentifier()", - "GetArgumentAsString(\"ButtonState\")", + "ControllerIdentifier", + "ButtonIdentifier", + "ButtonState", "" ] } @@ -12306,6 +12991,16 @@ "extraInformation": [], "hidden": true, "name": "IsReleased" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Triggering circle radius", + "description": "This circle adds up to the object collision mask.", + "group": "", + "extraInformation": [], + "name": "Radius" } ], "sharedPropertyDescriptors": [] @@ -12331,8 +13026,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -12359,8 +13054,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -12387,8 +13082,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -12424,8 +13119,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -12452,8 +13147,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJumpButton()", + "ControllerIdentifier", + "JumpButton", "\"Down\"" ] } @@ -12533,9 +13228,9 @@ "sharedPropertyDescriptors": [] }, { - "description": "Control a top-down character with a multitouch controller.", - "fullName": "Top-down multitouch controller mapper", - "name": "TopDownMultitouchMapper", + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D platformer multitouch controller mapper", + "name": "Platformer3DMultitouchMapper", "objectType": "", "eventsFunctions": [ { @@ -12549,55 +13244,171 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "value": "SpriteMultitouchJoystick::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "JoystickIdentifier", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SetForwardAngle" }, "parameters": [ "Object", - "Behavior", + "PhysicsCharacter3D", "=", - "\"Analog\"" + "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": "TopDownMovementBehavior::SimulateStick" + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" }, "parameters": [ "Object", - "TopDownMovement", - "SpriteMultitouchJoystick::StickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", - "SpriteMultitouchJoystick::StickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())" + "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", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D shooter multitouch controller mapper", + "name": "Shooter3DMultitouchMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "value": "SpriteMultitouchJoystick::StickForce" }, "parameters": [ - "Object", - "Behavior", - "=", - "\"360°\"" + "", + ">", + "0", + "ControllerIdentifier", + "JoystickIdentifier", + "" ] } ], "actions": [ { "type": { - "value": "TopDownMovementBehavior::SimulateStick" + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" }, "parameters": [ "Object", - "TopDownMovement", - "SpriteMultitouchJoystick::StickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", - "sign(SpriteMultitouchJoystick::StickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier()))" + "PhysicsCharacter3D", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -12607,600 +13418,270 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "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", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control camera rotations with a multitouch controller.", + "fullName": "First person camera multitouch controller mapper", + "name": "FirstPersonMultitouchMapper", + "objectType": "", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyCurrentRotationSpeedZ" }, "parameters": [ "Object", "Behavior", "=", - "\"8 Directions\"" + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedZ, SpriteMultitouchJoystick::StickForceX(ControllerIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "CurrentRotationSpeedZ * TimeDelta()" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyCurrentRotationSpeedY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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", + "" ] } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "TopDownMovementBehavior::DiagonalsAllowed" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "TopDownMovementBehavior::DiagonalsAllowed" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"UpLeft\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"UpRight\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"DownLeft\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"DownRight\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - }, - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "Top-down movement behavior", - "description": "", - "group": "", - "extraInformation": [ - "TopDownMovementBehavior::TopDownMovementBehavior" - ], - "name": "TopDownMovement" - }, - { - "value": "1", - "type": "Number", - "label": "Controller identifier (1, 2, 3, 4...)", - "description": "", - "group": "", - "extraInformation": [], - "name": "ControllerIdentifier" - }, - { - "value": "Primary", - "type": "Choice", - "label": "Joystick name", - "description": "", - "group": "", - "extraInformation": [ - "Primary", - "Secondary" - ], - "name": "JoystickIdentifier" - }, - { - "value": "Analog", - "type": "Choice", - "label": "Stick mode", - "description": "", - "group": "Controls", - "extraInformation": [ - "Analog", - "360°", - "8 Directions" - ], - "name": "StickMode" - } - ], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [ - { - "areaMaxX": 64, - "areaMaxY": 64, - "areaMaxZ": 64, - "areaMinX": 0, - "areaMinY": 0, - "areaMinZ": 0, - "defaultName": "Joystick", - "description": "Joystick for touchscreens.", - "fullName": "Multitouch Joystick", - "name": "SpriteMultitouchJoystick", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + ] + } + ], + "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": "Create" + "value": "CentreCamera" }, "parameters": [ "", - "Border", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "Create" - }, - "parameters": [ + "Object", "", - "Thumb", - "0", - "0", + "Object.Layer()", "" ] }, { "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Border", - "=", - "1" - ] - }, - { - "type": { - "value": "ChangePlan" + "value": "Scene3D::SetCameraZ" }, "parameters": [ - "Thumb", + "", "=", - "2" + "Object.Object3D::Z() + Object.Object3D::Depth() + OffsetZ", + "", + "" ] }, { "type": { - "value": "SetCenter" + "value": "Scene3D::SetCameraRotationX" }, "parameters": [ - "Border", - "=", - "0", + "", "=", - "0" + "- Object.Object3D::RotationY() + 90", + "GetArgumentAsString(\"Layer\")", + "" ] }, { "type": { - "value": "SetCenter" + "value": "Scene3D::SetCameraRotationY" }, "parameters": [ - "Thumb", - "=", - "0", + "", "=", - "0" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" - }, - "parameters": [ - "Object", + "Object.Object3D::RotationX()", + "GetArgumentAsString(\"Layer\")", "" ] }, { "type": { - "value": "SetIncludedInParentCollisionMask" + "value": "SetCameraAngle" }, "parameters": [ - "Thumb", + "", + "=", + "Object.Angle() + 90", + "Object.Layer()", "" ] } @@ -13211,17 +13692,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", + "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", @@ -13229,32 +13717,38 @@ "actions": [ { "type": { - "value": "MettreAutour" + "value": "SetReturnNumber" }, "parameters": [ - "Thumb", - "Border", - "Border.MultitouchJoystick::JoystickForce() * Border.Width() / 2", - "Border.MultitouchJoystick::JoystickAngle()" + "HorizontalRotationSpeedMax" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { "fullName": "", - "functionType": "Action", - "name": "onHotReloading", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationSpeedMax", + "name": "SetHorizontalRotationSpeedMax", "sentence": "", "events": [ { @@ -13263,72 +13757,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationSpeedMax" }, "parameters": [ "Object", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Pass the object property values to the behavior.", - "fullName": "Update configuration", - "functionType": "Action", - "name": "UpdateConfiguration", - "private": true, - "sentence": "Update the configuration of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "=", - "Object.PropertyControllerIdentifier()", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "=", - "Object.PropertyJoystickIdentifier()", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" - }, - "parameters": [ - "Border", - "MultitouchJoystick", + "Behavior", "=", - "Object.PropertyDeadZoneRadius()", - "" + "Value" ] } ] @@ -13338,114 +13773,78 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "De/activate control of the joystick.", - "fullName": "De/activate control", - "functionType": "Action", - "name": "ActivateControl", - "sentence": "Activate control of _PARAM0_: _PARAM1_", + "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": [ - { - "type": { - "inverted": true, - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"ShouldActivate\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "no" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"ShouldActivate\"" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "ActivateBehavior" + "value": "SetReturnNumber" }, "parameters": [ - "Border", - "MultitouchJoystick", - "yes" + "HorizontalRotationAcceleration" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Activate", - "name": "ShouldActivate", - "type": "yesorno" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if a stick is pressed.", - "fullName": "Stick pressed", - "functionType": "Condition", - "name": "IsPressed", - "sentence": "Stick _PARAM0_ is pressed", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationAcceleration", + "name": "SetHorizontalRotationAcceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsPressed" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "!=" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationAcceleration" }, "parameters": [ - "True" + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -13455,19 +13854,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the joystick force (from 0 to 1).", - "fullName": "Joystick force (deprecated)", + "description": "the horizontal rotation deceleration of the object.", + "fullName": "Horizontal rotation deceleration", "functionType": "ExpressionAndCondition", - "name": "JoystickForce", - "private": true, - "sentence": "the joystick force", + "group": "First person camera multitouch controller mapper horizontal rotation configuration", + "name": "HorizontalRotationDeceleration", + "sentence": "the horizontal rotation deceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -13478,7 +13882,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::JoystickForce()" + "HorizontalRotationDeceleration" ] } ] @@ -13491,18 +13895,23 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the strick force (from 0 to 1).", - "fullName": "Stick force", - "functionType": "ExpressionAndCondition", - "name": "StickForce", - "sentence": "the stick force", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationDeceleration", + "name": "SetHorizontalRotationDeceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -13510,34 +13919,40 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationDeceleration" }, "parameters": [ - "Border.MultitouchJoystick::JoystickForce()" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the stick force on X axis (from -1 at the left to 1 at the right).", - "fullName": "Stick X force", + "description": "the maximum vertical rotation speed of the object.", + "fullName": "Maximum vertical rotation speed", "functionType": "ExpressionAndCondition", - "name": "StickForceX", - "sentence": "the stick X force", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalRotationSpeedMax", + "sentence": "the maximum vertical rotation speed", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -13548,7 +13963,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::StickForceX()" + "VerticalRotationSpeedMax" ] } ] @@ -13561,18 +13976,23 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "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", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationSpeedMax", + "name": "SetVerticalRotationSpeedMax", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -13580,35 +14000,40 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationSpeedMax" }, "parameters": [ - "Border.MultitouchJoystick::StickForceY()" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "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": "", + "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", @@ -13619,7 +14044,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::JoystickAngle()" + "VerticalRotationAcceleration" ] } ] @@ -13632,17 +14057,22 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Return the angle the stick is pointing towards (from -180 to 180).", - "fullName": "Stick angle", - "functionType": "Expression", - "name": "StickAngle", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationAcceleration", + "name": "SetVerticalRotationAcceleration", "sentence": "", "events": [ { @@ -13651,107 +14081,94 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationAcceleration" }, "parameters": [ - "Border.MultitouchJoystick::JoystickAngle()" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "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 _PARAM1_", + "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": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "GetArgumentAsString(\"Direction\")", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "VerticalRotationDeceleration" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", - "type": "stringWithSelector" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "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_", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationDeceleration", + "name": "SetVerticalRotationDeceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "GetArgumentAsString(\"Direction\")", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationDeceleration" }, "parameters": [ - "True" + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -13761,25 +14178,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", - "type": "stringWithSelector" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the multitouch controller identifier (1, 2, 3, 4...).", - "fullName": "Multitouch controller identifier", + "description": "the minimum vertical camera angle of the object.", + "fullName": "Minimum vertical camera angle", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "ControllerIdentifier", - "sentence": "the multitouch controller identifier", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalAngleMin", + "sentence": "the minimum vertical camera angle", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -13790,7 +14206,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyControllerIdentifier()" + "VerticalAngleMin" ] } ] @@ -13803,8 +14219,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -13812,8 +14233,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "ControllerIdentifier", - "name": "SetControllerIdentifier", + "getterName": "VerticalAngleMin", + "name": "SetVerticalAngleMin", "sentence": "", "events": [ { @@ -13822,14 +14243,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMin" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "Value" ] } ] @@ -13839,19 +14259,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the joystick name of the object.", - "fullName": "Joystick name", + "description": "the maximum vertical camera angle of the object.", + "fullName": "Maximum vertical camera angle", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "JoystickIdentifier", - "sentence": "the joystick name", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalAngleMax", + "sentence": "the maximum vertical camera angle", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -13859,24 +14284,29 @@ "actions": [ { "type": { - "value": "SetReturnString" + "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyJoystickIdentifier()" + "VerticalAngleMax" ] } ] } ], "expressionType": { - "type": "string" + "type": "expression" }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -13884,8 +14314,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "JoystickIdentifier", - "name": "SetJoystickIdentifier", + "getterName": "VerticalAngleMax", + "name": "SetVerticalAngleMax", "sentence": "", "events": [ { @@ -13894,14 +14324,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMax" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsString(\"Value\")", - "" + "Value" ] } ] @@ -13911,19 +14340,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "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", + "description": "the z position offset of the object.", + "fullName": "Z position offset", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "DeadZoneRadius", - "sentence": "the dead zone radius", + "group": "First person camera multitouch controller mapper position configuration", + "name": "OffsetZ", + "sentence": "the z position offset", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -13934,7 +14368,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyDeadZoneRadius()" + "OffsetZ" ] } ] @@ -13947,8 +14381,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -13956,8 +14395,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "DeadZoneRadius", - "name": "SetDeadZoneRadius", + "getterName": "OffsetZ", + "name": "SetOffsetZ", "sentence": "", "events": [ { @@ -13966,14 +14405,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyOffsetZ" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "Value" ] } ] @@ -13983,3008 +14421,7151 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] } ], "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "description": "", + "group": "", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "name": "Object3D" + }, { "value": "1", "type": "Number", - "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "label": "Controller identifier (1, 2, 3, 4...)", "description": "", "group": "", "extraInformation": [], "name": "ControllerIdentifier" }, { - "value": "Primary", + "value": "Secondary", "type": "Choice", - "label": "Joystick name", + "label": "Camera joystick", "description": "", - "group": "", + "group": "Controls", "extraInformation": [ "Primary", "Secondary" ], - "name": "JoystickIdentifier" + "name": "CameraStick" }, { - "value": "0.4", + "value": "180", "type": "Number", - "label": "Dead zone radius (range: 0 to 1)", - "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", - "group": "", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Horizontal rotation", "extraInformation": [], - "name": "DeadZoneRadius" + "name": "HorizontalRotationSpeedMax" }, { - "value": "Center-center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [ - "Thumb" - ], - "hidden": true, - "name": "ThumbAnchorOrigin" + "value": "360", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationAcceleration" }, { - "value": "Center-center", + "value": "720", "type": "Number", - "label": "", - "description": "Only used by the scene editor.", - "group": "", + "label": "Rotation deceleration", + "description": "", + "group": "Horizontal rotation", "extraInformation": [], - "hidden": true, - "name": "ThumbAnchorTarget" + "name": "HorizontalRotationDeceleration" }, { - "value": "true", - "type": "Boolean", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [ - "Thumb" - ], - "hidden": true, - "name": "ThumbIsScaledProportionally" + "value": "120", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationSpeedMax" }, { - "value": "Center-center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "group": "", + "value": "240", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Vertical rotation", "extraInformation": [], - "hidden": true, - "name": "ParentOrigin" - } - ], - "objects": [ + "name": "VerticalRotationAcceleration" + }, { - "adaptCollisionMaskAutomatically": false, - "assetStoreId": "", - "name": "Thumb", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [], - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [] - } - ] - } - ] + "value": "480", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationDeceleration" }, { - "adaptCollisionMaskAutomatically": false, - "assetStoreId": "", - "name": "Border", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "MultitouchJoystick", - "type": "SpriteMultitouchJoystick::MultitouchJoystick", - "ControllerIdentifier": 1, - "JoystickIdentifier": "Primary", - "FloatingEnabled": false, - "DeadZoneRadius": 0.4, - "JoystickAngle": 0, - "JoystickForce": 0, - "TouchId": 0, - "TouchIndex": 0 - } - ], - "animations": [ - { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [] - } - ] - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Thumb" - }, - { - "objectName": "Border" - } - ] - }, - "objectsGroups": [], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [] - } - ] - }, - { - "author": "Bouh", - "category": "Input", - "extensionNamespace": "", - "fullName": "Gamepads (controllers)", - "helpPath": "/all-features/gamepad", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWdhbWVwYWQtdmFyaWFudC1vdXRsaW5lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTYsOUg4VjExSDEwVjEzSDhWMTVINlYxM0g0VjExSDZWOU0xOC41LDlBMS41LDEuNSAwIDAsMSAyMCwxMC41QTEuNSwxLjUgMCAwLDEgMTguNSwxMkExLjUsMS41IDAgMCwxIDE3LDEwLjVBMS41LDEuNSAwIDAsMSAxOC41LDlNMTUuNSwxMkExLjUsMS41IDAgMCwxIDE3LDEzLjVBMS41LDEuNSAwIDAsMSAxNS41LDE1QTEuNSwxLjUgMCAwLDEgMTQsMTMuNUExLjUsMS41IDAgMCwxIDE1LjUsMTJNMTcsNUE3LDcgMCAwLDEgMjQsMTJBNyw3IDAgMCwxIDE3LDE5QzE1LjA0LDE5IDEzLjI3LDE4LjIgMTIsMTYuOUMxMC43MywxOC4yIDguOTYsMTkgNywxOUE3LDcgMCAwLDEgMCwxMkE3LDcgMCAwLDEgNyw1SDE3TTcsN0E1LDUgMCAwLDAgMiwxMkE1LDUgMCAwLDAgNywxN0M4LjY0LDE3IDEwLjA5LDE2LjIxIDExLDE1SDEzQzEzLjkxLDE2LjIxIDE1LjM2LDE3IDE3LDE3QTUsNSAwIDAsMCAyMiwxMkE1LDUgMCAwLDAgMTcsN0g3WiIgLz48L3N2Zz4=", - "name": "Gamepads", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/gamepad-variant-outline.svg", - "shortDescription": "Add support for gamepads (or other controllers) to your game, giving access to information such as button presses, axis positions, trigger pressure, etc...", - "version": "0.6.1", - "description": [ - "Add support for gamepads (or other controllers).", - "", - "It gives access to:", - "- button presses", - "- axis positions and force", - "- trigger pressure", - "- configurable deadzone", - "- vibration", - "- automatic mappers for platformer characters and top-down movement", - "", - "The Bomberman-like example handles 4 players with gamepads ([open the project online](https://editor.gdevelop.io/?project=example://goose-bomberman))." - ], - "origin": { - "identifier": "Gamepads", - "name": "gdevelop-extension-store" - }, - "tags": [ - "controllers", - "gamepads", - "joysticks", - "axis", - "xbox", - "ps4", - "platformer", - "platform", - "top-down" - ], - "authorIds": [ - "2OwwM8ToR9dx9RJ2sAKTcrLmCB92", - "taRwmWxwAFYFL9yyBwB3cwBw0BO2", - "mnImQKdn8nQxwzkS5D6a1JB27V23" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Get the value of the pressure on a gamepad trigger.", - "fullName": "Pressure on a gamepad trigger", - "functionType": "Expression", - "name": "TriggerPressure", - "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const trigger = eventsFunctionContext.getArgument(\"trigger\").toUpperCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in expression: \"Pressure on a gamepad trigger\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "if (trigger != \"LT\" && trigger != \"RT\" && trigger != \"L2\" && trigger != \"R2\") {\r", - " console.error('Parameter trigger is not valid in expression: \"Pressure on a gamepad trigger\"');\r", - " return;\r", - "}\r", - "\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "switch (trigger) {\r", - " case 'LT':\r", - " case 'L2':\r", - " eventsFunctionContext.returnValue = gamepad.buttons[6].value;\r", - " break;\r", - "\r", - " case 'RT':\r", - " case 'R2':\r", - " eventsFunctionContext.returnValue = gamepad.buttons[7].value;\r", - " break;\r", - "\r", - " default:\r", - " eventsFunctionContext.returnValue = -1;\r", - " break;\r", - "}" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Minimum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMin" }, { - "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": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", - "\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick force\"');\r", - " return;\r", - "}\r", - "\r", - "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a stick force\"');\r", - " return;\r", - "}\r", - "\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "\r", - "switch (stick) {\r", - " case 'LEFT':\r", - " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId)), 0, 1);\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId)), 0, 1);\r", - " break;\r", - "\r", - " default:\r", - " eventsFunctionContext.returnValue = -1;\r", - " break;\r", - "}" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Maximum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMax" }, { - "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(GetArgumentAsNumber(\"player_ID\"), GetArgumentAsString(\"stick\"))" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z position offset", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "OffsetZ" }, { - "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": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", - "\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick rotation\"');\r", - " return;\r", - "}\r", - "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a stick rotation\"');\r", - " return;\r", - "}\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "switch (stick) {\r", - " case 'LEFT':\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId));\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId));\r", - " break;\r", - "\r", - " default:\r", - " eventsFunctionContext.returnValue = -1;\r", - " break;\r", - "}" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Z", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedZ" }, { - "description": "Stick: \"Left\" or \"Right\"", - "name": "stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Y", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedY" } ], - "objectGroups": [] + "sharedPropertyDescriptors": [] }, { - "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": [ + "description": "Control a top-down character with a multitouch controller.", + "fullName": "Top-down multitouch controller mapper", + "name": "TopDownMultitouchMapper", + "objectType": "", + "eventsFunctions": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", - "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "if (stick != \"LEFT\" && stick != \"RIGHT\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "if (direction != \"UP\" && direction != \"DOWN\" && direction != \"LEFT\" && direction != \"RIGHT\" && direction != \"HORIZONTAL\" && direction != \"VERTICAL\") {\r", - " console.error('Parameter direction is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "let parameterError = false;\r", - "switch (stick) {\r", - " case 'LEFT':\r", - " switch (direction) {\r", - " case 'LEFT':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'UP':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'DOWN':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", - " }\r", - " break;\r", - "\r", - " case \"HORIZONTAL\":\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", - " break;\r", - "\r", - " case \"VERTICAL\":\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", - " break;\r", - "\r", - " default:\r", - " break;\r", - " }\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " switch (direction) {\r", - " case 'LEFT':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'UP':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'DOWN':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", - " }\r", - " break;\r", - "\r", - " case \"HORIZONTAL\":\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", - " break;\r", - "\r", - " case \"VERTICAL\":\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", - " break;\r", - "\r", - " default:\r", - " break;\r", - " }\r", - " break;\r", - "\r", - " default:\r", - " break;\r", - "}\r", - "" + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "sign(SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "TopDownMovementBehavior::DiagonalsAllowed" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "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" + ] + } + ] + } + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] } ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - }, - { - "description": "Stick: \"Left\" or \"Right\"", - "name": "stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" - }, + "propertyDescriptors": [ { - "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": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "if (stick != \"left\" && stick != \"right\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "const axisIndex = stick === 'right' ? 2 : 0;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[axisIndex], playerId);\r", - "" + "value": "", + "type": "Behavior", + "label": "Top-down movement behavior", + "description": "", + "group": "", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Gamepad", - "type": "expression" + "name": "TopDownMovement" }, { - "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": [ + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "if (stick != \"left\" && stick != \"right\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "const axisIndex = stick === 'right' ? 3 : 1;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[axisIndex], playerId);\r", - "" + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "description": "", + "group": "", + "extraInformation": [ + "Primary", + "Secondary" ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Gamepad", - "type": "expression" + "name": "JoystickIdentifier" }, { - "description": "Stick: \"Left\" or \"Right\"", - "name": "Stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" + "value": "Analog", + "type": "Choice", + "label": "Stick mode", + "description": "", + "group": "Controls", + "extraInformation": [ + "Analog", + "360°", + "8 Directions" + ], + "name": "StickMode" } ], - "objectGroups": [] - }, + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [ { - "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": [ + "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", + "eventsFunctions": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in condition: \"Gamepad button released\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "if (button === \"\") {\r", - " console.error('Parameter button is not valid in condition: \"Gamepad button released\"');\r", - " return;\r", - "}\r", - "\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "let buttonId;\r", - "\r", - "switch (button) {\r", - " case 'A':\r", - " case 'CROSS':\r", - " buttonId = 0;\r", - " break;\r", - " case 'B':\r", - " case 'CIRCLE':\r", - " buttonId = 1;\r", - " break;\r", - " case 'X':\r", - " case 'SQUARE':\r", - " buttonId = 2;\r", - " break;\r", - " case 'Y':\r", - " case 'TRIANGLE':\r", - " buttonId = 3;\r", - " break;\r", - " case 'LB':\r", - " case 'L1':\r", - " buttonId = 4;\r", - " break;\r", - " case 'RB':\r", - " case 'R1':\r", - " buttonId = 5;\r", - " break;\r", - " case 'LT':\r", - " case 'L2':\r", - " buttonId = 6;\r", - " break;\r", - " case 'RT':\r", - " case 'R2':\r", - " buttonId = 7;\r", - " break;\r", - "\r", - " case 'UP':\r", - " buttonId = 12;\r", - " break;\r", - " case 'DOWN':\r", - " buttonId = 13;\r", - " break;\r", - " case 'LEFT':\r", - " buttonId = 14;\r", - " break;\r", - " case 'RIGHT':\r", - " buttonId = 15;\r", - " break;\r", - "\r", - " case 'BACK':\r", - " case 'SHARE':\r", - " buttonId = 8;\r", - " break;\r", - " case 'START':\r", - " case 'OPTIONS':\r", - " buttonId = 9;\r", - " break;\r", - "\r", - " case 'CLICK_STICK_LEFT':\r", - " buttonId = 10;\r", - " break;\r", - " case 'CLICK_STICK_RIGHT':\r", - " buttonId = 11;\r", - " break;\r", - "\r", - " //PS4\r", - " case 'PS_BUTTON':\r", - " buttonId = 16;\r", - " break;\r", - " case 'CLICK_TOUCHPAD':\r", - " buttonId = 17;\r", - " break;\r", - "\r", - " default:\r", - " console.error('The button: ' + button + ' in condition: \"Gamepad button released\" is not valid.');\r", - " break;\r", - "}\r", - "\r", - "if (buttonId === undefined) {\r", - " console.error('There is no buttons valid in condition: \"Gamepad button released\"');\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", - " console.error('Buttons on the gamepad are not accessible in condition: \"Gamepad button released\"');\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "//Define default value on pressed button or use previous value\r", - "gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] || { pressed: false };\r", - "\r", - "//Get state of button at previous frame\r", - "const previousStateButton = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed;\r", - "\r", - "//When previousStateButton is true and actual button state is not pressed\r", - "//Player have release the button\r", - "if (previousStateButton === true && gamepad.buttons[buttonId].pressed === false) {\r", - " // Save the last button used for the player \r", - " gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", - " gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = true;\r", - " eventsFunctionContext.returnValue = true;\r", - "\r", - "} else {\r", - " gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = false;\r", - " eventsFunctionContext.returnValue = false;\r", - "}\r", - "" + "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", + "" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] }, { - "description": "Name of the button", - "name": "button", - "supplementaryInformation": "[\"A\",\"Cross\",\"B\",\"Circle\",\"X\",\"Square\",\"Y\",\"Triangle\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"Up\",\"Down\",\"Left\",\"Right\",\"Back\",\"Share\",\"Start\",\"Options\",\"Click_Stick_Left\",\"Click_Stick_Right\",\"PS_Button\",\"Click_Touchpad\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Return the index of the last pressed button of a gamepad.", - "fullName": "Last pressed button (id)", - "functionType": "Expression", - "name": "LastButtonID", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "//Get function parameter\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "\r", - "//Player id is not valid\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in expression: \"Last pressed button (id)\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "\r", - "//Return the last button used by the player\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].lastButtonUsed;" + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreAutour" + }, + "parameters": [ + "Thumb", + "Border", + "Border.MultitouchJoystick::JoystickForce() * Border.Width() / 2", + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::PropertyShouldBeHiddenWhenReleased" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Object", + "no", + "" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Check if any button is pressed on a gamepad.", - "fullName": "Any gamepad button pressed", - "functionType": "Condition", - "name": "C_Any_Button_pressed", - "sentence": "Any button of gamepad _PARAM1_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameter\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in condition: \"Any gamepad button pressed\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "let buttonId;\r", - "for (let i = 0; i < gamepad.buttons.length; i++) { //For each buttons\r", - " if (gamepad.buttons[i].pressed) { //One of them is pressed\r", - " buttonId = i; //Save the button pressed\r", - " break;\r", - " }\r", - "}\r", - "\r", - "if (buttonId === undefined) {\r", - " // No buttons are pressed.\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", - " console.error('Buttons on the gamepad are not accessible in condition: \"Any gamepad button pressed\"');\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "//When a button is pressed, save the button in lastButtonUsed for each players\r", - "if (gamepad.buttons[buttonId].pressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", - "eventsFunctionContext.returnValue = gamepad.buttons[buttonId].pressed;\r", - "\r", - "\r", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Return the last button pressed. \nButtons for Xbox and PS4 can be:\n* Xbox: \"A\", \"B\", \"X\", \"Y\", \"LB\", \"RB\", \"LT\", \"RT\", \"BACK\", \"START\",\n* PS4: \"CROSS\", \"SQUARE\", \"CIRCLE\", \"TRIANGLE\", \"L1\", \"L2\", \"R1\", \"R2\", \"SHARE\", \"OPTIONS\", \"PS_BUTTON\", \"CLICK_TOUCHPAD\",\n* Both: \"UP\", \"DOWN\", \"LEFT\", \"RIGHT\", \"CLICK_STICK_LEFT\", \"CLICK_STICK_RIGHT\".", - "fullName": "Last pressed button (string)", - "functionType": "StringExpression", - "name": "LastButtonString", - "sentence": "Button _PARAM2_ of gamepad _PARAM1_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in string expression: \"Last pressed button (LastButtonString)\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "if (controllerType === \"\") {\r", - " console.error('Parameter controller type is not valid in string expression: \"Last pressed button (LastButtonString)\"');\r", - " return;\r", - "}\r", - "\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "if (gamepad !== null) { //Gamepad exist\r", - " //Get last btn id\r", - " const lastButtonUsedID = gdjs._extensionController.players[playerId].lastButtonUsed;\r", - "\r", - " //Return last button as string \r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getInputString(controllerType, lastButtonUsedID);\r", - "\r", - "} else { //Gamepad dosen't exist\r", - " console.error('Your controller is not supported or the gamepad wasn\\'t detected in string expression: \"Last pressed button (LastButtonString)\"');\r", - " eventsFunctionContext.returnValue = \"Gamepad not connected\";\r", - "}" + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "objectGroups": [] }, { - "description": "Controller type", - "name": "controller_type", - "supplementaryInformation": "[\"Xbox\",\"PS4\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Return the number of gamepads.", - "fullName": "Gamepad count", - "functionType": "Expression", - "name": "GamepadCount", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get the last activated controller\r", - "const controllerId = gdjs._extensionController.lastActiveController;\r", - "\r", - "// Check if controller is active\r", - "const gamepad = gamepads[controllerId];\r", - "if (gamepad == null) {\r", - " eventsFunctionContext.returnValue = 0;\r", - "} else {\r", - " // Return active controller id\r", - " eventsFunctionContext.returnValue = controllerId + 1;\r", - "}\r", - "" + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [], - "objectGroups": [] - }, - { - "description": "Check if a button is pressed on a gamepad. \nButtons can be:\n* Xbox: \"A\", \"B\", \"X\", \"Y\", \"LB\", \"RB\", \"LT\", \"RT\", \"BACK\", \"START\",\n* PS4: \"CROSS\", \"SQUARE\", \"CIRCLE\", \"TRIANGLE\", \"L1\", \"L2\", \"R1\", \"R2\", \"SHARE\", \"OPTIONS\", \"PS_BUTTON\", \"CLICK_TOUCHPAD\",\n* Other: \"UP\", \"DOWN\", \"LEFT\", \"RIGHT\", \"CLICK_STICK_LEFT\", \"CLICK_STICK_RIGHT\".", - "fullName": "Gamepad button pressed", - "functionType": "Condition", - "name": "C_Button_pressed", - "sentence": "Button _PARAM2_ of gamepad _PARAM1_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in condition: \"Gamepad button pressed\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "if (button === \"\") {\r", - " console.error('Parameter button is not valid in condition: \"Gamepad button pressed\"');\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "let buttonId;\r", - "\r", - "switch (button) {\r", - " case 'A':\r", - " case 'CROSS':\r", - " buttonId = 0;\r", - " break;\r", - " case 'B':\r", - " case 'CIRCLE':\r", - " buttonId = 1;\r", - " break;\r", - " case 'X':\r", - " case 'SQUARE':\r", - " buttonId = 2;\r", - " break;\r", - " case 'Y':\r", - " case 'TRIANGLE':\r", - " buttonId = 3;\r", - " break;\r", - " case 'LB':\r", - " case 'L1':\r", - " buttonId = 4;\r", - " break;\r", - " case 'RB':\r", - " case 'R1':\r", - " buttonId = 5;\r", - " break;\r", - " case 'LT':\r", - " case 'L2':\r", - " buttonId = 6;\r", - " break;\r", - " case 'RT':\r", - " case 'R2':\r", - " buttonId = 7;\r", - " break;\r", - "\r", - " case 'UP':\r", - " buttonId = 12;\r", - " break;\r", - " case 'DOWN':\r", - " buttonId = 13;\r", - " break;\r", - " case 'LEFT':\r", - " buttonId = 14;\r", - " break;\r", - " case 'RIGHT':\r", - " buttonId = 15;\r", - " break;\r", - "\r", - " case 'BACK':\r", - " case 'SHARE':\r", - " buttonId = 8;\r", - " break;\r", - " case 'START':\r", - " case 'OPTIONS':\r", - " buttonId = 9;\r", - " break;\r", - "\r", - " case 'CLICK_STICK_LEFT':\r", - " buttonId = 10;\r", - " break;\r", - " case 'CLICK_STICK_RIGHT':\r", - " buttonId = 11;\r", - " break;\r", - "\r", - " //PS4\r", - " case 'PS_BUTTON':\r", - " buttonId = 16;\r", - " break;\r", - " case 'CLICK_TOUCHPAD':\r", - " buttonId = 17;\r", - " break;\r", - "\r", - " default:\r", - " console.error('The button: ' + button + ' in condition: \"Gamepad button pressed\" is not valid.');\r", - " eventsFunctionContext.returnValue = false;\r", - " break;\r", - "}\r", - "\r", - "\r", - "\r", - "if (buttonId === undefined) {\r", - " console.error('There is no buttons valid in condition: \"Gamepad button pressed\"');\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", - " console.error('Buttons on the gamepad are not accessible in condition: \"Gamepad button pressed\"');\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "//When a button is pressed, save the button in lastButtonUsed for each players\r", - "if (gamepad.buttons[buttonId].pressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", - "eventsFunctionContext.returnValue = gamepad.buttons[buttonId].pressed;\r", - "\r", - "\r", - "\r", - "" + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - }, - { - "description": "Name of the button", - "name": "button", - "supplementaryInformation": "[\"A\",\"Cross\",\"B\",\"Circle\",\"X\",\"Square\",\"Y\",\"Triangle\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"Up\",\"Down\",\"Left\",\"Right\",\"Back\",\"Share\",\"Start\",\"Options\",\"Click_Stick_Left\",\"Click_Stick_Right\",\"PS_Button\",\"Click_Touchpad\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Return the value of the deadzone applied to a gamepad sticks, between 0 and 1.", - "fullName": "Gamepad deadzone for sticks", - "functionType": "Expression", - "name": "Deadzone", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "//Get function parameter\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in expression: \"Gamepad deadzone for sticks\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "///Return the deadzone value for a given player\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].deadzone;" + "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", + "" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Set the deadzone for sticks of the gamepad. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved). Deadzone is between 0 and 1, and is by default 0.2.", - "fullName": "Set gamepad deadzone for sticks", - "functionType": "Action", - "name": "A_Set_deadzone", - "sentence": "Set deadzone for sticks on gamepad: _PARAM1_ to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "//Get function parameter\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const newDeadzone = eventsFunctionContext.getArgument(\"deadzone\");\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in action: \"Set gamepad deadzone for sticks\", is not valid, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "\r", - "// clamp the newDeadzone in range [0, 1].\r", - "// https://github.com/4ian/GDevelop-extensions/pull/33#issuecomment-618224857\r", - "gdjs._extensionController.players[playerId].deadzone = gdjs.evtTools.common.clamp(newDeadzone, 0, 1);\r", - "" + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "objectGroups": [] }, { - "description": "Deadzone for sticks, 0.2 by default (0 to 1)", - "name": "deadzone", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Check if a stick of a gamepad is pushed in a given direction.", - "fullName": "Gamepad stick pushed (axis)", - "functionType": "Condition", - "name": "C_Axis_pushed", - "sentence": "_PARAM2_ stick of gamepad _PARAM1_ is pushed in direction _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", - "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in condition: \"Gamepad stick pushed (axis)\", is not valid number, must be between 0 and 4.');\r", - " return;\r", - "}\r", - "if (stick != \"LEFT\" && stick != \"RIGHT\") {\r", - " console.error('Parameter stick in condition: \"Gamepad stick pushed (axis)\", is not valid, must be LEFT or RIGHT');\r", - " return;\r", - "}\r", - "if (direction != \"UP\" && direction != \"DOWN\" && direction != \"LEFT\" && direction != \"RIGHT\" && direction != \"ANY\") {\r", - " console.error('Parameter deadzone in condition: \"Gamepad stick pushed (axis)\", is not valid, must be UP, DOWN, LEFT or RIGHT');\r", - " return;\r", - "}\r", - "\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) {\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", - "\r", - "\r", - "//Define in onFirstSceneLoaded function\r", - "const getNormalizedAxisValue = gdjs._extensionController.getNormalizedAxisValue;\r", - "\r", - "switch (stick) {\r", - " case 'LEFT':\r", - " switch (direction) {\r", - " case 'LEFT':\r", - " if (getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " if (getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'UP':\r", - " if (getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'DOWN':\r", - " if (getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'ANY':\r", - " if ( getNormalizedAxisValue(gamepad.axes[0], playerId) < 0\r", - " || getNormalizedAxisValue(gamepad.axes[0], playerId) > 0\r", - " || getNormalizedAxisValue(gamepad.axes[1], playerId) < 0 \r", - " || getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " default:\r", - " console.error('The value Direction on stick Left on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", - " eventsFunctionContext.returnValue = false;\r", - " break;\r", - " }\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " switch (direction) {\r", - " case 'LEFT':\r", - " if (getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " if (getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'UP':\r", - " if (getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'DOWN':\r", - " if (getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " case 'ANY':\r", - " if ( getNormalizedAxisValue(gamepad.axes[2], playerId) < 0\r", - " || getNormalizedAxisValue(gamepad.axes[2], playerId) > 0\r", - " || getNormalizedAxisValue(gamepad.axes[3], playerId) < 0 \r", - " || getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", - "\r", - " default:\r", - " console.error('The value Direction on stick Right on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", - " eventsFunctionContext.returnValue = false;\r", - " break;\r", - " }\r", - " break;\r", - "\r", - " default:\r", - " console.error('The value Stick on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", - " eventsFunctionContext.returnValue = false;\r", - " break;\r", - "}\r", - "\r", - "eventsFunctionContext.returnValue = false;\r", - "" + "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": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::SetPropertyShouldBeHiddenWhenReleased" + }, + "parameters": [ + "Object", + "yes" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::ForceStartPressing" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "StartedTouchOrMouseId(0)", + "" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] }, { - "description": "Stick: \"Left\" or \"Right\"", - "name": "stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" + "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": "Direction", - "name": "direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"Any\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Return the number of connected gamepads.", - "fullName": "Connected gamepads number", - "functionType": "Expression", - "name": "ConnectedGamepadsCount", - "sentence": "", - "events": [ + "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": [] + }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] + "description": "De/activate control of the joystick.", + "fullName": "De/activate control", + "functionType": "Action", + "name": "ActivateControl", + "sentence": "Activate control of _PARAM0_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Activate", + "name": "ShouldActivate", + "type": "yesorno" + } + ], + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "// Gamepads can be disconnected and become null, so we have to filter them.\r", - "eventsFunctionContext.returnValue = Object.keys(gamepads).filter(key => !!gamepads[key]).length;\r", - "" + "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" + ] + } + ] + } ], - "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": [ + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", - "", - "//Get function parameter", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", - "", - "if (playerId < 0 || playerId > 4) {", - " console.error('Parameter gamepad identifier in string expression: \"Gamepad type\", is not valid number, must be between 0 and 4');", - " return;", - "}", - "", - "const gamepad = gamepads[playerId];", - "", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", - "if (gamepad == null) return;", - "", - "eventsFunctionContext.returnValue = (gamepad && gamepad.id) ? gamepad.id : \"No information for player \" + (playerId + 1)", - "" + "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()" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the specified gamepad has the specified information in its description. Useful to know if the gamepad is a Xbox or PS4 controller.", - "fullName": "Gamepad type", - "functionType": "Condition", - "name": "C_Controller_type", - "sentence": "Gamepad _PARAM1_ is a _PARAM2_ controller", - "events": [ + "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": [] + }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", - "", - "//Get function parameters", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", - "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();", - "", - "if (playerId < 0 || playerId > 4) {", - " console.error('Parameter gamepad identifier in condition: \"Gamepad type\", is not valid number, must be between 0 and 4.');", - " return;", - "}", - "if (controllerType === \"\") {", - " console.error('Parameter type in condition: \"Gamepad type\", is not a string.');", - " return;", - "}", - "", - "const gamepad = gamepads[playerId];", - "", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", - "if (gamepad == null) return;", - "", - "", - "if (controllerType == \"XBOX\") {", - " eventsFunctionContext.returnValue = gdjs._extensionController.isXbox(gamepad);", - "} else {", - " eventsFunctionContext.returnValue = gamepad ? gamepad.id.toUpperCase().indexOf(controllerType) !== -1 : false;", - "}" + "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()" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "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": "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": [ + "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": [] + }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", - "", - "//Get function parameter", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", - "", - "if (playerId < 0 || playerId > 4) {", - " console.error('Parameter gamepad identifier in condition: \"Gamepad connected\", is not valid number, must be between 0 and 4.');", - " return;", - "}", - "", - "// If gamepad was disconnected it will be null (so this will return false)", - "// If gamepad was never connected it will be undefined (so this will return false)", - "eventsFunctionContext.returnValue = !!gamepads[playerId];" + "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()" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Generate a vibration on the specified controller. Might only work if the game is running in a recent web browser.", - "fullName": "Gamepad vibration", - "functionType": "Action", - "name": "A_Vibrate_controller", - "sentence": "Make gamepad _PARAM1_ vibrate for _PARAM2_ seconds", - "events": [ + "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": [] + }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */", - "//Vibration work only on game in browser.", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", - "", - "//Get function parameters", - "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", - "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", - "", - "if (playerId < 0 || playerId > 4) {", - " console.error('Parameter gamepad identifier in action: \"Gamepad connected\", is not valid number, must be between 0 and 4.');", - " return;", - "}", - "", - "const gamepad = gamepads[playerId];", - "", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", - "if (gamepad == null) return;", - "", - "if (gamepad && gamepad.vibrationActuator) {", - " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", - " startDelay: 0,", - " duration: duration * 1000,", - " weakMagnitude: 1.0,", - " strongMagnitude: 1.0", - " });", - "}" + "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...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "description": "", + "group": "", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "0.4", + "type": "Number", + "label": "Dead zone radius (range: 0 to 1)", + "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", + "group": "", + "extraInformation": [], + "name": "DeadZoneRadius" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Thumb" + ], + "hidden": true, + "name": "ThumbAnchorOrigin" + }, + { + "value": "Center-center", + "type": "Number", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ThumbAnchorTarget" + }, + { + "value": "true", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [ + "Thumb" + ], + "hidden": true, + "name": "ThumbIsScaledProportionally" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ParentOrigin" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShouldBeHiddenWhenReleased" + } + ], + "objects": [ + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Thumb", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Border", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "MultitouchJoystick", + "type": "SpriteMultitouchJoystick::MultitouchJoystick", + "ControllerIdentifier": 1, + "JoystickIdentifier": "Primary", + "FloatingEnabled": false, + "DeadZoneRadius": 0.4, + "JoystickAngle": 0, + "JoystickForce": 0, + "TouchId": 0, + "TouchIndex": 0 + } + ], + "animations": [ + { + "name": "Idle", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Thumb" + }, + { + "objectName": "Border" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [] + } + ] + }, + { + "author": "Bouh", + "category": "Input", + "extensionNamespace": "", + "fullName": "Gamepads (controllers)", + "helpPath": "/all-features/gamepad", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWdhbWVwYWQtdmFyaWFudC1vdXRsaW5lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTYsOUg4VjExSDEwVjEzSDhWMTVINlYxM0g0VjExSDZWOU0xOC41LDlBMS41LDEuNSAwIDAsMSAyMCwxMC41QTEuNSwxLjUgMCAwLDEgMTguNSwxMkExLjUsMS41IDAgMCwxIDE3LDEwLjVBMS41LDEuNSAwIDAsMSAxOC41LDlNMTUuNSwxMkExLjUsMS41IDAgMCwxIDE3LDEzLjVBMS41LDEuNSAwIDAsMSAxNS41LDE1QTEuNSwxLjUgMCAwLDEgMTQsMTMuNUExLjUsMS41IDAgMCwxIDE1LjUsMTJNMTcsNUE3LDcgMCAwLDEgMjQsMTJBNyw3IDAgMCwxIDE3LDE5QzE1LjA0LDE5IDEzLjI3LDE4LjIgMTIsMTYuOUMxMC43MywxOC4yIDguOTYsMTkgNywxOUE3LDcgMCAwLDEgMCwxMkE3LDcgMCAwLDEgNyw1SDE3TTcsN0E1LDUgMCAwLDAgMiwxMkE1LDUgMCAwLDAgNywxN0M4LjY0LDE3IDEwLjA5LDE2LjIxIDExLDE1SDEzQzEzLjkxLDE2LjIxIDE1LjM2LDE3IDE3LDE3QTUsNSAwIDAsMCAyMiwxMkE1LDUgMCAwLDAgMTcsN0g3WiIgLz48L3N2Zz4=", + "name": "Gamepads", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/gamepad-variant-outline.svg", + "shortDescription": "Add support for gamepads (or other controllers) to your game, giving access to information such as button presses, axis positions, trigger pressure, etc...", + "version": "0.6.3", + "description": [ + "Add support for gamepads (or other controllers).", + "", + "It gives access to:", + "- button presses", + "- axis positions and force", + "- trigger pressure", + "- configurable deadzone", + "- vibration", + "- automatic mappers for platformer characters and top-down movement", + "", + "The Bomberman-like example handles 4 players with gamepads ([open the project online](https://editor.gdevelop.io/?project=example://goose-bomberman))." + ], + "origin": { + "identifier": "Gamepads", + "name": "gdevelop-extension-store" + }, + "tags": [ + "controllers", + "gamepads", + "joysticks", + "axis", + "xbox", + "ps4", + "platformer", + "platform", + "top-down" + ], + "authorIds": [ + "2OwwM8ToR9dx9RJ2sAKTcrLmCB92", + "taRwmWxwAFYFL9yyBwB3cwBw0BO2", + "mnImQKdn8nQxwzkS5D6a1JB27V23" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Define an new private object javascript for the gamepad extension\r", + "gdjs._extensionController = {\r", + " players: {\r", + " 0: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " 1: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " 2: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " 3: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " },\r", + " lastActiveController: -1, // Last active controller\r", + " controllerButtonNames: { //Map associating controller button ids to button names\r", + " \"XBOX\": {\r", + " 0: \"A\",\r", + " 1: \"B\",\r", + " 2: \"X\",\r", + " 3: \"Y\",\r", + " 4: \"LB\",\r", + " 5: \"RB\",\r", + " 6: \"LT\",\r", + " 7: \"RT\",\r", + " 8: \"BACK\",\r", + " 9: \"START\",\r", + " 10: \"CLICK_STICK_LEFT\",\r", + " 11: \"CLICK_STICK_RIGHT\",\r", + " 12: \"UP\",\r", + " 13: \"DOWN\",\r", + " 14: \"LEFT\",\r", + " 15: \"RIGHT\",\r", + " 16: \"NONE\",\r", + " 17: \"NONE\"\r", + " },\r", + " \"PS4\": {\r", + " 0: \"CROSS\",\r", + " 1: \"CIRCLE\",\r", + " 2: \"SQUARE\",\r", + " 3: \"TRIANGLE\",\r", + " 4: \"L1\",\r", + " 5: \"R1\",\r", + " 6: \"L2\",\r", + " 7: \"R2\",\r", + " 8: \"SHARE\",\r", + " 9: \"OPTIONS\",\r", + " 10: \"CLICK_STICK_LEFT\",\r", + " 11: \"CLICK_STICK_RIGHT\",\r", + " 12: \"UP\",\r", + " 13: \"DOWN\",\r", + " 14: \"LEFT\",\r", + " 15: \"RIGHT\",\r", + " 16: \"PS_BUTTON\",\r", + " 17: \"CLICK_TOUCHPAD\"\r", + " }\r", + " }\r", + "};\r", + "\r", + "gdjs._extensionController.getInputString = function (type, buttonId) {\r", + " const controllerButtonNames = gdjs._extensionController.controllerButtonNames;\r", + " if (controllerButtonNames[type] !== undefined) {\r", + " return controllerButtonNames[type][buttonId];\r", + " }\r", + "\r", + " return \"UNKNOWN_BUTTON\";\r", + "}\r", + "\r", + "gdjs._extensionController.axisToAngle = function (deltaX, deltaY) {\r", + " const rad = Math.atan2(deltaY, deltaX);\r", + " const deg = rad * (180 / Math.PI);\r", + " return deg;\r", + "}\r", + "\r", + "gdjs._extensionController.isXbox = function (gamepad) {\r", + " return (gamepad ? (\r", + " gamepad.id.toUpperCase().indexOf(\"XBOX\") !== -1\r", + " // \"XINPUT\" cannot be used to check if it is a xbox controller is just a generic\r", + " // name reported in Firefox corresponding to the driver being used by the controller\r", + " // https://gamefaqs.gamespot.com/boards/916373-pc/73341312?page=1\r", + " ) : false);\r", + "}\r", + "\r", + "//Returns the new value taking into account the dead zone for the player_ID given\r", + "gdjs._extensionController.getNormalizedAxisValue = function (v, player_ID) {\r", + " // gdjs._extensionController = gdjs._extensionController || { deadzone: 0.2 };\r", + "\r", + " // Anything smaller than this is assumed to be 0,0\r", + " const DEADZONE = gdjs._extensionController.players[player_ID].deadzone;\r", + "\r", + " if (Math.abs(v) < DEADZONE) {\r", + " // In the dead zone, set to 0\r", + " v = 0;\r", + "\r", + " if (v == null) {\r", + " return 0;\r", + " } else {\r", + " return v;\r", + " }\r", + "\r", + " } else {\r", + " // We're outside the dead zone, but we'd like to smooth\r", + " // this value out so it still runs nicely between 0..1.\r", + " // That is, we don't want it to jump suddenly from 0 to\r", + " // DEADZONE.\r", + "\r", + " // Remap v from\r", + " // DEADZONE..1 to 0..(1-DEADZONE)\r", + " // or from\r", + " // -1..-DEADZONE to -(1-DEADZONE)..0\r", + "\r", + " v = v - Math.sign(v) * DEADZONE;\r", + "\r", + " // Remap v from\r", + " // 0..(1-DEADZONE) to 0..1\r", + " // or from\r", + " // -(1-DEADZONE)..0 to -1..0\r", + "\r", + " return v / (1 - DEADZONE);\r", + " }\r", + "};" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onScenePostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Each time a player press a button i save the last button pressed for the next frame", + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameter", + "let countPlayers = Object.keys(gdjs._extensionController.players).length;", + "", + "//Repeat for each players", + "for (let i = 0; i < countPlayers; i++) {", + " let gamepad = gamepads[i]; // Get the gamepad of the player", + "", + " //We have to keep this condition because if the user hasn't plugged in his controller yet, we can't get the controller in the gamepad variable.", + " if (gamepad == null) {", + " continue;", + " }", + "", + " for (let b = 0; b < Object.keys(gamepad.buttons).length; b++) { //For each buttons", + " if (gamepad.buttons[b].pressed) { //One of them is pressed", + " gdjs._extensionController.players[i].lastButtonUsed = b; //Save the button pressed", + "", + " //Save the state of the button for the next frame.", + " gdjs._extensionController.players[i].previousFrameStateButtons[b] = { pressed: true };", + "", + " // Update Last Active Controller", + " gdjs._extensionController.lastActiveController = i;", + " } else {", + " gdjs._extensionController.players[i].previousFrameStateButtons[b] = { pressed: false };", + " }", + " }", + "", + "", + " gdjs._extensionController.players[i].rumble.elapsedTime += runtimeScene.getElapsedTime(runtimeScene) / 1000;", + " if (", + " gdjs._extensionController.players[i].rumble.duration - gdjs._extensionController.players[i].rumble.elapsedTime <= 0 &&", + " (gdjs._extensionController.players[i].rumble.weakMagnitude || gdjs._extensionController.players[i].rumble.strongMagnitude)", + " ) {", + " gdjs._extensionController.players[i].rumble.weakMagnitude = 0;", + " gdjs._extensionController.players[i].rumble.strongMagnitude = 0;", + " }", + "", + "", + "}", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "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": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"TargetedSpeed\"", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(0, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const trigger = eventsFunctionContext.getArgument(\"trigger\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in expression: \"Pressure on a gamepad trigger\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (trigger != \"LT\" && trigger != \"RT\" && trigger != \"L2\" && trigger != \"R2\") {\r", + " console.error('Parameter trigger is not valid in expression: \"Pressure on a gamepad trigger\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "switch (trigger) {\r", + " case 'LT':\r", + " case 'L2':\r", + " eventsFunctionContext.returnValue = gamepad.buttons[6].value;\r", + " break;\r", + "\r", + " case 'RT':\r", + " case 'R2':\r", + " eventsFunctionContext.returnValue = gamepad.buttons[7].value;\r", + " break;\r", + "\r", + " default:\r", + " eventsFunctionContext.returnValue = -1;\r", + " break;\r", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Trigger button", + "name": "trigger", + "supplementaryInformation": "[\"LT\",\"RT\",\"L2\",\"R2\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "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": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick force\"');\r", + " return;\r", + "}\r", + "\r", + "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a stick force\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId)), 0, 1);\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId)), 0, 1);\r", + " break;\r", + "\r", + " default:\r", + " eventsFunctionContext.returnValue = -1;\r", + " break;\r", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Get the rotation value of a gamepad stick.\nIf the deadzone value is high, the angle value is rounded to main axes, left, left, up, down.\nAn zero deadzone value give a total freedom on the angle value.", + "fullName": "Value of a stick rotation (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(player_ID, stick)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "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": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick rotation\"');\r", + " return;\r", + "}\r", + "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a stick rotation\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId));\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId));\r", + " break;\r", + "\r", + " default:\r", + " eventsFunctionContext.returnValue = -1;\r", + " break;\r", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Get the value of axis of a gamepad stick.", + "fullName": "Value of a gamepad axis (deprecated)", + "functionType": "Expression", + "name": "AxisValue", + "private": true, + "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (stick != \"LEFT\" && stick != \"RIGHT\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (direction != \"UP\" && direction != \"DOWN\" && direction != \"LEFT\" && direction != \"RIGHT\" && direction != \"HORIZONTAL\" && direction != \"VERTICAL\") {\r", + " console.error('Parameter direction is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let parameterError = false;\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", + " }\r", + " break;\r", + "\r", + " case \"HORIZONTAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", + " break;\r", + "\r", + " case \"VERTICAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", + " break;\r", + "\r", + " default:\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", + " }\r", + " break;\r", + "\r", + " case \"HORIZONTAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", + " break;\r", + "\r", + " case \"VERTICAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", + " break;\r", + "\r", + " default:\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " break;\r", + "}\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + }, + { + "description": "Direction", + "name": "direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"Horizontal\",\"Vertical\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "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": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (stick != \"left\" && stick != \"right\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "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": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (stick != \"left\" && stick != \"right\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "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": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Gamepad button released\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (button === \"\") {\r", + " console.error('Parameter button is not valid in condition: \"Gamepad button released\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let buttonId;\r", + "\r", + "switch (button) {\r", + " case 'A':\r", + " case 'CROSS':\r", + " buttonId = 0;\r", + " break;\r", + " case 'B':\r", + " case 'CIRCLE':\r", + " buttonId = 1;\r", + " break;\r", + " case 'X':\r", + " case 'SQUARE':\r", + " buttonId = 2;\r", + " break;\r", + " case 'Y':\r", + " case 'TRIANGLE':\r", + " buttonId = 3;\r", + " break;\r", + " case 'LB':\r", + " case 'L1':\r", + " buttonId = 4;\r", + " break;\r", + " case 'RB':\r", + " case 'R1':\r", + " buttonId = 5;\r", + " break;\r", + " case 'LT':\r", + " case 'L2':\r", + " buttonId = 6;\r", + " break;\r", + " case 'RT':\r", + " case 'R2':\r", + " buttonId = 7;\r", + " break;\r", + "\r", + " case 'UP':\r", + " buttonId = 12;\r", + " break;\r", + " case 'DOWN':\r", + " buttonId = 13;\r", + " break;\r", + " case 'LEFT':\r", + " buttonId = 14;\r", + " break;\r", + " case 'RIGHT':\r", + " buttonId = 15;\r", + " break;\r", + "\r", + " case 'BACK':\r", + " case 'SHARE':\r", + " buttonId = 8;\r", + " break;\r", + " case 'START':\r", + " case 'OPTIONS':\r", + " buttonId = 9;\r", + " break;\r", + "\r", + " case 'CLICK_STICK_LEFT':\r", + " buttonId = 10;\r", + " break;\r", + " case 'CLICK_STICK_RIGHT':\r", + " buttonId = 11;\r", + " break;\r", + "\r", + " //PS4\r", + " case 'PS_BUTTON':\r", + " buttonId = 16;\r", + " break;\r", + " case 'CLICK_TOUCHPAD':\r", + " buttonId = 17;\r", + " break;\r", + "\r", + " default:\r", + " console.error('The button: ' + button + ' in condition: \"Gamepad button released\" is not valid.');\r", + " break;\r", + "}\r", + "\r", + "if (buttonId === undefined) {\r", + " console.error('There is no buttons valid in condition: \"Gamepad button released\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", + " console.error('Buttons on the gamepad are not accessible in condition: \"Gamepad button released\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "//Define default value on pressed button or use previous value\r", + "gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] || { pressed: false };\r", + "\r", + "//Get state of button at previous frame\r", + "const previousStateButton = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed;\r", + "\r", + "//When previousStateButton is true and actual button state is not pressed\r", + "//Player have release the button\r", + "if (previousStateButton === true && gamepad.buttons[buttonId].pressed === false) {\r", + " // Save the last button used for the player \r", + " gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + " gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = true;\r", + " eventsFunctionContext.returnValue = true;\r", + "\r", + "} else {\r", + " gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = false;\r", + " eventsFunctionContext.returnValue = false;\r", + "}\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Name of the button", + "name": "button", + "supplementaryInformation": "[\"A\",\"Cross\",\"B\",\"Circle\",\"X\",\"Square\",\"Y\",\"Triangle\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"Up\",\"Down\",\"Left\",\"Right\",\"Back\",\"Share\",\"Start\",\"Options\",\"Click_Stick_Left\",\"Click_Stick_Right\",\"PS_Button\",\"Click_Touchpad\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the index of the last pressed button of a gamepad.", + "fullName": "Last pressed button (id)", + "functionType": "Expression", + "name": "LastButtonID", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "//Player id is not valid\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in expression: \"Last pressed button (id)\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "\r", + "//Return the last button used by the player\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].lastButtonUsed;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if any button is pressed on a gamepad.", + "fullName": "Any gamepad button pressed", + "functionType": "Condition", + "name": "C_Any_Button_pressed", + "sentence": "Any button of gamepad _PARAM1_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Any gamepad button pressed\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let buttonId;\r", + "for (let i = 0; i < gamepad.buttons.length; i++) { //For each buttons\r", + " if (gamepad.buttons[i].pressed) { //One of them is pressed\r", + " buttonId = i; //Save the button pressed\r", + " break;\r", + " }\r", + "}\r", + "\r", + "if (buttonId === undefined) {\r", + " // No buttons are pressed.\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", + " console.error('Buttons on the gamepad are not accessible in condition: \"Any gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "//When a button is pressed, save the button in lastButtonUsed for each players\r", + "if (gamepad.buttons[buttonId].pressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + "eventsFunctionContext.returnValue = gamepad.buttons[buttonId].pressed;\r", + "\r", + "\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the last button pressed. \nButtons for Xbox and PS4 can be:\n* Xbox: \"A\", \"B\", \"X\", \"Y\", \"LB\", \"RB\", \"LT\", \"RT\", \"BACK\", \"START\",\n* PS4: \"CROSS\", \"SQUARE\", \"CIRCLE\", \"TRIANGLE\", \"L1\", \"L2\", \"R1\", \"R2\", \"SHARE\", \"OPTIONS\", \"PS_BUTTON\", \"CLICK_TOUCHPAD\",\n* Both: \"UP\", \"DOWN\", \"LEFT\", \"RIGHT\", \"CLICK_STICK_LEFT\", \"CLICK_STICK_RIGHT\".", + "fullName": "Last pressed button (string)", + "functionType": "StringExpression", + "name": "LastButtonString", + "sentence": "Button _PARAM2_ of gamepad _PARAM1_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in string expression: \"Last pressed button (LastButtonString)\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (controllerType === \"\") {\r", + " console.error('Parameter controller type is not valid in string expression: \"Last pressed button (LastButtonString)\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "if (gamepad !== null) { //Gamepad exist\r", + " //Get last btn id\r", + " const lastButtonUsedID = gdjs._extensionController.players[playerId].lastButtonUsed;\r", + "\r", + " //Return last button as string \r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getInputString(controllerType, lastButtonUsedID);\r", + "\r", + "} else { //Gamepad dosen't exist\r", + " console.error('Your controller is not supported or the gamepad wasn\\'t detected in string expression: \"Last pressed button (LastButtonString)\"');\r", + " eventsFunctionContext.returnValue = \"Gamepad not connected\";\r", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Controller type", + "name": "controller_type", + "supplementaryInformation": "[\"Xbox\",\"PS4\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the number of gamepads.", + "fullName": "Gamepad count", + "functionType": "Expression", + "name": "GamepadCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get the last activated controller\r", + "const controllerId = gdjs._extensionController.lastActiveController;\r", + "\r", + "// Check if controller is active\r", + "const gamepad = gamepads[controllerId];\r", + "if (gamepad == null) {\r", + " eventsFunctionContext.returnValue = 0;\r", + "} else {\r", + " // Return active controller id\r", + " eventsFunctionContext.returnValue = controllerId + 1;\r", + "}\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Check if a button is pressed on a gamepad. \nButtons can be:\n* Xbox: \"A\", \"B\", \"X\", \"Y\", \"LB\", \"RB\", \"LT\", \"RT\", \"BACK\", \"START\",\n* PS4: \"CROSS\", \"SQUARE\", \"CIRCLE\", \"TRIANGLE\", \"L1\", \"L2\", \"R1\", \"R2\", \"SHARE\", \"OPTIONS\", \"PS_BUTTON\", \"CLICK_TOUCHPAD\",\n* Other: \"UP\", \"DOWN\", \"LEFT\", \"RIGHT\", \"CLICK_STICK_LEFT\", \"CLICK_STICK_RIGHT\".", + "fullName": "Gamepad button pressed", + "functionType": "Condition", + "name": "C_Button_pressed", + "sentence": "Button _PARAM2_ of gamepad _PARAM1_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Gamepad button pressed\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (button === \"\") {\r", + " console.error('Parameter button is not valid in condition: \"Gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let buttonId;\r", + "\r", + "switch (button) {\r", + " case 'A':\r", + " case 'CROSS':\r", + " buttonId = 0;\r", + " break;\r", + " case 'B':\r", + " case 'CIRCLE':\r", + " buttonId = 1;\r", + " break;\r", + " case 'X':\r", + " case 'SQUARE':\r", + " buttonId = 2;\r", + " break;\r", + " case 'Y':\r", + " case 'TRIANGLE':\r", + " buttonId = 3;\r", + " break;\r", + " case 'LB':\r", + " case 'L1':\r", + " buttonId = 4;\r", + " break;\r", + " case 'RB':\r", + " case 'R1':\r", + " buttonId = 5;\r", + " break;\r", + " case 'LT':\r", + " case 'L2':\r", + " buttonId = 6;\r", + " break;\r", + " case 'RT':\r", + " case 'R2':\r", + " buttonId = 7;\r", + " break;\r", + "\r", + " case 'UP':\r", + " buttonId = 12;\r", + " break;\r", + " case 'DOWN':\r", + " buttonId = 13;\r", + " break;\r", + " case 'LEFT':\r", + " buttonId = 14;\r", + " break;\r", + " case 'RIGHT':\r", + " buttonId = 15;\r", + " break;\r", + "\r", + " case 'BACK':\r", + " case 'SHARE':\r", + " buttonId = 8;\r", + " break;\r", + " case 'START':\r", + " case 'OPTIONS':\r", + " buttonId = 9;\r", + " break;\r", + "\r", + " case 'CLICK_STICK_LEFT':\r", + " buttonId = 10;\r", + " break;\r", + " case 'CLICK_STICK_RIGHT':\r", + " buttonId = 11;\r", + " break;\r", + "\r", + " //PS4\r", + " case 'PS_BUTTON':\r", + " buttonId = 16;\r", + " break;\r", + " case 'CLICK_TOUCHPAD':\r", + " buttonId = 17;\r", + " break;\r", + "\r", + " default:\r", + " console.error('The button: ' + button + ' in condition: \"Gamepad button pressed\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + "}\r", + "\r", + "\r", + "\r", + "if (buttonId === undefined) {\r", + " console.error('There is no buttons valid in condition: \"Gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "if (gamepad.buttons == null || gamepad.buttons[buttonId] == null) {\r", + " console.error('Buttons on the gamepad are not accessible in condition: \"Gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "//When a button is pressed, save the button in lastButtonUsed for each players\r", + "if (gamepad.buttons[buttonId].pressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + "eventsFunctionContext.returnValue = gamepad.buttons[buttonId].pressed;\r", + "\r", + "\r", + "\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Name of the button", + "name": "button", + "supplementaryInformation": "[\"A\",\"Cross\",\"B\",\"Circle\",\"X\",\"Square\",\"Y\",\"Triangle\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"Up\",\"Down\",\"Left\",\"Right\",\"Back\",\"Share\",\"Start\",\"Options\",\"Click_Stick_Left\",\"Click_Stick_Right\",\"PS_Button\",\"Click_Touchpad\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the value of the deadzone applied to a gamepad sticks, between 0 and 1.", + "fullName": "Gamepad deadzone for sticks", + "functionType": "Expression", + "name": "Deadzone", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in expression: \"Gamepad deadzone for sticks\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "///Return the deadzone value for a given player\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].deadzone;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set the deadzone for sticks of the gamepad. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved). Deadzone is between 0 and 1, and is by default 0.2.", + "fullName": "Set gamepad deadzone for sticks", + "functionType": "Action", + "name": "A_Set_deadzone", + "sentence": "Set deadzone for sticks on gamepad: _PARAM1_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const newDeadzone = eventsFunctionContext.getArgument(\"deadzone\");\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in action: \"Set gamepad deadzone for sticks\", is not valid, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "\r", + "// clamp the newDeadzone in range [0, 1].\r", + "// https://github.com/4ian/GDevelop-extensions/pull/33#issuecomment-618224857\r", + "gdjs._extensionController.players[playerId].deadzone = gdjs.evtTools.common.clamp(newDeadzone, 0, 1);\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Deadzone for sticks, 0.2 by default (0 to 1)", + "name": "deadzone", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a stick of a gamepad is pushed in a given direction.", + "fullName": "Gamepad stick pushed (axis)", + "functionType": "Condition", + "name": "C_Axis_pushed", + "sentence": "_PARAM2_ stick of gamepad _PARAM1_ is pushed in direction _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Gamepad stick pushed (axis)\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (stick != \"LEFT\" && stick != \"RIGHT\") {\r", + " console.error('Parameter stick in condition: \"Gamepad stick pushed (axis)\", is not valid, must be LEFT or RIGHT');\r", + " return;\r", + "}\r", + "if (direction != \"UP\" && direction != \"DOWN\" && direction != \"LEFT\" && direction != \"RIGHT\" && direction != \"ANY\") {\r", + " console.error('Parameter deadzone in condition: \"Gamepad stick pushed (axis)\", is not valid, must be UP, DOWN, LEFT or RIGHT');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) {\r", + " eventsFunctionContext.returnValue = false;\r", + " return;\r", + "}\r", + "\r", + "\r", + "//Define in onFirstSceneLoaded function\r", + "const getNormalizedAxisValue = gdjs._extensionController.getNormalizedAxisValue;\r", + "\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'ANY':\r", + " if ( getNormalizedAxisValue(gamepad.axes[0], playerId) < 0\r", + " || getNormalizedAxisValue(gamepad.axes[0], playerId) > 0\r", + " || getNormalizedAxisValue(gamepad.axes[1], playerId) < 0 \r", + " || getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " console.error('The value Direction on stick Left on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " case 'ANY':\r", + " if ( getNormalizedAxisValue(gamepad.axes[2], playerId) < 0\r", + " || getNormalizedAxisValue(gamepad.axes[2], playerId) > 0\r", + " || getNormalizedAxisValue(gamepad.axes[3], playerId) < 0 \r", + " || getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = true;\r", + " return;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " console.error('The value Direction on stick Right on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " console.error('The value Stick on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", + " eventsFunctionContext.returnValue = false;\r", + " break;\r", + "}\r", + "\r", + "eventsFunctionContext.returnValue = false;\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + }, + { + "description": "Direction", + "name": "direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"Any\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the number of connected gamepads.", + "fullName": "Connected gamepads number", + "functionType": "Expression", + "name": "ConnectedGamepadsCount", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "// Gamepads can be disconnected and become null, so we have to filter them.\r", + "eventsFunctionContext.returnValue = Object.keys(gamepads).filter(key => !!gamepads[key]).length;\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "Return a string containing informations about the specified gamepad.", + "fullName": "Gamepad type", + "functionType": "StringExpression", + "name": "GamepadType", + "sentence": "Player _PARAM1_ use _PARAM2_ controller", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameter", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in string expression: \"Gamepad type\", is not valid number, must be between 0 and 4');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "eventsFunctionContext.returnValue = (gamepad && gamepad.id) ? gamepad.id : \"No information for player \" + (playerId + 1)", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the specified gamepad has the specified information in its description. Useful to know if the gamepad is a Xbox or PS4 controller.", + "fullName": "Gamepad type", + "functionType": "Condition", + "name": "C_Controller_type", + "sentence": "Gamepad _PARAM1_ is a _PARAM2_ controller", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", + "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in condition: \"Gamepad type\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "if (controllerType === \"\") {", + " console.error('Parameter type in condition: \"Gamepad type\", is not a string.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "", + "if (controllerType == \"XBOX\") {", + " eventsFunctionContext.returnValue = gdjs._extensionController.isXbox(gamepad);", + "} else {", + " eventsFunctionContext.returnValue = gamepad ? gamepad.id.toUpperCase().indexOf(controllerType) !== -1 : false;", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Type: \"Xbox\", \"PS4\", \"Steam\" or \"PS3\" (among other)", + "name": "controller_type", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a gamepad is connected.", + "fullName": "Gamepad connected", + "functionType": "Condition", + "name": "C_Controller_X_is_connected", + "sentence": "Gamepad _PARAM1_ is plugged and connected", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameter", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in condition: \"Gamepad connected\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "", + "// If gamepad was disconnected it will be null (so this will return false)", + "// If gamepad was never connected it will be undefined (so this will return false)", + "eventsFunctionContext.returnValue = !!gamepads[playerId];" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Generate a vibration on the specified controller. Might only work if the game is running in a recent web browser.", + "fullName": "Gamepad vibration", + "functionType": "Action", + "name": "A_Vibrate_controller", + "sentence": "Make gamepad _PARAM1_ vibrate for _PARAM2_ seconds", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "//Vibration work only on game in browser.", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", + "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in action: \"Gamepad connected\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "if (gamepad && gamepad.vibrationActuator) {", + " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", + " startDelay: 0,", + " duration: duration * 1000,", + " weakMagnitude: 1.0,", + " strongMagnitude: 1.0", + " });", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + }, + { + "description": "Time of the vibration, in seconds (optional, default value is 1)", + "name": "Duration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Generate an advanced vibration on the specified controller. Incompatible with Firefox.", + "fullName": "Advanced gamepad vibration", + "functionType": "Action", + "name": "A_Advanced_Vibration_Controller", + "sentence": "Make gamepad _PARAM1_ vibrate for _PARAM2_ seconds with the vibration magnitude of _PARAM3_ and _PARAM4_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "//Vibration work only on game in browser.", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", + "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", + "const strongRumbleMagnitude = eventsFunctionContext.getArgument(\"StrongMagnitude\");", + "const weakRumbleMagnitude = eventsFunctionContext.getArgument(\"WeakMagnitude\");", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "if (weakRumbleMagnitude < 0 || weakRumbleMagnitude > 1) {", + " console.error('Parameter weakRumble identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "if (strongRumbleMagnitude < 0 || strongRumbleMagnitude > 1) {", + " console.error('Parameter strongRumble identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug the controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "if (gamepad && gamepad.vibrationActuator) {", + " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", + " startDelay: 0,", + " duration: duration * 1000,", + " weakMagnitude: weakRumbleMagnitude,", + " strongMagnitude: strongRumbleMagnitude", + " });", + "}", + "", + "gdjs._extensionController.players[playerId].rumble.duration = duration;", + "gdjs._extensionController.players[playerId].rumble.elapsedTime = 0;", + "gdjs._extensionController.players[playerId].rumble.weakMagnitude = weakRumbleMagnitude;", + "gdjs._extensionController.players[playerId].rumble.strongMagnitude = strongRumbleMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + }, + { + "description": "Time of the vibration, in seconds (optional, default value is 1)", + "name": "Duration", + "type": "expression" + }, + { + "description": "Strong rumble magnitude (from 0 to 1)", + "name": "StrongMagnitude", + "type": "expression" + }, + { + "description": "Weak rumble magnitude (from 0 to 1)", + "name": "WeakMagnitude", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change a vibration on the specified controller. Incompatible with Firefox.", + "fullName": "Change gamepad active vibration", + "functionType": "Action", + "name": "A_Change_Vibration_Magnitude", + "sentence": "Change the vibration magnitude of _PARAM2_ & _PARAM3_ on gamepad _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */", + "//Vibration work only on game in browser.", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameters", + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", + "const elapsedTime = gdjs._extensionController.players[playerId].rumble.elapsedTime || 0;", + "const originalDuration = gdjs._extensionController.players[playerId].rumble.duration || 1;", + "const strongRumbleMagnitude = eventsFunctionContext.getArgument(\"StrongMagnitude\");", + "const weakRumbleMagnitude = eventsFunctionContext.getArgument(\"WeakMagnitude\");", + "", + "", + "if (playerId < 0 || playerId > 4) {", + " console.error('Parameter gamepad identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 4.');", + " return;", + "}", + "if (weakRumbleMagnitude < 0 || weakRumbleMagnitude > 1) {", + " console.error('Parameter weakRumble identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "if (strongRumbleMagnitude < 0 || strongRumbleMagnitude > 1) {", + " console.error('Parameter strongRumble identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 1.');", + " return;", + "}", + "", + "const gamepad = gamepads[playerId];", + "", + "//we need keep this condition because when use have not yet plug the controller we can't get the controller in the gamepad variable.", + "if (gamepad == null) return;", + "", + "if (originalDuration - elapsedTime <= 0) return;", + "", + "if (gamepad && gamepad.vibrationActuator) {", + " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", + " startDelay: 0,", + " duration: 1000 * (originalDuration - elapsedTime),", + " weakMagnitude: weakRumbleMagnitude,", + " strongMagnitude: strongRumbleMagnitude", + " });", + "}", + "", + "gdjs._extensionController.players[playerId].rumble.weakMagnitude = weakRumbleMagnitude;", + "gdjs._extensionController.players[playerId].rumble.strongMagnitude = strongRumbleMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + }, + { + "description": "Strong rumble magnitude (from 0 to 1)", + "name": "StrongMagnitude", + "type": "expression" + }, + { + "description": "Weak rumble magnitude (from 0 to 1)", + "name": "WeakMagnitude", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Check if any button is released on a gamepad.", + "fullName": "Any gamepad button released", + "functionType": "Condition", + "name": "C_any_button_released", + "sentence": "Any button of gamepad _PARAM1_ is released", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + "\tconsole.error('Parameter gamepad identifier in condition: \"Any gamepad button released\", is not valid number, must be between 0 and 4.');\r", + "\treturn;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "for (let buttonId = 0; buttonId < gamepad.buttons.length; buttonId++) { //For each buttons on current frame.\r", + "\r", + "\tif (buttonId === undefined) {\r", + "\t\teventsFunctionContext.returnValue = false;\r", + "\t\treturn;\r", + "\t}\r", + "\r", + "\t//Get previous value or define value by default for the current button\r", + "\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] || { pressed: false };\r", + "\r", + "\t//Get state of the button at previous frame\r", + "\tconst previousStateButtonIsPressed = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed;\r", + "\r", + "\t//Get the state of the button on the current frame.\r", + "\tconst currentFrameStateButtonIsPressed = gamepad.buttons[buttonId].pressed;\r", + "\r", + "\t//When previousStateButtonIsPressed is true and actual button state is not pressed\r", + "\t//Player have release the button\r", + "\tif (previousStateButtonIsPressed === true && currentFrameStateButtonIsPressed === false) {\r", + "\t\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = true;\r", + "\t\teventsFunctionContext.returnValue = true;\r", + "\t\t//break;\r", + "\t\treturn;\r", + "\t} else {\r", + "\t\t//The player didn't released the button yet, the previous frame state is still true\r", + "\t\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = false;\r", + "\t\teventsFunctionContext.returnValue = false;\r", + "\t}\r", + "\r", + "\tif (currentFrameStateButtonIsPressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", + "}\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the strength of the weak vibration motor on the gamepad of a player.", + "fullName": "Weak rumble magnitude", + "functionType": "Expression", + "name": "WeakVibrationMagnitude", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].rumble.weakMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the strength of the strong vibration motor on the gamepad of a player.", + "fullName": "Strong rumble magnitude", + "functionType": "Expression", + "name": "StrongVibrationMagnitude", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;\r", + "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].rumble.strongMagnitude;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "Player_ID", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "Control a platformer character with a gamepad.", + "fullName": "Platformer gamepad mapper", + "name": "PlatformerGamepadMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "GamepadIdentifier", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyUseArrows" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "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": "Gamepads::PlatformerGamepadMapper::PropertyUseLeftStick" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "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": "Gamepads::PlatformerGamepadMapper::PropertyUseRightStick" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "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::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"A or Cross\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"A\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"B or Circle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"B\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"X or Square\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"X\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Y or Triangle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Y\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LB or L1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RB or R1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LT or L2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RT or R2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::PlatformerGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] } ], - "parameters": [ + "propertyDescriptors": [ { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Player_ID", - "type": "expression" + "value": "", + "type": "Behavior", + "label": "Platformer character behavior", + "description": "", + "group": "", + "extraInformation": [ + "PlatformBehavior::PlatformerObjectBehavior" + ], + "name": "PlatformerCharacter" }, { - "description": "Time of the vibration, in seconds (optional, default value is 1)", - "name": "Duration", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Generate an advanced vibration on the specified controller. Incompatible with Firefox.", - "fullName": "Advanced gamepad vibration", - "functionType": "Action", - "name": "A_Advanced_Vibration_Controller", - "sentence": "Make gamepad _PARAM1_ vibrate for _PARAM2_ seconds with the vibration magnitude of _PARAM3_ and _PARAM4_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */", - "//Vibration work only on game in browser.", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", - "", - "//Get function parameters", - "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", - "const duration = eventsFunctionContext.getArgument(\"Duration\") || 1;", - "const strongRumbleMagnitude = eventsFunctionContext.getArgument(\"StrongMagnitude\");", - "const weakRumbleMagnitude = eventsFunctionContext.getArgument(\"WeakMagnitude\");", - "", - "if (playerId < 0 || playerId > 4) {", - " console.error('Parameter gamepad identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 4.');", - " return;", - "}", - "if (weakRumbleMagnitude < 0 || weakRumbleMagnitude > 1) {", - " console.error('Parameter weakRumble identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 1.');", - " return;", - "}", - "if (strongRumbleMagnitude < 0 || strongRumbleMagnitude > 1) {", - " console.error('Parameter strongRumble identifier in action: \"Advanced gamepad vibration\", is not valid number, must be between 0 and 1.');", - " return;", - "}", - "", - "const gamepad = gamepads[playerId];", - "", - "//we need keep this condition because when use have not yet plug the controller we can't get the controller in the gamepad variable.", - "if (gamepad == null) return;", - "", - "if (gamepad && gamepad.vibrationActuator) {", - " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", - " startDelay: 0,", - " duration: duration * 1000,", - " weakMagnitude: weakRumbleMagnitude,", - " strongMagnitude: strongRumbleMagnitude", - " });", - "}", - "", - "gdjs._extensionController.players[playerId].rumble.duration = duration;", - "gdjs._extensionController.players[playerId].rumble.elapsedTime = 0;", - "gdjs._extensionController.players[playerId].rumble.weakMagnitude = weakRumbleMagnitude;", - "gdjs._extensionController.players[playerId].rumble.strongMagnitude = strongRumbleMagnitude;" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" + }, { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Player_ID", - "type": "expression" + "value": "true", + "type": "Boolean", + "label": "Use directional pad", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseArrows" }, { - "description": "Time of the vibration, in seconds (optional, default value is 1)", - "name": "Duration", - "type": "expression" + "value": "true", + "type": "Boolean", + "label": "Use left stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseLeftStick" }, { - "description": "Strong rumble magnitude (from 0 to 1)", - "name": "StrongMagnitude", - "type": "expression" + "value": "", + "type": "Boolean", + "label": "Use right stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseRightStick" }, { - "description": "Weak rumble magnitude (from 0 to 1)", - "name": "WeakMagnitude", - "type": "expression" + "value": "A or Cross", + "type": "Choice", + "label": "Jump button", + "description": "", + "group": "Controls", + "extraInformation": [ + "A or Cross", + "B or Circle", + "X or Square", + "Y or Triangle", + "LB or L1", + "RB or R1", + "LT or L2", + "RT or R2" + ], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a 3D physics character with a gamepad.", + "fullName": "3D platformer gamepad mapper", + "name": "Platformer3DGamepadMapper", + "objectType": "", + "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::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"A or Cross\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"A\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"B or Circle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"B\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"X or Square\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"X\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Y or Triangle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Y\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LB or L1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RB or R1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LT or L2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RT or R2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RT\"", + "\"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": [] } ], - "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": [ + "propertyDescriptors": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */", - "//Vibration work only on game in browser.", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", - "", - "//Get function parameters", - "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;", - "const elapsedTime = gdjs._extensionController.players[playerId].rumble.elapsedTime || 0;", - "const originalDuration = gdjs._extensionController.players[playerId].rumble.duration || 1;", - "const strongRumbleMagnitude = eventsFunctionContext.getArgument(\"StrongMagnitude\");", - "const weakRumbleMagnitude = eventsFunctionContext.getArgument(\"WeakMagnitude\");", - "", - "", - "if (playerId < 0 || playerId > 4) {", - " console.error('Parameter gamepad identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 4.');", - " return;", - "}", - "if (weakRumbleMagnitude < 0 || weakRumbleMagnitude > 1) {", - " console.error('Parameter weakRumble identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 1.');", - " return;", - "}", - "if (strongRumbleMagnitude < 0 || strongRumbleMagnitude > 1) {", - " console.error('Parameter strongRumble identifier in action: \"Change gamepad active vibration\", is not valid number, must be between 0 and 1.');", - " return;", - "}", - "", - "const gamepad = gamepads[playerId];", - "", - "//we need keep this condition because when use have not yet plug the controller we can't get the controller in the gamepad variable.", - "if (gamepad == null) return;", - "", - "if (originalDuration - elapsedTime <= 0) return;", - "", - "if (gamepad && gamepad.vibrationActuator) {", - " gamepad.vibrationActuator.playEffect(\"dual-rumble\", {", - " startDelay: 0,", - " duration: 1000 * (originalDuration - elapsedTime),", - " weakMagnitude: weakRumbleMagnitude,", - " strongMagnitude: strongRumbleMagnitude", - " });", - "}", - "", - "gdjs._extensionController.players[playerId].rumble.weakMagnitude = weakRumbleMagnitude;", - "gdjs._extensionController.players[playerId].rumble.strongMagnitude = strongRumbleMagnitude;" + "value": "", + "type": "Behavior", + "label": "3D physics character", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ + "name": "PhysicsCharacter3D" + }, { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Player_ID", - "type": "expression" + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" }, { - "description": "Strong rumble magnitude (from 0 to 1)", - "name": "StrongMagnitude", - "type": "expression" + "value": "Left", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Left", + "Right" + ], + "name": "JoystickIdentifier" }, { - "description": "Weak rumble magnitude (from 0 to 1)", - "name": "WeakMagnitude", - "type": "expression" + "value": "A or Cross", + "type": "Choice", + "label": "Jump button", + "description": "", + "group": "Controls", + "extraInformation": [ + "A or Cross", + "B or Circle", + "X or Square", + "Y or Triangle", + "LB or L1", + "RB or R1", + "LT or L2", + "RT or R2" + ], + "name": "JumpButton" } ], - "objectGroups": [] + "sharedPropertyDescriptors": [] }, { - "fullName": "", - "functionType": "Action", - "name": "onFirstSceneLoaded", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] - }, + "description": "Control a 3D physics character with a gamepad.", + "fullName": "3D shooter gamepad mapper", + "name": "Shooter3DGamepadMapper", + "objectType": "", + "eventsFunctions": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "//Define an new private object javascript for the gamepad extension\r", - "gdjs._extensionController = {\r", - " players: {\r", - " 0: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", - " 1: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", - " 2: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", - " 3: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", - " },\r", - " lastActiveController: -1, // Last active controller\r", - " controllerButtonNames: { //Map associating controller button ids to button names\r", - " \"XBOX\": {\r", - " 0: \"A\",\r", - " 1: \"B\",\r", - " 2: \"X\",\r", - " 3: \"Y\",\r", - " 4: \"LB\",\r", - " 5: \"RB\",\r", - " 6: \"LT\",\r", - " 7: \"RT\",\r", - " 8: \"BACK\",\r", - " 9: \"START\",\r", - " 10: \"CLICK_STICK_LEFT\",\r", - " 11: \"CLICK_STICK_RIGHT\",\r", - " 12: \"UP\",\r", - " 13: \"DOWN\",\r", - " 14: \"LEFT\",\r", - " 15: \"RIGHT\",\r", - " 16: \"NONE\",\r", - " 17: \"NONE\"\r", - " },\r", - " \"PS4\": {\r", - " 0: \"CROSS\",\r", - " 1: \"CIRCLE\",\r", - " 2: \"SQUARE\",\r", - " 3: \"TRIANGLE\",\r", - " 4: \"L1\",\r", - " 5: \"R1\",\r", - " 6: \"L2\",\r", - " 7: \"R2\",\r", - " 8: \"SHARE\",\r", - " 9: \"OPTIONS\",\r", - " 10: \"CLICK_STICK_LEFT\",\r", - " 11: \"CLICK_STICK_RIGHT\",\r", - " 12: \"UP\",\r", - " 13: \"DOWN\",\r", - " 14: \"LEFT\",\r", - " 15: \"RIGHT\",\r", - " 16: \"PS_BUTTON\",\r", - " 17: \"CLICK_TOUCHPAD\"\r", - " }\r", - " }\r", - "};\r", - "\r", - "gdjs._extensionController.getInputString = function (type, buttonId) {\r", - " const controllerButtonNames = gdjs._extensionController.controllerButtonNames;\r", - " if (controllerButtonNames[type] !== undefined) {\r", - " return controllerButtonNames[type][buttonId];\r", - " }\r", - "\r", - " return \"UNKNOWN_BUTTON\";\r", - "}\r", - "\r", - "gdjs._extensionController.axisToAngle = function (deltaX, deltaY) {\r", - " const rad = Math.atan2(deltaY, deltaX);\r", - " const deg = rad * (180 / Math.PI);\r", - " return deg;\r", - "}\r", - "\r", - "gdjs._extensionController.isXbox = function (gamepad) {\r", - " return (gamepad ? (\r", - " gamepad.id.toUpperCase().indexOf(\"XBOX\") !== -1\r", - " // \"XINPUT\" cannot be used to check if it is a xbox controller is just a generic\r", - " // name reported in Firefox corresponding to the driver being used by the controller\r", - " // https://gamefaqs.gamespot.com/boards/916373-pc/73341312?page=1\r", - " ) : false);\r", - "}\r", - "\r", - "//Returns the new value taking into account the dead zone for the player_ID given\r", - "gdjs._extensionController.getNormalizedAxisValue = function (v, player_ID) {\r", - " // gdjs._extensionController = gdjs._extensionController || { deadzone: 0.2 };\r", - "\r", - " // Anything smaller than this is assumed to be 0,0\r", - " const DEADZONE = gdjs._extensionController.players[player_ID].deadzone;\r", - "\r", - " if (Math.abs(v) < DEADZONE) {\r", - " // In the dead zone, set to 0\r", - " v = 0;\r", - "\r", - " if (v == null) {\r", - " return 0;\r", - " } else {\r", - " return v;\r", - " }\r", - "\r", - " } else {\r", - " // We're outside the dead zone, but we'd like to smooth\r", - " // this value out so it still runs nicely between 0..1.\r", - " // That is, we don't want it to jump suddenly from 0 to\r", - " // DEADZONE.\r", - "\r", - " // Remap v from\r", - " // DEADZONE..1 to 0..(1-DEADZONE)\r", - " // or from\r", - " // -1..-DEADZONE to -(1-DEADZONE)..0\r", - "\r", - " v = v - Math.sign(v) * DEADZONE;\r", - "\r", - " // Remap v from\r", - " // 0..(1-DEADZONE) to 0..1\r", - " // or from\r", - " // -(1-DEADZONE)..0 to -1..0\r", - "\r", - " return v / (1 - DEADZONE);\r", - " }\r", - "};" + "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::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"A or Cross\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"A\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"B or Circle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"B\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"X or Square\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"X\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Y or Triangle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Y\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LB or L1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RB or R1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LT or L2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RT or R2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::Shooter3DGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] } ], - "parameters": [], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onScenePostEvents", - "sentence": "", - "events": [ + "propertyDescriptors": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] + "value": "", + "type": "Behavior", + "label": "3D physics character", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "//Each time a player press a button i save the last button pressed for the next frame", - "/** @type {Gamepad[]} */", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", - "", - "//Get function parameter", - "let countPlayers = Object.keys(gdjs._extensionController.players).length;", - "", - "//Repeat for each players", - "for (let i = 0; i < countPlayers; i++) {", - " let gamepad = gamepads[i]; // Get the gamepad of the player", - "", - " //We have to keep this condition because if the user hasn't plugged in his controller yet, we can't get the controller in the gamepad variable.", - " if (gamepad == null) {", - " continue;", - " }", - "", - " for (let b = 0; b < Object.keys(gamepad.buttons).length; b++) { //For each buttons", - " if (gamepad.buttons[b].pressed) { //One of them is pressed", - " gdjs._extensionController.players[i].lastButtonUsed = b; //Save the button pressed", - "", - " //Save the state of the button for the next frame.", - " gdjs._extensionController.players[i].previousFrameStateButtons[b] = { pressed: true };", - "", - " // Update Last Active Controller", - " gdjs._extensionController.lastActiveController = i;", - " } else {", - " gdjs._extensionController.players[i].previousFrameStateButtons[b] = { pressed: false };", - " }", - " }", - "", - "", - " gdjs._extensionController.players[i].rumble.elapsedTime += runtimeScene.getElapsedTime(runtimeScene) / 1000;", - " if (", - " gdjs._extensionController.players[i].rumble.duration - gdjs._extensionController.players[i].rumble.elapsedTime <= 0 &&", - " (gdjs._extensionController.players[i].rumble.weakMagnitude || gdjs._extensionController.players[i].rumble.strongMagnitude)", - " ) {", - " gdjs._extensionController.players[i].rumble.weakMagnitude = 0;", - " gdjs._extensionController.players[i].rumble.strongMagnitude = 0;", - " }", - "", - "", - "}", - "" + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" + }, + { + "value": "Left", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Left", + "Right" ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true + "name": "WalkStick" + }, + { + "value": "Right", + "type": "Choice", + "label": "Camera joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Left", + "Right" + ], + "name": "CameraStick" + }, + { + "value": "A or Cross", + "type": "Choice", + "label": "Jump button", + "description": "", + "group": "Controls", + "extraInformation": [ + "A or Cross", + "B or Circle", + "X or Square", + "Y or Triangle", + "LB or L1", + "RB or R1", + "LT or L2", + "RT or R2" + ], + "name": "JumpButton" } ], - "parameters": [], - "objectGroups": [] + "sharedPropertyDescriptors": [] }, { - "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": [ + "description": "Control camera rotations with a gamepad.", + "fullName": "First person camera gamepad mapper", + "name": "FirstPersonGamepadMapper", + "objectType": "", + "eventsFunctions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] + "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": "Gamepads::FirstPersonGamepadMapper::SetPropertyCurrentRotationSpeedZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Gamepads::AcceleratedSpeed(CurrentRotationSpeedZ, Gamepads::StickForceX(GamepadIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "CurrentRotationSpeedZ * TimeDelta()" + ] + }, + { + "type": { + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyCurrentRotationSpeedY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": [] }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - "\tconsole.error('Parameter gamepad identifier in condition: \"Any gamepad button released\", is not valid number, must be between 0 and 4.');\r", - "\treturn;\r", - "}\r", - "\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "for (let buttonId = 0; buttonId < gamepad.buttons.length; buttonId++) { //For each buttons on current frame.\r", - "\r", - "\tif (buttonId === undefined) {\r", - "\t\teventsFunctionContext.returnValue = false;\r", - "\t\treturn;\r", - "\t}\r", - "\r", - "\t//Get previous value or define value by default for the current button\r", - "\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId] || { pressed: false };\r", - "\r", - "\t//Get state of the button at previous frame\r", - "\tconst previousStateButtonIsPressed = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed;\r", - "\r", - "\t//Get the state of the button on the current frame.\r", - "\tconst currentFrameStateButtonIsPressed = gamepad.buttons[buttonId].pressed;\r", - "\r", - "\t//When previousStateButtonIsPressed is true and actual button state is not pressed\r", - "\t//Player have release the button\r", - "\tif (previousStateButtonIsPressed === true && currentFrameStateButtonIsPressed === false) {\r", - "\t\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = true;\r", - "\t\teventsFunctionContext.returnValue = true;\r", - "\t\t//break;\r", - "\t\treturn;\r", - "\t} else {\r", - "\t\t//The player didn't released the button yet, the previous frame state is still true\r", - "\t\tgdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed = false;\r", - "\t\teventsFunctionContext.returnValue = false;\r", - "\t}\r", - "\r", - "\tif (currentFrameStateButtonIsPressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", - "}\r", - "" + "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()", + "" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Return the strength of the weak vibration motor on the gamepad of a player.", - "fullName": "Weak rumble magnitude", - "functionType": "Expression", - "name": "WeakVibrationMagnitude", - "sentence": "", - "events": [ + "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": [] + }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].rumble.weakMagnitude;" + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationSpeedMax", + "name": "SetHorizontalRotationSpeedMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyHorizontalRotationSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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" + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Player_ID", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Return the strength of the strong vibration motor on the gamepad of a player.", - "fullName": "Strong rumble magnitude", - "functionType": "Expression", - "name": "StrongVibrationMagnitude", - "sentence": "", - "events": [ + "objectGroups": [] + }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].rumble.strongMagnitude;" + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationAcceleration", + "name": "SetHorizontalRotationAcceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyHorizontalRotationAcceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Player_ID", - "type": "expression" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ - { - "description": "Control a platformer character with a gamepad.", - "fullName": "Platformer gamepad mapper", - "name": "PlatformerGamepadMapper", - "objectType": "", - "eventsFunctions": [ + "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": "Action", - "name": "doStepPreEvents", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationDeceleration", + "name": "SetHorizontalRotationDeceleration", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "Gamepads::C_Controller_X_is_connected" + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyHorizontalRotationDeceleration" }, "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "" + "Object", + "Behavior", + "=", + "Value" ] } - ], - "actions": [], - "events": [ + ] + } + ], + "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseArrows" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Left\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Right\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Up\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - }, - { - "type": { - "value": "PlatformBehavior::SimulateLadderKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Down\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - } + "type": { + "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseLeftStick" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Left\"", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Left\"", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Left\"", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - }, - { - "type": { - "value": "PlatformBehavior::SimulateLadderKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Left\"", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - } + "type": { + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyVerticalRotationSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseRightStick" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Right\"", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Right\"", - "\"Right\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Right\"", - "\"Up\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - }, - { - "type": { - "value": "PlatformBehavior::SimulateLadderKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Right\"", - "\"Down\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - } + "type": { + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyVerticalRotationAcceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"A or Cross\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"A\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "type": { + "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"B or Circle\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"B\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "type": { + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyVerticalRotationDeceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"X or Square\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"X\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "type": { + "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"Y or Triangle\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Y\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "type": { + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyVerticalAngleMin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"LB or L1\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"LB\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "type": { + "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"RB or R1\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"RB\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "type": { + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyVerticalAngleMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"LT or L2\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"LT\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "type": { + "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"RT or R2\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"RT\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } + "type": { + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyOffsetZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -16999,7 +21580,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Gamepads::PlatformerGamepadMapper", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", "type": "behavior" } ], @@ -17010,13 +21591,13 @@ { "value": "", "type": "Behavior", - "label": "Platformer character behavior", + "label": "3D capability", "description": "", "group": "", "extraInformation": [ - "PlatformBehavior::PlatformerObjectBehavior" + "Scene3D::Base3DBehavior" ], - "name": "PlatformerCharacter" + "name": "Object3D" }, { "value": "1", @@ -17028,49 +21609,124 @@ "name": "GamepadIdentifier" }, { - "value": "true", - "type": "Boolean", - "label": "Use directional pad", + "value": "Right", + "type": "Choice", + "label": "Camera joystick", "description": "", - "group": "Controls", + "group": "", + "extraInformation": [ + "Left", + "Right" + ], + "name": "CameraStick" + }, + { + "value": "180", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Horizontal rotation", "extraInformation": [], - "name": "UseArrows" + "name": "HorizontalRotationSpeedMax" }, { - "value": "true", - "type": "Boolean", - "label": "Use left stick", + "value": "360", + "type": "Number", + "label": "Rotation acceleration", "description": "", - "group": "Controls", + "group": "Horizontal rotation", "extraInformation": [], - "name": "UseLeftStick" + "name": "HorizontalRotationAcceleration" }, { - "value": "", - "type": "Boolean", - "label": "Use right stick", + "value": "720", + "type": "Number", + "label": "Rotation deceleration", "description": "", - "group": "Controls", + "group": "Horizontal rotation", "extraInformation": [], - "name": "UseRightStick" + "name": "HorizontalRotationDeceleration" }, { - "value": "A or Cross", - "type": "Choice", - "label": "Jump button", + "value": "120", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", "description": "", - "group": "Controls", - "extraInformation": [ - "A or Cross", - "B or Circle", - "X or Square", - "Y or Triangle", - "LB or L1", - "RB or R1", - "LT or L2", - "RT or R2" - ], - "name": "JumpButton" + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationSpeedMax" + }, + { + "value": "240", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationAcceleration" + }, + { + "value": "480", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationDeceleration" + }, + { + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Minimum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMin" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Maximum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z position offset", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Z", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Y", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedY" } ], "sharedPropertyDescriptors": [] @@ -17096,7 +21752,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "" ] } @@ -17108,7 +21764,7 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseArrows" + "value": "Gamepads::TopDownGamepadMapper::PropertyUseArrows" }, "parameters": [ "Object", @@ -17127,7 +21783,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Left\"", "\"Left\"" ] @@ -17154,7 +21810,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Right\"", "\"Left\"" ] @@ -17181,7 +21837,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Up\"", "\"Left\"" ] @@ -17208,7 +21864,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Down\"", "\"Left\"" ] @@ -17233,7 +21889,7 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseLeftStick" + "value": "Gamepads::TopDownGamepadMapper::PropertyUseLeftStick" }, "parameters": [ "Object", @@ -17266,8 +21922,8 @@ "parameters": [ "Object", "TopDownMovement", - "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")", - "Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")" + "Gamepads::StickRotationValue(GamepadIdentifier, \"Left\")", + "Gamepads::StickForce(GamepadIdentifier, \"Left\")" ] } ] @@ -17295,8 +21951,8 @@ "parameters": [ "Object", "TopDownMovement", - "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")", - "sign(Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Left\"))" + "Gamepads::StickRotationValue(GamepadIdentifier, \"Left\")", + "sign(Gamepads::StickForce(GamepadIdentifier, \"Left\"))" ] } ] @@ -17327,7 +21983,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Left\"", "\"Left\"", "" @@ -17355,7 +22011,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Left\"", "\"Right\"", "" @@ -17383,7 +22039,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Left\"", "\"Up\"", "" @@ -17411,7 +22067,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Left\"", "\"Down\"", "" @@ -17439,7 +22095,7 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseRightStick" + "value": "Gamepads::TopDownGamepadMapper::PropertyUseRightStick" }, "parameters": [ "Object", @@ -17472,8 +22128,8 @@ "parameters": [ "Object", "TopDownMovement", - "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Right\")", - "Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Right\")" + "Gamepads::StickRotationValue(GamepadIdentifier, \"Right\")", + "Gamepads::StickForce(GamepadIdentifier, \"Right\")" ] } ] @@ -17501,7 +22157,7 @@ "parameters": [ "Object", "TopDownMovement", - "sign(Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Right\"))", + "sign(Gamepads::StickForce(GamepadIdentifier, \"Right\"))", "1" ] } @@ -17533,7 +22189,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Right\"", "\"Left\"", "" @@ -17561,7 +22217,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Right\"", "\"Right\"", "" @@ -17589,7 +22245,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Right\"", "\"Up\"", "" @@ -17617,7 +22273,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Right\"", "\"Down\"", "" @@ -18354,7 +23010,7 @@ "name": "PlatformerCharacterAnimator", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Glyphster Pack/Master/SVG/Sports and Fitness/Sports and Fitness_training_running_run.svg", "shortDescription": "Change animations and horizontal flipping of a platformer character automatically.", - "version": "1.1.0", + "version": "1.1.2", "description": [ "Automatically change the animations and horizontal flipping of a platformer character based on movement and interaction with platform objects.", "", @@ -18559,7 +23215,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyJumpAnimationName()" + "JumpAnimationName" ] } ] @@ -18592,7 +23248,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyFallAnimationName()" + "FallAnimationName" ] } ] @@ -18640,7 +23296,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyRunAnimationName()" + "RunAnimationName" ] } ] @@ -18674,7 +23330,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyIdleAnimationName()" + "IdleAnimationName" ] } ] @@ -18715,7 +23371,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyClimbAnimationName()" + "ClimbAnimationName" ] } ] @@ -18995,7 +23651,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyJumpAnimationName()" + "JumpAnimationName" ] } ] @@ -19022,7 +23678,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyFallAnimationName()" + "FallAnimationName" ] } ] @@ -19064,7 +23720,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyRunAnimationName()" + "RunAnimationName" ] } ] @@ -19092,7 +23748,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyIdleAnimationName()" + "IdleAnimationName" ] } ] @@ -19126,7 +23782,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyClimbAnimationName()" + "ClimbAnimationName" ] } ] @@ -19262,7 +23918,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"EnableAnimationChanges\"" + "\"Value\"" ] } ], @@ -19295,7 +23951,7 @@ { "defaultValue": "yes", "description": "Change animations automatically", - "name": "EnableAnimationChanges", + "name": "Value", "optional": true, "type": "yesorno" } @@ -19333,7 +23989,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"EnableHorizontalFlipping\"" + "\"Value\"" ] } ], @@ -19366,7 +24022,7 @@ { "defaultValue": "yes", "description": "Enable horizontal flipping", - "name": "EnableHorizontalFlipping", + "name": "Value", "optional": true, "type": "yesorno" } @@ -19393,7 +24049,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"AnimationName\")" + "Value" ] } ] @@ -19413,7 +24069,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -19439,7 +24095,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"AnimationName\")" + "Value" ] } ] @@ -19459,7 +24115,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -19485,7 +24141,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"AnimationName\")" + "Value" ] } ] @@ -19505,7 +24161,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -19531,7 +24187,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"AnimationName\")" + "Value" ] } ] @@ -19551,7 +24207,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -19577,7 +24233,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"AnimationName\")" + "Value" ] } ] @@ -19597,7 +24253,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -19717,7 +24373,7 @@ "name": "TiledUnitsBar", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/063e9152cf65bc0f3be2a828afd950c3ecf1b1fc72feefdc2467252fe987dc0f_dots-horizontal.svg", "shortDescription": "A bar that represents a resource in the game (health, mana, ammo, etc).", - "version": "1.1.3", + "version": "1.1.4", "description": [ "A bar that represents a resource in the game (health, mana, ammo, etc).", "", @@ -20407,6 +25063,7 @@ "defaultName": "ResourceBar", "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", "fullName": "Resource bar (separated units)", + "isUsingLegacyInstancesRenderer": true, "name": "TiledUnitsBar", "eventsFunctions": [ { @@ -20742,69 +25399,84 @@ ] } ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Background", - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Background", - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "ScalableCapability::ScalableBehavior::SetValue" - }, - "parameters": [ - "Object", - "Scale", - "=", - "1" - ] - }, - { - "type": { - "value": "ResizableCapability::ResizableBehavior::SetWidth" - }, - "parameters": [ - "Background", - "Resizable", - "=", - "Background.Variable(Width)" - ] - }, - { - "type": { - "value": "ResizableCapability::ResizableBehavior::SetHeight" - }, - "parameters": [ - "Background", - "Resizable", - "=", - "Background.Variable(Height)" - ] - }, + "actions": [], + "events": [ { - "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" - }, - "parameters": [ - "Object", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Width", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Height", + "=", + "Object.Height()" + ] + }, + { + "type": { + "value": "ScalableCapability::ScalableBehavior::SetValue" + }, + "parameters": [ + "Object", + "Scale", + "=", + "1" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Background", + "=", + "Width" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Background", + "=", + "Height" + ] + }, + { + "type": { + "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "variables": [ + { + "name": "Width", + "type": "number", + "value": 0 + }, + { + "name": "Height", + "type": "number", + "value": 0 + } ] } ] @@ -21380,7 +26052,7 @@ "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.2.4", + "version": "0.2.5", "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 alo be changed.", @@ -21556,7 +26228,7 @@ "parameters": [ "Object", "<", - "Object.Behavior::PropertyBorderLeft() - (Object.Width()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderLeft - (Object.Width()/2) - TriggerOffset" ] } ], @@ -21568,7 +26240,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderRight() - (Object.Width()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderRight - (Object.Width()/2) + TriggerOffset" ] } ] @@ -21583,7 +26255,7 @@ "parameters": [ "Object", ">", - "Object.Behavior::PropertyBorderRight() - (Object.Width()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderRight - (Object.Width()/2) + TriggerOffset" ] } ], @@ -21595,7 +26267,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderLeft() - (Object.Width()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderLeft - (Object.Width()/2) - TriggerOffset" ] } ] @@ -21627,7 +26299,7 @@ "parameters": [ "Object", "<", - "Object.Behavior::PropertyBorderTop() - (Object.Height()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderTop - (Object.Height()/2) - TriggerOffset" ] } ], @@ -21639,7 +26311,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderBottom() - (Object.Height()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderBottom - (Object.Height()/2) + TriggerOffset" ] } ] @@ -21654,7 +26326,7 @@ "parameters": [ "Object", ">", - "Object.Behavior::PropertyBorderBottom() - (Object.Height()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderBottom - (Object.Height()/2) + TriggerOffset" ] } ], @@ -21666,7 +26338,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderTop() - (Object.Height()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderTop - (Object.Height()/2) - TriggerOffset" ] } ] @@ -22010,7 +26682,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderTop()" + "BorderTop" ] } ] @@ -22050,7 +26722,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderLeft()" + "BorderLeft" ] } ] @@ -22090,7 +26762,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderRight()" + "BorderRight" ] } ] @@ -22130,7 +26802,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderBottom()" + "BorderBottom" ] } ] @@ -22170,7 +26842,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTriggerOffset()" + "TriggerOffset" ] } ] @@ -22213,7 +26885,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22258,7 +26930,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22303,7 +26975,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22348,7 +27020,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22393,7 +27065,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22654,7 +27326,7 @@ "parameters": [ "Object", "<", - "Object.Behavior::PropertyBorderLeft() - (Object.Width()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderLeft - (Object.Width()/2) - TriggerOffset" ] } ], @@ -22676,7 +27348,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderRight() - (Object.Width()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderRight - (Object.Width()/2) + TriggerOffset" ] }, { @@ -22701,7 +27373,7 @@ "parameters": [ "Object", ">", - "Object.Behavior::PropertyBorderRight() - (Object.Width()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderRight - (Object.Width()/2) + TriggerOffset" ] } ], @@ -22723,7 +27395,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderLeft() - (Object.Width()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderLeft - (Object.Width()/2) - TriggerOffset" ] }, { @@ -22766,7 +27438,7 @@ "parameters": [ "Object", "<", - "Object.Behavior::PropertyBorderTop() - (Object.Height()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderTop - (Object.Height()/2) - TriggerOffset" ] } ], @@ -22788,7 +27460,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderBottom() - (Object.Height()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderBottom - (Object.Height()/2) + TriggerOffset" ] }, { @@ -22813,7 +27485,7 @@ "parameters": [ "Object", ">", - "Object.Behavior::PropertyBorderBottom() - (Object.Height()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderBottom - (Object.Height()/2) + TriggerOffset" ] } ], @@ -22835,7 +27507,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderTop() - (Object.Height()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderTop - (Object.Height()/2) - TriggerOffset" ] }, { @@ -23189,7 +27861,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderTop()" + "BorderTop" ] } ] @@ -23229,7 +27901,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderLeft()" + "BorderLeft" ] } ] @@ -23269,7 +27941,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderRight()" + "BorderRight" ] } ] @@ -23309,7 +27981,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderBottom()" + "BorderBottom" ] } ] @@ -23349,7 +28021,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTriggerOffset()" + "TriggerOffset" ] } ] @@ -23392,7 +28064,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23437,7 +28109,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23482,7 +28154,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23527,7 +28199,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23572,7 +28244,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23679,7 +28351,7 @@ "Object", "RequiredPhysicsBehavior", "=", - "Object.Behavior::PropertyAngularVelocity()" + "AngularVelocity" ] }, { @@ -23690,7 +28362,7 @@ "Object", "RequiredPhysicsBehavior", "=", - "Object.Behavior::PropertyLinearVelocityX()" + "LinearVelocityX" ] }, { @@ -23701,7 +28373,7 @@ "Object", "RequiredPhysicsBehavior", "=", - "Object.Behavior::PropertyLinearVelocityY()" + "LinearVelocityY" ] } ] @@ -23849,7 +28521,7 @@ "name": "AdvancedJump", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Sports and Fitness/Sports and Fitness_training_running_run.svg", "shortDescription": "Let platformer characters: air jump, wall jump wall sliding, coyote time and dashing.", - "version": "0.1.2", + "version": "0.1.4", "description": [ "This extension provides behaviors to:", "", @@ -24061,7 +28733,7 @@ "Object", "\"__CoyoteTime_CoyoteJump\"", ">=", - "Object.Behavior::PropertyCoyoteTimeFrameDuration()" + "CoyoteTimeFrameDuration" ] } ], @@ -24298,7 +28970,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Floor jump: \" + ToString(Object.Behavior::PropertyAirJumpCountMaximum() - Object.Behavior::PropertyAirJumpCount()) + \" + 0\"", + "\"Floor jump: \" + ToString(AirJumpCountMaximum - AirJumpCount) + \" + 0\"", "\"info\"", "\"AirJump\"" ] @@ -24422,7 +29094,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Jump released: \" + ToString(Object.Behavior::PropertyAirJumpCountMaximum() - Object.Behavior::PropertyAirJumpCount()) + \" + 0\"", + "\"Jump released: \" + ToString(AirJumpCountMaximum - AirJumpCount) + \" + 0\"", "\"info\"", "\"AirJump\"" ] @@ -24550,7 +29222,7 @@ "Object", "Behavior", "<", - "Object.Behavior::PropertyAirJumpCountMaximum()" + "AirJumpCountMaximum" ] }, { @@ -24606,7 +29278,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Jump allowed: \" + ToString(Object.Behavior::PropertyAirJumpCountMaximum() - Object.Behavior::PropertyAirJumpCount()) + \" + 1\"", + "\"Jump allowed: \" + ToString(AirJumpCountMaximum - AirJumpCount) + \" + 1\"", "\"info\"", "\"AirJump\"" ] @@ -24819,7 +29491,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"CoyoteTime\")" + "Value" ] } ] @@ -24840,7 +29512,7 @@ { "description": "Duration", "longDescription": "Coyote time duration in seconds.", - "name": "CoyoteTime", + "name": "Value", "type": "expression" } ], @@ -25012,7 +29684,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAirJumpCountMaximum()" + "AirJumpCountMaximum" ] } ] @@ -25064,7 +29736,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0, Object.Behavior::PropertyAirJumpCountMaximum() - Object.Behavior::PropertyAirJumpCount())" + "max(0, AirJumpCountMaximum - AirJumpCount)" ] } ] @@ -25100,7 +29772,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "clamp(1 + Object.Behavior::PropertyAirJumpCountMaximum() - Object.Behavior::PropertyAirJumpCount(), 0, Object.Behavior::PropertyAirJumpCountMaximum())" + "clamp(1 + AirJumpCountMaximum - AirJumpCount, 0, AirJumpCountMaximum)" ] } ] @@ -25144,7 +29816,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"AirJumpCountMaximum\")" + "Value" ] } ] @@ -25164,7 +29836,7 @@ }, { "description": "Number of air jumps", - "name": "AirJumpCountMaximum", + "name": "Value", "type": "expression" } ], @@ -26117,7 +30789,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyJumpTimeFrame()", + "JumpTimeFrame", "" ] } @@ -26148,7 +30820,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyJumpTimeFrame()", + "JumpTimeFrame", "\"Jump\"", "" ] @@ -26249,7 +30921,7 @@ "Object", "PlatformerCharacter", "=", - "-Object.Behavior::PropertyWallJumpSpeedX()" + "-WallJumpSpeedX" ] } ] @@ -26277,7 +30949,7 @@ "Object", "PlatformerCharacter", "=", - "Object.Behavior::PropertyWallJumpSpeedX()" + "WallJumpSpeedX" ] } ] @@ -26335,7 +31007,7 @@ "Object", "\"__WallJump_TimeFromJumpStart\"", "<=", - "Object.Behavior::PropertySideSpeedSustainTime()" + "SideSpeedSustainTime" ] } ], @@ -26363,7 +31035,7 @@ "Object", "PlatformerCharacter", "=", - "-Object.Behavior::PropertyWallJumpSpeedX()" + "-WallJumpSpeedX" ] } ] @@ -26391,7 +31063,7 @@ "Object", "PlatformerCharacter", "=", - "Object.Behavior::PropertyWallJumpSpeedX()" + "WallJumpSpeedX" ] } ] @@ -26510,7 +31182,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyWallSlidingSpeedAbsorption()", + "WallSlidingSpeedAbsorption", "" ] }, @@ -27027,7 +31699,7 @@ "Object", "\"__WallJump_IsAgainstWall\"", "<=", - "GetArgumentAsNumber(\"TimeFrame\")" + "TimeFrame" ] } ], @@ -27083,7 +31755,7 @@ }, "parameters": [ "Object", - "\"__WallJump_KeyPressed_\" + GetArgumentAsString(\"Key\")" + "\"__WallJump_KeyPressed_\" + Key" ] } ] @@ -27129,7 +31801,7 @@ }, "parameters": [ "Object", - "\"__WallJump_KeyPressed_\" + GetArgumentAsString(\"Key\")" + "\"__WallJump_KeyPressed_\" + Key" ] } ] @@ -27188,9 +31860,9 @@ }, "parameters": [ "Object", - "\"__WallJump_KeyPressed_\" + GetArgumentAsString(\"Key\")", + "\"__WallJump_KeyPressed_\" + Key", "<=", - "GetArgumentAsNumber(\"TimeFrame\")" + "TimeFrame" ] } ], @@ -27274,7 +31946,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyWallJumpAccelerationX()", + "WallJumpAccelerationX", "\"WallJumpLeap\"", "" ] @@ -27292,7 +31964,7 @@ "Object", "PlatformerCharacter", "<", - "Object.Behavior::PropertyWallJumpSpeedX()" + "WallJumpSpeedX" ] } ], @@ -27304,7 +31976,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyWallJumpSpeedX()", + "WallJumpSpeedX", "\"WallJumpLeap\"", "" ] @@ -27414,7 +32086,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyWallSlidingGravity()", + "WallSlidingGravity", "\"WallJumpSliding\"", "" ] @@ -27426,7 +32098,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyWallSlidingMaxFallingSpeed()", + "WallSlidingMaxFallingSpeed", "\"WallJumpSliding\"", "" ] @@ -27523,7 +32195,7 @@ "Object", "PlatformerCharacter", "=", - "max(Object.Behavior::PropertyWallSlidingFallingSpeedMin(), Object.PlatformerCharacter::CurrentFallSpeed() - Object.PlatformerCharacter::CurrentJumpSpeed() - GetArgumentAsNumber(\"SpeedAbsorption\")) + Object.PlatformerCharacter::CurrentJumpSpeed()" + "max(WallSlidingFallingSpeedMin, Object.PlatformerCharacter::CurrentFallSpeed() - Object.PlatformerCharacter::CurrentJumpSpeed() - SpeedAbsorption) + Object.PlatformerCharacter::CurrentJumpSpeed()" ] } ] @@ -27566,7 +32238,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJumpTimeFrame()" + "JumpTimeFrame" ] } ] @@ -27610,7 +32282,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"JumpTimeFrame\")" + "Value" ] } ] @@ -27630,8 +32302,8 @@ }, { "description": "Jump detection time frame (in seconds)", - "name": "JumpTimeFrame", - "type": "objectList" + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -27653,7 +32325,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyWallJumpSpeedX()" + "WallJumpSpeedX" ] } ] @@ -27697,7 +32369,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"WallJumpSpeedX\")" + "Value" ] } ] @@ -27717,7 +32389,7 @@ }, { "description": "Side speed", - "name": "WallJumpSpeedX", + "name": "Value", "type": "expression" } ], @@ -27740,7 +32412,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyWallJumpAccelerationX()" + "WallJumpAccelerationX" ] } ] @@ -27784,7 +32456,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"WallJumpAccelerationX\")" + "Value" ] } ] @@ -27804,7 +32476,7 @@ }, { "description": "Side acceleration", - "name": "WallJumpAccelerationX", + "name": "Value", "type": "expression" } ], @@ -27827,7 +32499,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyWallSlidingGravity()" + "WallSlidingGravity" ] } ] @@ -27871,7 +32543,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"WallSlidingGravity\")" + "Value" ] } ] @@ -27891,7 +32563,7 @@ }, { "description": "Gravity", - "name": "WallSlidingGravity", + "name": "Value", "type": "expression" } ], @@ -27914,7 +32586,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyWallSlidingMaxFallingSpeed()" + "WallSlidingMaxFallingSpeed" ] } ] @@ -27958,7 +32630,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"WallSlidingMaxFallingSpeed\")" + "Value" ] } ] @@ -27978,7 +32650,7 @@ }, { "description": "Maximum falling speed", - "name": "WallSlidingMaxFallingSpeed", + "name": "Value", "type": "expression" } ], @@ -28001,7 +32673,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyWallSlidingSpeedAbsorption()" + "WallSlidingSpeedAbsorption" ] } ] @@ -28045,7 +32717,7 @@ "Object", "Behavior", "=", - "Firebase::GetRemoteConfigNumber(\"WallSlidingSpeedAbsorption\")" + "Value" ] } ] @@ -28065,7 +32737,7 @@ }, { "description": "Impact speed absorption", - "name": "WallSlidingSpeedAbsorption", + "name": "Value", "type": "expression" } ], @@ -28403,7 +33075,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyDiveMaxFallingSpeed()", + "DiveMaxFallingSpeed", "\"DiveDash\"", "" ] @@ -28415,7 +33087,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyDiveGravity()", + "DiveGravity", "\"DiveDash\"", "" ] @@ -28428,7 +33100,7 @@ "Object", "PlatformerCharacter", "=", - "Object.Behavior::PropertyDiveInitialFallingSpeed()" + "DiveInitialFallingSpeed" ] }, { @@ -28768,7 +33440,7 @@ "Object", "\"__PlatformerDash_CoolDown\"", "<", - "Object.Behavior::PropertyCoolDownDuration()" + "CoolDownDuration" ] } ], @@ -28943,7 +33615,7 @@ "Object", "\"__PlatformerDash_SustainTime\"", ">", - "Object.Behavior::PropertyDashSustainDurationMax()" + "DashSustainDurationMax" ] }, { @@ -28970,7 +33642,7 @@ "Object", "\"__PlatformerDash_SustainTime\"", "<=", - "Object.Behavior::PropertyDashSustainDurationMin()" + "DashSustainDurationMin" ] } ] @@ -28996,7 +33668,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyDashDecceleration()", + "DashDecceleration", "\"HorizontalDash\"", "" ] @@ -29025,7 +33697,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyDashGravity()", + "DashGravity", "\"HorizontalDashGravity\"", "" ] @@ -29306,7 +33978,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyDashSustainGravity()", + "DashSustainGravity", "\"HorizontalDashGravity\"", "" ] @@ -29318,7 +33990,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyDashSustainSpeedMax()", + "DashSustainSpeedMax", "\"HorizontalDash\"", "" ] @@ -29330,7 +34002,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyDashSustainAcceleration()", + "DashSustainAcceleration", "\"HorizontalDash\"", "" ] @@ -29381,7 +34053,7 @@ "Object", "PlatformerCharacter", "=", - "-Object.Behavior::PropertyDashInitialSpeed()" + "-DashInitialSpeed" ] } ] @@ -29409,7 +34081,7 @@ "Object", "PlatformerCharacter", "=", - "Object.Behavior::PropertyDashInitialSpeed()" + "DashInitialSpeed" ] } ] @@ -30133,8 +34805,8 @@ "Object", "Behavior", "\"gravity\"", - "GetArgumentAsNumber(\"SettingValue\")", - "GetArgumentAsString(\"Identifier\")", + "SettingValue", + "Identifier", "" ] }, @@ -30146,7 +34818,7 @@ "Object", "PlatformerCharacter", "=", - "GetArgumentAsNumber(\"SettingValue\")" + "SettingValue" ] } ] @@ -30196,8 +34868,8 @@ "Object", "Behavior", "\"deceleration\"", - "GetArgumentAsNumber(\"SettingValue\")", - "GetArgumentAsString(\"Identifier\")", + "SettingValue", + "Identifier", "" ] }, @@ -30209,7 +34881,7 @@ "Object", "PlatformerCharacter", "=", - "GetArgumentAsNumber(\"SettingValue\")" + "SettingValue" ] } ] @@ -30259,8 +34931,8 @@ "Object", "Behavior", "\"maxSpeed\"", - "GetArgumentAsNumber(\"SettingValue\")", - "GetArgumentAsString(\"Identifier\")", + "SettingValue", + "Identifier", "" ] }, @@ -30272,7 +34944,7 @@ "Object", "PlatformerCharacter", "=", - "GetArgumentAsNumber(\"SettingValue\")" + "SettingValue" ] } ] @@ -30322,8 +34994,8 @@ "Object", "Behavior", "\"acceleration\"", - "GetArgumentAsNumber(\"SettingValue\")", - "GetArgumentAsString(\"Identifier\")", + "SettingValue", + "Identifier", "" ] }, @@ -30335,7 +35007,7 @@ "Object", "PlatformerCharacter", "=", - "GetArgumentAsNumber(\"SettingValue\")" + "SettingValue" ] } ] @@ -30385,8 +35057,8 @@ "Object", "Behavior", "\"maxFallSpeed\"", - "GetArgumentAsNumber(\"SettingValue\")", - "GetArgumentAsString(\"Identifier\")", + "SettingValue", + "Identifier", "" ] }, @@ -30398,7 +35070,7 @@ "Object", "PlatformerCharacter", "=", - "GetArgumentAsNumber(\"SettingValue\")", + "SettingValue", "yes" ] } @@ -30459,7 +35131,7 @@ "name": "PanelSpriteButton", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg", "shortDescription": "A button that can be customized.", - "version": "1.4.4", + "version": "1.4.6", "description": [ "The button can be customized with a background for each state and a label. It handles user interactions and a simple condition can be used to check if it is clicked.", "", @@ -30665,8 +35337,8 @@ }, "parameters": [ "Object", - "TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)", - "TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)" + "TouchX(TouchId, Object.Layer(), 0)", + "TouchY(TouchId, Object.Layer(), 0)" ] } ], @@ -30736,8 +35408,8 @@ }, "parameters": [ "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)" + "TouchX(StartedTouchOrMouseId(Index), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Index), Object.Layer(), 0)" ] } ], @@ -30750,7 +35422,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { @@ -31023,7 +35695,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -31562,7 +36234,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -31669,6 +36341,7 @@ "defaultName": "Button", "description": "A button that can be customized.", "fullName": "Button (panel sprite)", + "isUsingLegacyInstancesRenderer": true, "name": "PanelSpriteButton", "eventsFunctions": [ { @@ -32297,66 +36970,83 @@ ] } ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Idle", - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Idle", - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "PanelSpriteButton::Scale" - }, - "parameters": [ - "Object", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Idle.Variable(Width)" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Idle.Variable(Height)" - ] - }, + "actions": [], + "events": [ { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" - }, - "parameters": [ - "Object", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Width", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Height", + "=", + "Object.Height()" + ] + }, + { + "type": { + "value": "PanelSpriteButton::Scale" + }, + "parameters": [ + "Object", + "=", + "1" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Background", + "=", + "Width" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Background", + "=", + "Height" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "variables": [ + { + "name": "Width", + "type": "number", + "value": 0 + }, + { + "name": "Height", + "type": "number", + "value": 0 + } ] } ] @@ -32623,7 +37313,7 @@ "parameters": [ "Label", "=", - "GetArgumentAsString(\"LabelText\")" + "LabelText" ] }, { @@ -33059,6 +37749,7 @@ "text": "Text", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 20, "color": "0;0;0" } @@ -33183,6 +37874,5 @@ ] } ], - "externalLayouts": [], - "externalSourceFiles": [] + "externalLayouts": [] } \ No newline at end of file diff --git a/examples/multiplayer-platformer-pickup/multiplayer-platformer-pickup.json b/examples/multiplayer-platformer-pickup/multiplayer-platformer-pickup.json index 62c22f6e4..2ab998206 100644 --- a/examples/multiplayer-platformer-pickup/multiplayer-platformer-pickup.json +++ b/examples/multiplayer-platformer-pickup/multiplayer-platformer-pickup.json @@ -1,9 +1,9 @@ { "firstLayout": "Lobby", "gdVersion": { - "build": 212, + "build": 221, "major": 5, - "minor": 4, + "minor": 5, "revision": 0 }, "properties": { @@ -18,7 +18,6 @@ "scaleMode": "nearest", "sizeOnStartupMode": "", "templateSlug": "multiplayer-platformer-pickup", - "useExternalSourceFiles": false, "version": "1.0.0", "name": "Platformer PickUp", "description": "A platformer game where up to 4 players work together to collect all of the coins.\n\nThis game example includes:\n-Multiplayer lobby\n-Platformer behavior\n-Rectangular movement behavior\n-Sound effects\n-Text objects\n-Timers", @@ -65,7 +64,6 @@ "resources": { "resources": [ { - "alwaysLoaded": false, "file": "assets/Knight-Idle1.png", "kind": "image", "metadata": "", @@ -74,7 +72,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Idle2.png", "kind": "image", "metadata": "", @@ -83,7 +80,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Idle3.png", "kind": "image", "metadata": "", @@ -92,7 +88,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Idle4.png", "kind": "image", "metadata": "", @@ -101,7 +96,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Green Button With Shadow_Hovered.png", "kind": "image", "metadata": "", @@ -114,7 +108,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Green Button With Shadow_Idle.png", "kind": "image", "metadata": "", @@ -127,7 +120,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Green Button With Shadow_Pressed.png", "kind": "image", "metadata": "", @@ -151,7 +143,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/slime_green_walk1.png", "kind": "image", "metadata": "", @@ -160,7 +151,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/slime_green_walk2.png", "kind": "image", "metadata": "", @@ -169,7 +159,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/slime_green_walk3.png", "kind": "image", "metadata": "", @@ -178,7 +167,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/slime_green_walk4.png", "kind": "image", "metadata": "", @@ -187,7 +175,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/coin1.png", "kind": "image", "metadata": "", @@ -196,7 +183,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/coin2.png", "kind": "image", "metadata": "", @@ -205,7 +191,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/coin3.png", "kind": "image", "metadata": "", @@ -214,7 +199,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/coin4.png", "kind": "image", "metadata": "", @@ -223,7 +207,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/coin5.png", "kind": "image", "metadata": "", @@ -232,7 +215,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/coin6.png", "kind": "image", "metadata": "", @@ -241,7 +223,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/coin7.png", "kind": "image", "metadata": "", @@ -250,7 +231,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/coin8.png", "kind": "image", "metadata": "", @@ -259,7 +239,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/coin9.png", "kind": "image", "metadata": "", @@ -268,7 +247,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/coin10.png", "kind": "image", "metadata": "", @@ -277,7 +255,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/coin11.png", "kind": "image", "metadata": "", @@ -286,7 +263,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/coin12.png", "kind": "image", "metadata": "", @@ -295,7 +271,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Platform_JumpThrough.png", "kind": "image", "metadata": "", @@ -304,7 +279,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/RestartPoint.png", "kind": "image", "metadata": "{\"extension\":\".png\"}", @@ -323,7 +297,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Roll4.png", "kind": "image", "metadata": "", @@ -332,7 +305,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Roll5.png", "kind": "image", "metadata": "", @@ -341,7 +313,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Roll6.png", "kind": "image", "metadata": "", @@ -350,7 +321,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Roll7.png", "kind": "image", "metadata": "", @@ -359,7 +329,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Roll8.png", "kind": "image", "metadata": "", @@ -368,7 +337,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run1.png", "kind": "image", "metadata": "", @@ -377,7 +345,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Run2.png", "kind": "image", "metadata": "", @@ -386,7 +353,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Run3.png", "kind": "image", "metadata": "", @@ -395,7 +361,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run4.png", "kind": "image", "metadata": "", @@ -404,7 +369,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Run5.png", "kind": "image", "metadata": "", @@ -413,7 +377,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Run6.png", "kind": "image", "metadata": "", @@ -422,7 +385,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Run7.png", "kind": "image", "metadata": "", @@ -431,7 +393,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run8.png", "kind": "image", "metadata": "", @@ -440,7 +401,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run9.png", "kind": "image", "metadata": "", @@ -449,7 +409,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run10.png", "kind": "image", "metadata": "", @@ -458,7 +417,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Run11.png", "kind": "image", "metadata": "", @@ -467,7 +425,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run12.png", "kind": "image", "metadata": "", @@ -476,7 +433,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run13.png", "kind": "image", "metadata": "", @@ -485,7 +441,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run14.png", "kind": "image", "metadata": "", @@ -494,7 +449,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Run15.png", "kind": "image", "metadata": "", @@ -503,7 +457,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Run16.png", "kind": "image", "metadata": "", @@ -512,7 +465,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Platform_Bridge.png", "kind": "image", "metadata": "", @@ -521,7 +473,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Knight-Death1.png", "kind": "image", "metadata": "", @@ -530,7 +481,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Death2.png", "kind": "image", "metadata": "", @@ -539,7 +489,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Death3.png", "kind": "image", "metadata": "", @@ -548,7 +497,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Knight-Death4.png", "kind": "image", "metadata": "", @@ -557,7 +505,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Spikes.png", "kind": "image", "metadata": "", @@ -570,7 +517,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/PlatformDirtdoor1.png", "kind": "image", "metadata": "", @@ -579,7 +525,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/PlatformDirtdoor2.png", "kind": "image", "metadata": "", @@ -608,7 +553,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Door1.png", "kind": "image", "metadata": "", @@ -617,7 +561,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Door2.png", "kind": "image", "metadata": "", @@ -626,7 +569,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Fire1.png", "kind": "image", "metadata": "", @@ -635,7 +577,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Fire2.png", "kind": "image", "metadata": "", @@ -644,7 +585,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Fire3.png", "kind": "image", "metadata": "", @@ -653,7 +593,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Fire4.png", "kind": "image", "metadata": "", @@ -662,7 +601,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Platform_Stone3.png", "kind": "image", "metadata": "", @@ -671,7 +609,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Shadow.png", "kind": "image", "metadata": "", @@ -680,7 +617,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/NewSprite-1-0.png", "kind": "image", "metadata": "", @@ -699,7 +635,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Medieval Button Beige_Idle.png", "kind": "image", "metadata": "", @@ -708,7 +643,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Medieval Button Beige_Hovered.png", "kind": "image", "metadata": "", @@ -717,7 +651,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Medieval Button Beige_Pressed.png", "kind": "image", "metadata": "", @@ -726,7 +659,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Directional Arrow Full Circle.png", "kind": "image", "metadata": "", @@ -739,7 +671,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Top arrow round button.png", "kind": "image", "metadata": "", @@ -752,7 +683,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Shaded dark joystick border.png", "kind": "image", "metadata": "", @@ -765,7 +695,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Shaded dark joystick thumb.png", "kind": "image", "metadata": "", @@ -785,7 +714,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/8BitOperatorPlus8Regular_Edited3.png", "kind": "image", "metadata": "", @@ -794,7 +722,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/world_tileset.png", "kind": "image", "metadata": "", @@ -947,6 +874,7 @@ "text": "Join Lobby", "font": "CantoraOne-Regular.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 40, "color": "255;255;255" } @@ -1000,6 +928,7 @@ "text": "Requires 2-4 players\n\nOpen two or more previews\nif you're testing this game by yourself", "font": "CantoraOne-Regular.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 30, "color": "255;255;255" } @@ -1373,8 +1302,8 @@ "name": "JumpArrowButton", "persistentUuid": "64171d08-6ecd-48ff-b5d7-d1ae51b5058c", "width": 128, - "x": 1088, - "y": 528, + "x": 1040, + "y": 496, "zOrder": 24, "numberProperties": [], "stringProperties": [], @@ -1389,8 +1318,8 @@ "name": "ShadedDarkJoystick", "persistentUuid": "7a35a27a-5183-4587-8b99-2b5318be4726", "width": 0, - "x": 128, - "y": 592, + "x": 176, + "y": 544, "zOrder": 25, "numberProperties": [], "stringProperties": [], @@ -3553,6 +3482,7 @@ "text": "Level: 1", "font": "CantoraOne-Regular.ttf", "textAlignment": "left", + "verticalTextAlignment": "top", "characterSize": 50, "color": "255;255;255" } @@ -3601,6 +3531,7 @@ "text": "Coins left: 0", "font": "CantoraOne-Regular.ttf", "textAlignment": "left", + "verticalTextAlignment": "top", "characterSize": 20, "color": "255;255;255" } @@ -4075,6 +4006,7 @@ "text": "Paused", "font": "CantoraOne-Regular.ttf", "textAlignment": "right", + "verticalTextAlignment": "top", "characterSize": 80, "color": "255;255;255" } @@ -4157,6 +4089,7 @@ "text": "Leave Game", "font": "CantoraOne-Regular.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 40, "color": "133;99;64" } @@ -4298,6 +4231,7 @@ "text": "Press P to pause", "font": "CantoraOne-Regular.ttf", "textAlignment": "left", + "verticalTextAlignment": "top", "characterSize": 30, "color": "255;255;255" } @@ -4537,6 +4471,38 @@ "objectsFolderStructure": { "folderName": "__ROOT", "children": [ + { + "folderName": "UI", + "children": [ + { + "objectName": "ShadedDarkJoystick" + }, + { + "objectName": "JumpArrowButton" + }, + { + "objectName": "ResetGameButton" + }, + { + "objectName": "LeaveGameButton" + }, + { + "objectName": "PausedGameText" + }, + { + "objectName": "PlayerName" + }, + { + "objectName": "P_to_pause" + }, + { + "objectName": "Coin_counts" + }, + { + "objectName": "Level" + } + ] + }, { "objectName": "Player" }, @@ -4552,18 +4518,6 @@ { "objectName": "JumpThrough_Moving" }, - { - "objectName": "Level" - }, - { - "objectName": "Coin_counts" - }, - { - "objectName": "P_to_pause" - }, - { - "objectName": "PlayerName" - }, { "objectName": "RestartPoint" }, @@ -4579,21 +4533,6 @@ { "objectName": "Door" }, - { - "objectName": "PausedGameText" - }, - { - "objectName": "LeaveGameButton" - }, - { - "objectName": "ResetGameButton" - }, - { - "objectName": "JumpArrowButton" - }, - { - "objectName": "ShadedDarkJoystick" - }, { "objectName": "Tilemap_Level" } @@ -4747,6 +4686,14 @@ "P_to_pause", "" ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "ShadedDarkJoystick" + ] } ] }, @@ -4862,6 +4809,33 @@ } ] }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "ShadedDarkJoystick", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "ShadedDarkJoystick", + "" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -8172,6 +8146,7 @@ "text": "Game End", "font": "CantoraOne-Regular.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 130, "color": "255;255;255" } @@ -8674,6 +8649,7 @@ "text": "Leave Game", "font": "CantoraOne-Regular.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 40, "color": "133;99;64" } @@ -8945,7 +8921,7 @@ "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.2.2", + "version": "1.6.1", "description": [ "Multitouch joysticks can be used the same way as physical gamepads:", "- 4 or 8 directions", @@ -8980,8 +8956,458 @@ ], "dependencies": [], "globalVariables": [], - "sceneVariables": [], + "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": [ + { + "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": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"TargetedSpeed\"", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(0, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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 is pressed on a gamepad.", "fullName": "Multitouch controller button pressed", @@ -8994,10 +9420,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Pressed\"" ] @@ -9042,10 +9468,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Released\"" ] @@ -9092,12 +9518,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", - "GetArgumentAsString(\"ButtonState\")" + "ButtonState" ] } ] @@ -9137,12 +9563,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", "=", - "GetArgumentAsNumber(\"DeadZoneRadius\")" + "DeadZoneRadius" ] } ] @@ -9185,7 +9611,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone" ] } ] @@ -9225,7 +9651,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 4 / 360), 4)" + "mod(round(Angle * 4 / 360), 4)" ] } ] @@ -9260,7 +9686,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 8 / 360), 8)" + "mod(round(Angle * 8 / 360), 8)" ] } ] @@ -9294,7 +9720,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -9307,7 +9733,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9331,7 +9757,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -9344,7 +9770,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9368,7 +9794,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -9381,7 +9807,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9405,7 +9831,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -9418,7 +9844,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9466,7 +9892,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -9479,7 +9905,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9503,7 +9929,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownRight\"" ] @@ -9516,7 +9942,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9540,7 +9966,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -9553,7 +9979,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9577,7 +10003,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownLeft\"" ] @@ -9590,7 +10016,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9614,7 +10040,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -9627,7 +10053,7 @@ "", "=", "4", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9651,7 +10077,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpLeft\"" ] @@ -9664,7 +10090,7 @@ "", "=", "5", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9688,7 +10114,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -9701,7 +10127,7 @@ "", "=", "6", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9725,7 +10151,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpRight\"" ] @@ -9738,7 +10164,7 @@ "", "=", "7", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9799,9 +10225,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -9811,8 +10237,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -9879,9 +10305,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -9891,8 +10317,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -9947,7 +10373,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -9967,6 +10393,11 @@ "name": "JoystickIdentifier", "supplementaryInformation": "[\"Primary\",\"Secondary\"]", "type": "stringWithSelector" + }, + { + "description": "", + "name": "Coucou", + "type": "expression" } ], "objectGroups": [] @@ -9987,7 +10418,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Force)" + "max(0, Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier)) / (1 - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -10025,12 +10456,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Force", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -10072,7 +10503,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -10112,7 +10543,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle" ] } ] @@ -10150,12 +10581,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -10196,7 +10627,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::JoystickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\")) * cos(ToRad(SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))))" + "XFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -10236,7 +10667,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::JoystickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\")) * sin(ToRad(SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))))" + "YFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -10259,6 +10690,123 @@ } ], "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": "CompareArgumentAsString" + }, + "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": "CompareArgumentAsString" + }, + "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": [ @@ -10285,9 +10833,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyDeadZoneRadius()", + "ControllerIdentifier", + "JoystickIdentifier", + "DeadZoneRadius", "" ] }, @@ -10449,8 +10997,8 @@ }, "parameters": [ "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)" + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)" ] } ], @@ -10463,7 +11011,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] } ] @@ -10510,7 +11058,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -10562,8 +11110,8 @@ "parameters": [ "Object", "Behavior", - "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))", - "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))" + "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))" ] }, { @@ -10574,7 +11122,7 @@ "Object", "Behavior", "=", - "clamp(2 * DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)) / Object.Width(), 0, 1)", + "clamp(2 * DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(TouchId, Object.Layer(), 0), TouchY(TouchId, Object.Layer(), 0)) / Object.Width(), 0, 1)", "" ] } @@ -10615,7 +11163,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickForce()" + "max(0, JoystickForce - DeadZoneRadius) / (1 - DeadZoneRadius)" ] } ] @@ -10659,7 +11207,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -10668,9 +11216,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickForce()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickForce", "" ] } @@ -10688,6 +11236,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "", + "name": "Parameter", + "type": "objectList" } ], "objectGroups": [] @@ -10708,7 +11261,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickAngle()" + "JoystickAngle" ] } ] @@ -10752,7 +11305,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -10761,9 +11314,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickAngle()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickAngle", "" ] } @@ -10882,13 +11435,14 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyJoystickForce" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" }, "parameters": [ "Object", "Behavior", ">", - "Object.Behavior::PropertyDeadZoneRadius()" + "0", + "" ] }, { @@ -10897,8 +11451,8 @@ }, "parameters": [ "", - "Object.Behavior::JoystickAngle()", - "GetArgumentAsString(\"Direction\")", + "JoystickAngle", + "Direction", "" ] } @@ -10948,13 +11502,14 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyJoystickForce" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" }, "parameters": [ "Object", "Behavior", ">", - "Object.Behavior::PropertyDeadZoneRadius()" + "0", + "" ] }, { @@ -10963,8 +11518,8 @@ }, "parameters": [ "", - "Object.Behavior::JoystickAngle()", - "GetArgumentAsString(\"Direction\")", + "JoystickAngle", + "Direction", "" ] } @@ -11121,7 +11676,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyControllerIdentifier()" + "ControllerIdentifier" ] } ] @@ -11164,7 +11719,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -11202,7 +11757,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyJoystickIdentifier()" + "JoystickIdentifier" ] } ] @@ -11245,7 +11800,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -11283,7 +11838,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDeadZoneRadius()" + "DeadZoneRadius" ] } ] @@ -11326,7 +11881,59 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "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": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -11343,6 +11950,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "Touch identifier", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -11517,12 +12129,31 @@ "conditions": [ { "type": { - "value": "CollisionPoint" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)" + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer())", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer())" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyRadius" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer()), TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer()))" + ] + } ] } ], @@ -11535,7 +12166,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] }, { @@ -11591,7 +12222,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -11759,9 +12390,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyButtonIdentifier()", - "GetArgumentAsString(\"ButtonState\")", + "ControllerIdentifier", + "ButtonIdentifier", + "ButtonState", "" ] } @@ -11838,6 +12469,16 @@ "extraInformation": [], "hidden": true, "name": "IsReleased" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Triggering circle radius", + "description": "This circle adds up to the object collision mask.", + "group": "", + "extraInformation": [], + "name": "Radius" } ], "sharedPropertyDescriptors": [] @@ -11863,8 +12504,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -11891,8 +12532,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -11919,8 +12560,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -11956,8 +12597,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -11984,8 +12625,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJumpButton()", + "ControllerIdentifier", + "JumpButton", "\"Down\"" ] } @@ -12065,9 +12706,9 @@ "sharedPropertyDescriptors": [] }, { - "description": "Control a top-down character with a multitouch controller.", - "fullName": "Top-down multitouch controller mapper", - "name": "TopDownMultitouchMapper", + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D platformer multitouch controller mapper", + "name": "Platformer3DMultitouchMapper", "objectType": "", "eventsFunctions": [ { @@ -12081,55 +12722,171 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "value": "SpriteMultitouchJoystick::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "JoystickIdentifier", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SetForwardAngle" }, "parameters": [ "Object", - "Behavior", + "PhysicsCharacter3D", "=", - "\"Analog\"" + "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": "TopDownMovementBehavior::SimulateStick" + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" }, "parameters": [ "Object", - "TopDownMovement", - "SpriteMultitouchJoystick::StickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", - "SpriteMultitouchJoystick::StickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())" + "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", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D shooter multitouch controller mapper", + "name": "Shooter3DMultitouchMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "value": "SpriteMultitouchJoystick::StickForce" }, "parameters": [ - "Object", - "Behavior", - "=", - "\"360°\"" + "", + ">", + "0", + "ControllerIdentifier", + "JoystickIdentifier", + "" ] } ], "actions": [ { "type": { - "value": "TopDownMovementBehavior::SimulateStick" + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" }, "parameters": [ "Object", - "TopDownMovement", - "SpriteMultitouchJoystick::StickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", - "sign(SpriteMultitouchJoystick::StickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier()))" + "PhysicsCharacter3D", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -12139,61 +12896,1295 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "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", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control camera rotations with a multitouch controller.", + "fullName": "First person camera multitouch controller mapper", + "name": "FirstPersonMultitouchMapper", + "objectType": "", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyCurrentRotationSpeedZ" }, "parameters": [ "Object", "Behavior", "=", - "\"8 Directions\"" + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedZ, SpriteMultitouchJoystick::StickForceX(ControllerIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "CurrentRotationSpeedZ * TimeDelta()" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyCurrentRotationSpeedY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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", + "" ] } - ], - "actions": [], - "events": [ + ] + } + ], + "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "TopDownMovementBehavior::DiagonalsAllowed" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ] + "type": { + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationAcceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationDeceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationAcceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationDeceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyOffsetZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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", + "description": "", + "group": "", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "name": "Object3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Secondary", + "type": "Choice", + "label": "Camera joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "CameraStick" + }, + { + "value": "180", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationSpeedMax" + }, + { + "value": "360", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationAcceleration" + }, + { + "value": "720", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationDeceleration" + }, + { + "value": "120", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationSpeedMax" + }, + { + "value": "240", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationAcceleration" + }, + { + "value": "480", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationDeceleration" + }, + { + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Minimum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMin" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Maximum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z position offset", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Z", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Y", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedY" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a top-down character with a multitouch controller.", + "fullName": "Top-down multitouch controller mapper", + "name": "TopDownMultitouchMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "sign(SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "TopDownMovementBehavior::DiagonalsAllowed" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] }, { "type": "BuiltinCommonInstructions::Standard", @@ -12204,8 +14195,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -12232,8 +14223,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -12260,8 +14251,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -12305,8 +14296,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -12333,8 +14324,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -12361,8 +14352,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -12389,8 +14380,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -12417,8 +14408,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"UpLeft\"", "" ] @@ -12454,8 +14445,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"UpRight\"", "" ] @@ -12491,8 +14482,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"DownLeft\"", "" ] @@ -12528,8 +14519,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"DownRight\"", "" ] @@ -12638,6 +14629,7 @@ "defaultName": "Joystick", "description": "Joystick for touchscreens.", "fullName": "Multitouch Joystick", + "isUsingLegacyInstancesRenderer": true, "name": "SpriteMultitouchJoystick", "eventsFunctions": [ { @@ -12771,6 +14763,49 @@ ] } ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::PropertyShouldBeHiddenWhenReleased" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Object", + "no", + "" + ] + } + ] } ], "parameters": [ @@ -12835,7 +14870,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyControllerIdentifier()", + "ControllerIdentifier", "" ] }, @@ -12847,7 +14882,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyJoystickIdentifier()", + "JoystickIdentifier", "" ] }, @@ -12859,7 +14894,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyDeadZoneRadius()", + "DeadZoneRadius", "" ] } @@ -12876,6 +14911,176 @@ ], "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": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::SetPropertyShouldBeHiddenWhenReleased" + }, + "parameters": [ + "Object", + "yes" + ] + }, + { + "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", @@ -13222,7 +15427,7 @@ "parameters": [ "Border", "MultitouchJoystick", - "GetArgumentAsString(\"Direction\")", + "Direction", "" ] } @@ -13272,7 +15477,7 @@ "parameters": [ "Border", "MultitouchJoystick", - "GetArgumentAsString(\"Direction\")", + "Direction", "" ] } @@ -13360,7 +15565,7 @@ "Border", "MultitouchJoystick", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -13432,7 +15637,7 @@ "Border", "MultitouchJoystick", "=", - "GetArgumentAsString(\"Value\")", + "Value", "" ] } @@ -13504,7 +15709,7 @@ "Border", "MultitouchJoystick", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -13596,6 +15801,16 @@ "extraInformation": [], "hidden": true, "name": "ParentOrigin" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShouldBeHiddenWhenReleased" } ], "objects": [ @@ -13715,7 +15930,7 @@ "name": "SmoothCamera", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Computers and Hardware/Computers and Hardware_camcoder_gopro_go_pro_camera.svg", "shortDescription": "Smoothly scroll to follow an object.", - "version": "0.3.1", + "version": "0.3.3", "description": [ "The camera follows an object according to:", "- a frame rate independent catch-up speed to make the scrolling from smooth to strong", @@ -13782,7 +15997,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyLeftwardSpeed()", + "LeftwardSpeed", "log(1 - )" ] }, @@ -13793,7 +16008,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyRightwardSpeed()", + "RightwardSpeed", "log(1 - )" ] }, @@ -13804,7 +16019,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyUpwardSpeed()", + "UpwardSpeed", "log(1 - )" ] }, @@ -13815,7 +16030,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyDownwardSpeed()", + "DownwardSpeed", "log(1 - )" ] }, @@ -13826,7 +16041,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyLeftwardSpeedMax()", + "LeftwardSpeedMax", "log(1 - )" ] }, @@ -13837,7 +16052,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyRightwardSpeedMax()", + "RightwardSpeedMax", "log(1 - )" ] }, @@ -13848,7 +16063,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyUpwardSpeedMax()", + "UpwardSpeedMax", "log(1 - )" ] }, @@ -13859,7 +16074,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyDownwardSpeedMax()", + "DownwardSpeedMax", "log(1 - )" ] }, @@ -13870,7 +16085,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaLeft()", + "FollowFreeAreaLeft", "log(1 - )" ] }, @@ -13881,7 +16096,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaRight()", + "FollowFreeAreaRight", "log(1 - )" ] }, @@ -13892,7 +16107,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaTop()", + "FollowFreeAreaTop", "log(1 - )" ] }, @@ -13903,7 +16118,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaBottom()", + "FollowFreeAreaBottom", "log(1 - )" ] }, @@ -13915,7 +16130,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyCameraDelay()" + "CameraDelay" ] } ] @@ -14155,7 +16370,7 @@ "parameters": [ "", "=", - "Object.Behavior::FreeAreaRight()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaRight())\n* exp(TimeDelta() * Object.Behavior::PropertyLogLeftwardSpeed())", + "Object.Behavior::FreeAreaRight()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaRight())\n* exp(TimeDelta() * LogLeftwardSpeed)", "Object.Layer()", "0" ] @@ -14172,7 +16387,7 @@ "parameters": [ "", "<", - "Object.Behavior::PropertyOldX() - Object.Behavior::PropertyLeftwardSpeedMax() * TimeDelta()", + "OldX - LeftwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -14186,7 +16401,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldX() - Object.Behavior::PropertyLeftwardSpeedMax() * TimeDelta()", + "OldX - LeftwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -14219,7 +16434,7 @@ "parameters": [ "", "=", - "Object.Behavior::FreeAreaLeft()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaLeft())\n* exp(TimeDelta() * Object.Behavior::PropertyLogRightwardSpeed())", + "Object.Behavior::FreeAreaLeft()\n+ (CameraX(Object.Layer(), 0) - Object.Behavior::FreeAreaLeft())\n* exp(TimeDelta() * LogRightwardSpeed)", "Object.Layer()", "0" ] @@ -14236,7 +16451,7 @@ "parameters": [ "", ">", - "Object.Behavior::PropertyOldX() + Object.Behavior::PropertyRightwardSpeedMax() * TimeDelta()", + "OldX + RightwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -14250,7 +16465,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldX() + Object.Behavior::PropertyRightwardSpeedMax() * TimeDelta()", + "OldX + RightwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -14312,7 +16527,7 @@ "parameters": [ "", "=", - "Object.Behavior::FreeAreaBottom()\n+ (CameraY(Object.Layer(), 0) - Object.Behavior::FreeAreaBottom())\n* exp(TimeDelta() * Object.Behavior::PropertyLogUpwardSpeed())", + "Object.Behavior::FreeAreaBottom()\n+ (CameraY(Object.Layer(), 0) - Object.Behavior::FreeAreaBottom())\n* exp(TimeDelta() * LogUpwardSpeed)", "Object.Layer()", "0" ] @@ -14329,7 +16544,7 @@ "parameters": [ "", "<", - "Object.Behavior::PropertyOldY() - Object.Behavior::PropertyUpwardSpeedMax() * TimeDelta()", + "OldY - UpwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -14343,7 +16558,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldY() - Object.Behavior::PropertyUpwardSpeedMax() * TimeDelta()", + "OldY - UpwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -14376,7 +16591,7 @@ "parameters": [ "", "=", - "Object.Behavior::FreeAreaTop()\n+ (CameraY(Object.Layer(), 0) - Object.Behavior::FreeAreaTop())\n* exp(TimeDelta() * Object.Behavior::PropertyLogDownwardSpeed())", + "Object.Behavior::FreeAreaTop()\n+ (CameraY(Object.Layer(), 0) - Object.Behavior::FreeAreaTop())\n* exp(TimeDelta() * LogDownwardSpeed)", "Object.Layer()", "0" ] @@ -14393,7 +16608,7 @@ "parameters": [ "", ">", - "Object.Behavior::PropertyOldY() + Object.Behavior::PropertyDownwardSpeedMax() * TimeDelta()", + "OldY + DownwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -14407,7 +16622,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldY() + Object.Behavior::PropertyDownwardSpeedMax() * TimeDelta()", + "OldY + DownwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -14465,7 +16680,7 @@ "Object", "Behavior", "=", - "TimeFromStart() + GetArgumentAsNumber(\"WaitingDuration\")" + "TimeFromStart() + NewWaitingDuration" ] }, { @@ -14476,7 +16691,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"WaitingSpeedXMax\")" + "NewWaitingSpeedXMax" ] }, { @@ -14487,7 +16702,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"WaitingSpeedYMax\")" + "NewWaitingSpeedYMax" ] }, { @@ -14498,7 +16713,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"CatchUpDuration\")" + "NewCatchUpDuration" ] } ] @@ -14535,22 +16750,22 @@ }, { "description": "Waiting duration (in seconds)", - "name": "WaitingDuration", + "name": "NewWaitingDuration", "type": "expression" }, { "description": "Waiting maximum camera target speed X", - "name": "WaitingSpeedXMax", + "name": "NewWaitingSpeedXMax", "type": "expression" }, { "description": "Waiting maximum camera target speed Y", - "name": "WaitingSpeedYMax", + "name": "NewWaitingSpeedYMax", "type": "expression" }, { "description": "Catch up duration (in seconds)", - "name": "CatchUpDuration", + "name": "NewCatchUpDuration", "type": "expression" } ], @@ -14646,8 +16861,8 @@ }, "parameters": [ "ShapePainter", - "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()])", - "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()])" + "Object.Variable(__SmoothCamera.ForecastHistoryX[Index])", + "Object.Variable(__SmoothCamera.ForecastHistoryY[Index])" ] }, { @@ -14802,10 +17017,10 @@ }, "parameters": [ "ShapePainter", - "Object.Behavior::PropertyProjectedOldestX()", - "Object.Behavior::PropertyProjectedOldestY()", - "Object.Behavior::PropertyProjectedNewestX()", - "Object.Behavior::PropertyProjectedNewestY()", + "ProjectedOldestX", + "ProjectedOldestY", + "ProjectedNewestX", + "ProjectedNewestY", "1" ] } @@ -14833,8 +17048,8 @@ }, "parameters": [ "ShapePainter", - "Object.Behavior::PropertyForecastedX()", - "Object.Behavior::PropertyForecastedY()", + "ForecastedX", + "ForecastedY", "3" ] }, @@ -14923,7 +17138,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"FollowOnX\"" + "\"Value\"" ] } ], @@ -14955,7 +17170,7 @@ }, { "description": "Follow on X axis", - "name": "FollowOnX", + "name": "Value", "type": "yesorno" } ], @@ -14993,7 +17208,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"FollowOnY\"" + "\"Value\"" ] } ], @@ -15025,7 +17240,7 @@ }, { "description": "Follow on Y axis", - "name": "FollowOnY", + "name": "Value", "type": "yesorno" } ], @@ -15051,7 +17266,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaRight\"))" + "max(0, Value)" ] } ] @@ -15071,7 +17286,7 @@ }, { "description": "Follow free area right border", - "name": "SetFollowFreeAreaRight", + "name": "Value", "type": "expression" } ], @@ -15097,7 +17312,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaLeft\"))" + "max(0, Value)" ] } ] @@ -15117,7 +17332,7 @@ }, { "description": "Follow free area left border", - "name": "SetFollowFreeAreaLeft", + "name": "Value", "type": "expression" } ], @@ -15143,7 +17358,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"FollowFreeAreaTop\"))" + "max(0, Value)" ] } ] @@ -15163,7 +17378,7 @@ }, { "description": "Follow free area top border", - "name": "FollowFreeAreaTop", + "name": "Value", "type": "expression" } ], @@ -15189,7 +17404,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaBottom\"))" + "max(0, Value)" ] } ] @@ -15209,7 +17424,7 @@ }, { "description": "Follow free area bottom border", - "name": "SetFollowFreeAreaBottom", + "name": "Value", "type": "expression" } ], @@ -15235,7 +17450,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -15255,7 +17470,7 @@ }, { "description": "Leftward maximum speed (in ratio per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -15281,7 +17496,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -15301,7 +17516,7 @@ }, { "description": "Rightward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -15327,7 +17542,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -15347,7 +17562,7 @@ }, { "description": "Upward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -15373,7 +17588,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -15393,7 +17608,7 @@ }, { "description": "Downward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -15419,7 +17634,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"LeftwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -15430,7 +17645,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyLeftwardSpeed())" + "log(1 - Value)" ] } ] @@ -15450,7 +17665,7 @@ }, { "description": "Leftward catch-up speed (in ratio per second)", - "name": "LeftwardSpeed", + "name": "Value", "type": "expression" } ], @@ -15476,7 +17691,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"RightwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -15487,7 +17702,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyRightwardSpeed())" + "log(1 - Value)" ] } ] @@ -15507,7 +17722,7 @@ }, { "description": "Rightward catch-up speed (in ratio per second)", - "name": "RightwardSpeed", + "name": "Value", "type": "expression" } ], @@ -15533,7 +17748,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"DownwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -15544,7 +17759,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyDownwardSpeed())" + "log(1 - Value)" ] } ] @@ -15564,7 +17779,7 @@ }, { "description": "Downward catch-up speed (in ratio per second)", - "name": "DownwardSpeed", + "name": "Value", "type": "expression" } ], @@ -15590,7 +17805,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"UpwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -15601,7 +17816,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyUpwardSpeed())" + "log(1 - Value)" ] } ] @@ -15621,7 +17836,7 @@ }, { "description": "Upward catch-up speed (in ratio per second)", - "name": "UpwardSpeed", + "name": "Value", "type": "expression" } ], @@ -15644,7 +17859,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCameraOffsetX()" + "CameraOffsetX" ] } ] @@ -15687,7 +17902,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -15741,7 +17956,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"CameraOffsetX\")", + "Value", "" ] } @@ -15762,7 +17977,7 @@ }, { "description": "Camera offset X", - "name": "CameraOffsetX", + "name": "Value", "type": "expression" } ], @@ -15785,7 +18000,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCameraOffsetY()" + "CameraOffsetY" ] } ] @@ -15840,7 +18055,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -15882,7 +18097,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"CameraOffsetY\")", + "CameraOffsetY", "" ] } @@ -15929,7 +18144,7 @@ "Object", "Behavior", "=", - "min(0, GetArgumentAsNumber(\"ForecastTime\"))" + "min(0, Value)" ] } ] @@ -15949,7 +18164,7 @@ }, { "description": "Forecast time", - "name": "ForecastTime", + "name": "Value", "type": "expression" } ], @@ -15975,7 +18190,7 @@ "Object", "Behavior", "=", - "min(0, GetArgumentAsNumber(\"CameraDelay\"))" + "min(0, Value)" ] } ] @@ -15995,7 +18210,7 @@ }, { "description": "Camera delay", - "name": "CameraDelay", + "name": "Value", "type": "expression" } ], @@ -16019,7 +18234,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedX() + Object.Behavior::PropertyCameraOffsetX() - Object.Behavior::PropertyFollowFreeAreaLeft()" + "ForecastedX + CameraOffsetX - FollowFreeAreaLeft" ] } ] @@ -16061,7 +18276,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedX() + Object.Behavior::PropertyCameraOffsetX() + Object.Behavior::PropertyFollowFreeAreaRight()" + "ForecastedX + CameraOffsetX + FollowFreeAreaRight" ] } ] @@ -16103,7 +18318,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedY() + Object.Behavior::PropertyCameraOffsetY() + Object.Behavior::PropertyFollowFreeAreaBottom()" + "ForecastedY + CameraOffsetY + FollowFreeAreaBottom" ] } ] @@ -16145,7 +18360,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedY() + Object.Behavior::PropertyCameraOffsetY() - Object.Behavior::PropertyFollowFreeAreaTop()" + "ForecastedY + CameraOffsetY - FollowFreeAreaTop" ] } ] @@ -16232,7 +18447,7 @@ "parameters": [ "Object", "__SmoothCamera.ObjectX", - "Object.Behavior::PropertyDelayedCenterX()" + "DelayedCenterX" ] }, { @@ -16242,7 +18457,7 @@ "parameters": [ "Object", "__SmoothCamera.ObjectY", - "Object.Behavior::PropertyDelayedCenterY()" + "DelayedCenterY" ] } ] @@ -16570,7 +18785,7 @@ "Object", "Behavior", "+", - "max(0, TimeDelta() * (1 - min(Object.Behavior::PropertyWaitingSpeedXMax() * abs(Object.Variable(__SmoothCamera.ObjectX[1]) - Object.Variable(__SmoothCamera.ObjectX[0])), Object.Behavior::PropertyWaitingSpeedYMax() * abs(Object.Variable(__SmoothCamera.ObjectY[1]) - Object.Variable(__SmoothCamera.ObjectY[0]))) / (Object.Variable(__SmoothCamera.ObjectTime[1]) - Object.Variable(__SmoothCamera.ObjectTime[0]))))" + "max(0, TimeDelta() * (1 - min(WaitingSpeedXMax * abs(Object.Variable(__SmoothCamera.ObjectX[1]) - Object.Variable(__SmoothCamera.ObjectX[0])), WaitingSpeedYMax * abs(Object.Variable(__SmoothCamera.ObjectY[1]) - Object.Variable(__SmoothCamera.ObjectY[0]))) / (Object.Variable(__SmoothCamera.ObjectTime[1]) - Object.Variable(__SmoothCamera.ObjectTime[0]))))" ] } ], @@ -16585,7 +18800,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Extra delay: \" + ToString(Object.Behavior::PropertyCameraExtraDelay())", + "\"Extra delay: \" + ToString(CameraExtraDelay)", "\"info\"", "\"SmoothCamera\"" ] @@ -16724,7 +18939,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyCameraExtraDelay() / Object.Behavior::PropertyCameraDelayCatchUpDuration()" + "CameraExtraDelay / CameraDelayCatchUpDuration" ] } ], @@ -16783,7 +18998,7 @@ "Object", "Behavior", "=", - "max(0, Object.Behavior::PropertyCameraExtraDelay() -Object.Behavior::PropertyCameraDelayCatchUpSpeed() * TimeDelta())" + "max(0, CameraExtraDelay -CameraDelayCatchUpSpeed * TimeDelta())" ] } ], @@ -16798,7 +19013,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Catching up delay: \" + ToString(Object.Behavior::PropertyCameraExtraDelay())", + "\"Catching up delay: \" + ToString(CameraExtraDelay)", "\"info\"", "\"SmoothCamera\"" ] @@ -16889,7 +19104,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCameraDelay() + Object.Behavior::PropertyCameraExtraDelay()" + "CameraDelay + CameraExtraDelay" ] } ] @@ -17014,7 +19229,7 @@ "parameters": [ "Object", "__SmoothCamera.ForecastHistoryTime", - "GetArgumentAsNumber(\"Time\")" + "Time" ] }, { @@ -17024,7 +19239,7 @@ "parameters": [ "Object", "__SmoothCamera.ForecastHistoryX", - "GetArgumentAsNumber(\"ObjectX\")" + "ObjectX" ] }, { @@ -17034,7 +19249,7 @@ "parameters": [ "Object", "__SmoothCamera.ForecastHistoryY", - "GetArgumentAsNumber(\"ObjectY\")" + "ObjectY" ] } ], @@ -17073,7 +19288,7 @@ "Object", "__SmoothCamera.ForecastHistoryTime[0]", "<", - "TimeFromStart() - Object.Behavior::PropertyCameraDelay() - Object.Behavior::PropertyCameraExtraDelay() - Object.Behavior::PropertyForecastHistoryDuration()" + "TimeFromStart() - CameraDelay - CameraExtraDelay - ForecastHistoryDuration" ] } ], @@ -17165,7 +19380,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterX()" + "DelayedCenterX" ] }, { @@ -17176,7 +19391,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterY()" + "DelayedCenterY" ] } ] @@ -17289,7 +19504,7 @@ "Object", "Behavior", "+", - "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()])" + "Object.Variable(__SmoothCamera.ForecastHistoryX[Index])" ] }, { @@ -17375,7 +19590,7 @@ "Object", "Behavior", "+", - "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()])" + "Object.Variable(__SmoothCamera.ForecastHistoryY[Index])" ] }, { @@ -17418,7 +19633,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Mean: \" + ToString(Object.Behavior::PropertyForecastHistoryMeanX()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryMeanY())", + "\"Mean: \" + ToString(ForecastHistoryMeanX) + \" \" + ToString(ForecastHistoryMeanY)", "", "" ] @@ -17512,7 +19727,7 @@ "Object", "Behavior", "+", - "pow(Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanX(), 2)" + "pow(Object.Variable(__SmoothCamera.ForecastHistoryX[Index]) - ForecastHistoryMeanX, 2)" ] }, { @@ -17523,7 +19738,7 @@ "Object", "Behavior", "+", - "pow(Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanY(), 2)" + "pow(Object.Variable(__SmoothCamera.ForecastHistoryY[Index]) - ForecastHistoryMeanY, 2)" ] }, { @@ -17534,7 +19749,7 @@ "Object", "Behavior", "+", - "(Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanX())\n*\n(Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanY())" + "(Object.Variable(__SmoothCamera.ForecastHistoryX[Index]) - ForecastHistoryMeanX)\n*\n(Object.Variable(__SmoothCamera.ForecastHistoryY[Index]) - ForecastHistoryMeanY)" ] }, { @@ -17560,7 +19775,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Variances: \" + ToString(Object.Behavior::PropertyForecastHistoryVarianceX()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryVarianceY()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryCovariance())", + "\"Variances: \" + ToString(ForecastHistoryVarianceX) + \" \" + ToString(ForecastHistoryVarianceY) + \" \" + ToString(ForecastHistoryCovariance)", "\"info\"", "\"SmoothCamera\"" ] @@ -17575,7 +19790,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", "<", "1" ] @@ -17585,7 +19800,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())", + "abs(ForecastHistoryVarianceY)", "<", "1" ] @@ -17600,7 +19815,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterX()" + "DelayedCenterX" ] }, { @@ -17611,7 +19826,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterY()" + "DelayedCenterY" ] } ] @@ -17630,7 +19845,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", ">=", "1" ] @@ -17640,7 +19855,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())", + "abs(ForecastHistoryVarianceY)", ">=", "1" ] @@ -17679,9 +19894,9 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", ">=", - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())" + "abs(ForecastHistoryVarianceY)" ] } ], @@ -17694,7 +19909,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryCovariance() / Object.Behavior::PropertyForecastHistoryVarianceX()" + "ForecastHistoryCovariance / ForecastHistoryVarianceX" ] }, { @@ -17705,7 +19920,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryMeanY() - Object.Behavior::PropertyForecastHistoryLinearA() * Object.Behavior::PropertyForecastHistoryMeanX()" + "ForecastHistoryMeanY - ForecastHistoryLinearA * ForecastHistoryMeanX" ] } ], @@ -17720,7 +19935,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Linear: \" + ToString(Object.Behavior::PropertyForecastHistoryLinearA()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryLinearB())", + "\"Linear: \" + ToString(ForecastHistoryLinearA) + \" \" + ToString(ForecastHistoryLinearB)", "\"info\"", "\"SmoothCamera\"" ] @@ -17781,9 +19996,9 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", "<", - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())" + "abs(ForecastHistoryVarianceY)" ] } ], @@ -17796,7 +20011,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryCovariance() / Object.Behavior::PropertyForecastHistoryVarianceY()" + "ForecastHistoryCovariance / ForecastHistoryVarianceY" ] }, { @@ -17807,7 +20022,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryMeanX() - Object.Behavior::PropertyForecastHistoryLinearA() * Object.Behavior::PropertyForecastHistoryMeanY()" + "ForecastHistoryMeanX - ForecastHistoryLinearA * ForecastHistoryMeanY" ] } ], @@ -17822,7 +20037,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Linear: \" + ToString(Object.Behavior::PropertyForecastHistoryLinearA()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryLinearB())", + "\"Linear: \" + ToString(ForecastHistoryLinearA) + \" \" + ToString(ForecastHistoryLinearB)", "\"info\"", "\"SmoothCamera\"" ] @@ -17882,7 +20097,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedOldestX()" + "ProjectedOldestX" ] }, { @@ -17893,7 +20108,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedOldestY()" + "ProjectedOldestY" ] }, { @@ -17904,7 +20119,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyIndex()" + "Index" ] } ] @@ -17921,7 +20136,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestX()" + "ProjectedNewestX" ] }, { @@ -17932,7 +20147,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestY()" + "ProjectedNewestY" ] }, { @@ -17943,7 +20158,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyIndex()" + "Index" ] } ] @@ -17961,7 +20176,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Oldest: \" + ToString(Object.Behavior::PropertyProjectedOldestX()) + \" \" + ToString(Object.Behavior::PropertyProjectedOldestY())", + "\"Oldest: \" + ToString(ProjectedOldestX) + \" \" + ToString(ProjectedOldestY)", "\"info\"", "\"SmoothCamera\"" ] @@ -17978,7 +20193,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Newest: \" + ToString(Object.Behavior::PropertyProjectedNewestX()) + \" \" + ToString(Object.Behavior::PropertyProjectedNewestY())", + "\"Newest: \" + ToString(ProjectedNewestX) + \" \" + ToString(ProjectedNewestY)", "\"info\"", "\"SmoothCamera\"" ] @@ -18008,7 +20223,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestX() + ( Object.Behavior::PropertyProjectedNewestX() - Object.Behavior::PropertyProjectedOldestX()) * Object.Behavior::ForecastTimeRatio()" + "ProjectedNewestX + ( ProjectedNewestX - ProjectedOldestX) * Object.Behavior::ForecastTimeRatio()" ] }, { @@ -18019,7 +20234,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestY() + ( Object.Behavior::PropertyProjectedNewestY() - Object.Behavior::PropertyProjectedOldestY()) * Object.Behavior::ForecastTimeRatio()" + "ProjectedNewestY + ( ProjectedNewestY - ProjectedOldestY) * Object.Behavior::ForecastTimeRatio()" ] } ] @@ -18034,7 +20249,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Forecasted: \" + ToString(Object.Behavior::PropertyForecastedX()) + \" \" + ToString(Object.Behavior::PropertyForecastedY())", + "\"Forecasted: \" + ToString(ForecastedX) + \" \" + ToString(ForecastedY)", "\"info\"", "\"SmoothCamera\"" ] @@ -18103,7 +20318,7 @@ "Object", "Behavior", "=", - "(GetArgumentAsNumber(\"NewestX\") + (GetArgumentAsNumber(\"NewestY\") - Object.Behavior::PropertyForecastHistoryLinearB()) * Object.Behavior::PropertyForecastHistoryLinearA()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + "(NewestX + (NewestY - ForecastHistoryLinearB) * ForecastHistoryLinearA) / (1 + pow(ForecastHistoryLinearA, 2))" ] }, { @@ -18114,7 +20329,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"NewestY\") + (GetArgumentAsNumber(\"NewestX\") * Object.Behavior::PropertyForecastHistoryLinearA() - GetArgumentAsNumber(\"NewestY\") \n+ Object.Behavior::PropertyForecastHistoryLinearB()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + "NewestY + (NewestX * ForecastHistoryLinearA - NewestY \n+ ForecastHistoryLinearB) / (1 + pow(ForecastHistoryLinearA, 2))" ] } ] @@ -18131,7 +20346,7 @@ "Object", "Behavior", "=", - "(GetArgumentAsNumber(\"OldestX\") + (GetArgumentAsNumber(\"OldestY\") - Object.Behavior::PropertyForecastHistoryLinearB()) * Object.Behavior::PropertyForecastHistoryLinearA()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + "(OldestX + (OldestY - ForecastHistoryLinearB) * ForecastHistoryLinearA) / (1 + pow(ForecastHistoryLinearA, 2))" ] }, { @@ -18142,7 +20357,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"OldestY\") + (GetArgumentAsNumber(\"OldestX\") * Object.Behavior::PropertyForecastHistoryLinearA() - GetArgumentAsNumber(\"OldestY\") \n+ Object.Behavior::PropertyForecastHistoryLinearB()) / (1 + pow(Object.Behavior::PropertyForecastHistoryLinearA(), 2))" + "OldestY + (OldestX * ForecastHistoryLinearA - OldestY \n+ ForecastHistoryLinearB) / (1 + pow(ForecastHistoryLinearA, 2))" ] } ] @@ -18201,7 +20416,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "- Object.Behavior::PropertyForecastTime() / (Object.Variable(__SmoothCamera.ForecastHistoryTime[0]) - Object.Variable(__SmoothCamera.ForecastHistoryTime[Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime) - 1]))" + "- ForecastTime / (Object.Variable(__SmoothCamera.ForecastHistoryTime[0]) - Object.Variable(__SmoothCamera.ForecastHistoryTime[Object.VariableChildCount(__SmoothCamera.ForecastHistoryTime) - 1]))" ] } ] @@ -18761,7 +20976,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorFollowFreeAreaTop()", + "FloorFollowFreeAreaTop", "" ] }, @@ -18772,7 +20987,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorFollowFreeAreaBottom()", + "FloorFollowFreeAreaBottom", "" ] }, @@ -18783,7 +20998,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorUpwardSpeed()", + "FloorUpwardSpeed", "" ] }, @@ -18794,7 +21009,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorDownwardSpeed()", + "FloorDownwardSpeed", "" ] }, @@ -18805,7 +21020,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorUpwardSpeedMax()", + "FloorUpwardSpeedMax", "" ] }, @@ -18816,7 +21031,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorDownwardSpeedMax()", + "FloorDownwardSpeedMax", "" ] } @@ -18860,7 +21075,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirFollowFreeAreaTop()", + "AirFollowFreeAreaTop", "" ] }, @@ -18871,7 +21086,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirFollowFreeAreaBottom()", + "AirFollowFreeAreaBottom", "" ] }, @@ -18882,7 +21097,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirUpwardSpeed()", + "AirUpwardSpeed", "" ] }, @@ -18893,7 +21108,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirDownwardSpeed()", + "AirDownwardSpeed", "" ] }, @@ -18904,7 +21119,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirUpwardSpeedMax()", + "AirUpwardSpeedMax", "" ] }, @@ -18915,7 +21130,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirDownwardSpeedMax()", + "AirDownwardSpeedMax", "" ] } @@ -19103,7 +21318,7 @@ "name": "ButtonStates", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/753a9a794bd885058159b7509f06f5a8f67f72decfccb9a1b0efee26f41c3c4c_gesture-tap-button.svg", "shortDescription": "Use any object as a button and change appearance according to user interactions.", - "version": "1.1.0", + "version": "1.2.0", "description": [ "Use the \"Button states\" behavior to track user interactions with an object, including:", "", @@ -19145,7 +21360,7 @@ { "fullName": "", "functionType": "Action", - "name": "doStepPostEvents", + "name": "doStepPreEvents", "sentence": "", "events": [ { @@ -19319,8 +21534,8 @@ }, "parameters": [ "Object", - "TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)", - "TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)" + "TouchX(TouchId, Object.Layer(), 0)", + "TouchY(TouchId, Object.Layer(), 0)" ] } ], @@ -19390,8 +21605,8 @@ }, "parameters": [ "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)" + "TouchX(StartedTouchOrMouseId(Index), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Index), Object.Layer(), 0)" ] } ], @@ -19404,7 +21619,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { @@ -19677,7 +21892,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -20216,7 +22431,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -20334,7 +22549,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyIdleEffect()", + "IdleEffect", "yes" ] }, @@ -20345,7 +22560,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyFocusedEffect()", + "FocusedEffect", "no" ] }, @@ -20356,7 +22571,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyPressedEffect()", + "PressedEffect", "no" ] } @@ -20404,7 +22619,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyIdleEffect()", + "IdleEffect", "no" ] }, @@ -20415,7 +22630,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyFocusedEffect()", + "FocusedEffect", "no" ] }, @@ -20426,7 +22641,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyPressedEffect()", + "PressedEffect", "no" ] } @@ -20465,7 +22680,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyIdleEffect()", + "IdleEffect", "yes" ] } @@ -20504,7 +22719,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyFocusedEffect()", + "FocusedEffect", "yes" ] } @@ -20543,7 +22758,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyPressedEffect()", + "PressedEffect", "yes" ] } @@ -20585,7 +22800,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyIdleEffect()" + "IdleEffect" ] } ] @@ -20628,7 +22843,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -20666,7 +22881,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFocusedEffect()" + "FocusedEffect" ] } ] @@ -20709,7 +22924,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -20747,7 +22962,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyPressedEffect()" + "PressedEffect" ] } ] @@ -20790,7 +23005,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -20869,7 +23084,7 @@ "description": "Change the animation of buttons according to their state.", "fullName": "Button animation", "name": "ButtonAnimationName", - "objectType": "Sprite", + "objectType": "", "eventsFunctions": [ { "fullName": "", @@ -20889,7 +23104,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyIdleAnimationName()" + "IdleAnimationName" ] } ] @@ -20899,7 +23114,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -20949,7 +23163,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyIdleAnimationName()" + "IdleAnimationName" ] } ] @@ -20977,7 +23191,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyFocusedAnimationName()" + "FocusedAnimationName" ] } ] @@ -21005,7 +23219,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyPressedAnimationName()" + "PressedAnimationName" ] } ] @@ -21018,7 +23232,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -21047,7 +23260,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyIdleAnimationName()" + "IdleAnimationName" ] } ] @@ -21060,7 +23273,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -21091,7 +23303,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -21101,7 +23313,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -21130,7 +23341,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFocusedAnimationName()" + "FocusedAnimationName" ] } ] @@ -21143,7 +23354,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -21174,7 +23384,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -21184,7 +23394,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -21213,7 +23422,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyPressedAnimationName()" + "PressedAnimationName" ] } ] @@ -21226,7 +23435,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -21257,7 +23465,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -21267,7 +23475,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -21281,6 +23488,17 @@ } ], "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Animatable capability", + "description": "", + "group": "", + "extraInformation": [ + "AnimatableCapability::AnimatableBehavior" + ], + "name": "Animation" + }, { "value": "", "type": "Behavior", @@ -21346,7 +23564,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyIdleValue()" + "IdleValue" ] } ] @@ -21426,7 +23644,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyIdleValue()", + "IdleValue", "" ] } @@ -21482,7 +23700,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedValue()", + "FocusedValue", "" ] } @@ -21522,7 +23740,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedValue()", + "FocusedValue", "" ] } @@ -21574,7 +23792,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyPressedValue()", + "PressedValue", "" ] } @@ -21615,8 +23833,8 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFadeInDuration()", - "Object.Behavior::PropertyFadeInEasing()", + "FadeInDuration", + "FadeInEasing", "" ] } @@ -21645,8 +23863,8 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFadeOutDuration()", - "Object.Behavior::PropertyFadeOutEasing()", + "FadeOutDuration", + "FadeOutEasing", "" ] } @@ -21752,7 +23970,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyEffectValue()" + "EffectValue" ] }, { @@ -21763,7 +23981,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -21830,7 +24048,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyEffectValue()" + "EffectValue" ] }, { @@ -21841,7 +24059,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -21885,7 +24103,7 @@ "Object", "Behavior", "<", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] } ], @@ -21909,7 +24127,7 @@ "Object", "Behavior", "=", - "Tween::Ease(GetArgumentAsString(\"Easing\"), Object.Behavior::PropertyTweenInitialValue(), Object.Behavior::PropertyTweenTargetedValue(), Object.Behavior::PropertyTweenTime() / GetArgumentAsNumber(\"Duration\"))" + "Tween::Ease(Easing, TweenInitialValue, TweenTargetedValue, TweenTime / Duration)" ] } ] @@ -21925,7 +24143,7 @@ "Object", "Behavior", ">=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] } ], @@ -21949,7 +24167,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyTweenTargetedValue()" + "TweenTargetedValue" ] } ] @@ -21965,9 +24183,9 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyEffectName()", - "Object.Behavior::PropertyEffectProperty()", - "Object.Behavior::PropertyEffectValue()" + "EffectName", + "EffectProperty", + "EffectValue" ] } ] @@ -22016,7 +24234,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyEffectName()" + "EffectName" ] } ] @@ -22057,7 +24275,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyEffectProperty()" + "EffectProperty" ] } ] @@ -22102,7 +24320,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "NewEffectName" ] }, { @@ -22113,7 +24331,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "NewPropertyName" ] } ] @@ -22133,12 +24351,12 @@ }, { "description": "Effect name", - "name": "EffectName", + "name": "NewEffectName", "type": "string" }, { "description": "Parameter name", - "name": "PropertyName", + "name": "NewPropertyName", "type": "string" } ], @@ -22161,7 +24379,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyIdleValue()" + "IdleValue" ] } ] @@ -22204,7 +24422,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22242,7 +24460,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFocusedValue()" + "FocusedValue" ] } ] @@ -22285,7 +24503,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22323,7 +24541,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPressedValue()" + "PressedValue" ] } ] @@ -22366,7 +24584,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22404,7 +24622,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeInEasing()" + "FadeInEasing" ] } ] @@ -22448,7 +24666,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -22486,7 +24704,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeOutEasing()" + "FadeOutEasing" ] } ] @@ -22530,7 +24748,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -22568,7 +24786,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeInDuration()" + "FadeInDuration" ] } ] @@ -22611,7 +24829,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22649,7 +24867,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeOutDuration()" + "FadeOutDuration" ] } ] @@ -22692,7 +24910,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22963,7 +25181,7 @@ "description": "Smoothly resize buttons according to their state.", "fullName": "Button scale tween", "name": "ButtonScaleTween", - "objectType": "Sprite", + "objectType": "", "eventsFunctions": [ { "fullName": "", @@ -22983,7 +25201,7 @@ "Object", "Scale", "=", - "Object.Behavior::PropertyIdleScale()" + "IdleScale" ] } ] @@ -22993,7 +25211,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23064,7 +25281,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyIdleScale()", + "IdleScale", "" ] } @@ -23120,7 +25337,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedScale()", + "FocusedScale", "" ] } @@ -23160,7 +25377,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedScale()", + "FocusedScale", "" ] } @@ -23212,7 +25429,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyPressedScale()", + "PressedScale", "" ] } @@ -23226,7 +25443,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23257,10 +25473,10 @@ "Object", "Tween", "\"__ButtonScaleTween.Fade\"", - "GetArgumentAsNumber(\"Value\")", - "GetArgumentAsNumber(\"Value\")", - "Object.Behavior::PropertyFadeInEasing()", - "1000 * Object.Behavior::PropertyFadeInDuration()", + "Value", + "Value", + "FadeInEasing", + "1000 * FadeInDuration", "no", "yes" ] @@ -23272,7 +25488,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23308,10 +25523,10 @@ "Object", "Tween", "\"__ButtonScaleTween.Fade\"", - "GetArgumentAsNumber(\"Value\")", - "GetArgumentAsNumber(\"Value\")", - "Object.Behavior::PropertyFadeOutEasing()", - "1000 * Object.Behavior::PropertyFadeOutDuration()", + "Value", + "Value", + "FadeOutEasing", + "1000 * FadeOutDuration", "no", "yes" ] @@ -23323,7 +25538,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23357,7 +25571,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyIdleScale()" + "IdleScale" ] } ] @@ -23370,7 +25584,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23401,7 +25614,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23411,7 +25624,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23440,7 +25652,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFocusedScale()" + "FocusedScale" ] } ] @@ -23453,7 +25665,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23484,7 +25695,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23494,7 +25705,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23523,7 +25733,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPressedScale()" + "PressedScale" ] } ] @@ -23536,7 +25746,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23567,7 +25776,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23577,7 +25786,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23606,7 +25814,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeInDuration()" + "FadeInDuration" ] } ] @@ -23619,7 +25827,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23650,7 +25857,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23660,7 +25867,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23689,7 +25895,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeOutDuration()" + "FadeOutDuration" ] } ] @@ -23702,7 +25908,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23733,7 +25938,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23743,7 +25948,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23772,7 +25976,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeInEasing()" + "FadeInEasing" ] } ] @@ -23786,7 +25990,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23817,7 +26020,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -23827,7 +26030,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23856,7 +26058,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeOutEasing()" + "FadeOutEasing" ] } ] @@ -23870,7 +26072,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23901,7 +26102,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -23911,7 +26112,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23925,6 +26125,17 @@ } ], "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Scalable capability", + "description": "", + "group": "", + "extraInformation": [ + "ScalableCapability::ScalableBehavior" + ], + "name": "Scale" + }, { "value": "", "type": "Behavior", @@ -24122,7 +26333,7 @@ }, "parameters": [ "Object", - "Object.Behavior::PropertyIdleColorTint()" + "IdleColorTint" ] } ] @@ -24203,7 +26414,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyIdleColorTint()", + "IdleColorTint", "" ] } @@ -24259,7 +26470,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedColorTint()", + "FocusedColorTint", "" ] } @@ -24299,7 +26510,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedColorTint()", + "FocusedColorTint", "" ] } @@ -24351,7 +26562,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyPressedColorTint()", + "PressedColorTint", "" ] } @@ -24396,9 +26607,9 @@ "Object", "Tween", "\"__ButtonColorTintTween.Fade\"", - "GetArgumentAsString(\"Value\")", - "Object.Behavior::PropertyFadeInEasing()", - "1000 * Object.Behavior::PropertyFadeInDuration()", + "Value", + "FadeInEasing", + "1000 * FadeInDuration", "no", "yes" ] @@ -24446,9 +26657,9 @@ "Object", "Tween", "\"__ButtonColorTintTween.Fade\"", - "GetArgumentAsString(\"Value\")", - "Object.Behavior::PropertyFadeOutEasing()", - "1000 * Object.Behavior::PropertyFadeOutDuration()", + "Value", + "FadeOutEasing", + "1000 * FadeOutDuration", "no", "yes" ] @@ -24494,7 +26705,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyIdleColorTint()" + "IdleColorTint" ] } ] @@ -24538,7 +26749,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -24577,7 +26788,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFocusedColorTint()" + "FocusedColorTint" ] } ] @@ -24621,7 +26832,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -24660,7 +26871,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyPressedColorTint()" + "PressedColorTint" ] } ] @@ -24704,7 +26915,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -24743,7 +26954,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeInDuration()" + "FadeInDuration" ] } ] @@ -24787,7 +26998,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -24826,7 +27037,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeOutDuration()" + "FadeOutDuration" ] } ] @@ -24870,7 +27081,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -24909,7 +27120,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeInEasing()" + "FadeInEasing" ] } ] @@ -24954,7 +27165,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -24993,7 +27204,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeOutEasing()" + "FadeOutEasing" ] } ] @@ -25038,7 +27249,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -25247,7 +27458,7 @@ "name": "PlatformerCharacterAnimator", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Glyphster Pack/Master/SVG/Sports and Fitness/Sports and Fitness_training_running_run.svg", "shortDescription": "Change animations and horizontal flipping of a platformer character automatically.", - "version": "1.1.0", + "version": "1.1.2", "description": [ "Automatically change the animations and horizontal flipping of a platformer character based on movement and interaction with platform objects.", "", @@ -25452,7 +27663,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyJumpAnimationName()" + "JumpAnimationName" ] } ] @@ -25485,7 +27696,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyFallAnimationName()" + "FallAnimationName" ] } ] @@ -25533,7 +27744,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyRunAnimationName()" + "RunAnimationName" ] } ] @@ -25567,7 +27778,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyIdleAnimationName()" + "IdleAnimationName" ] } ] @@ -25608,7 +27819,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyClimbAnimationName()" + "ClimbAnimationName" ] } ] @@ -25888,7 +28099,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyJumpAnimationName()" + "JumpAnimationName" ] } ] @@ -25915,7 +28126,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyFallAnimationName()" + "FallAnimationName" ] } ] @@ -25957,7 +28168,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyRunAnimationName()" + "RunAnimationName" ] } ] @@ -25985,7 +28196,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyIdleAnimationName()" + "IdleAnimationName" ] } ] @@ -26019,7 +28230,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyClimbAnimationName()" + "ClimbAnimationName" ] } ] @@ -26155,7 +28366,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"EnableAnimationChanges\"" + "\"Value\"" ] } ], @@ -26188,7 +28399,7 @@ { "defaultValue": "yes", "description": "Change animations automatically", - "name": "EnableAnimationChanges", + "name": "Value", "optional": true, "type": "yesorno" } @@ -26226,7 +28437,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"EnableHorizontalFlipping\"" + "\"Value\"" ] } ], @@ -26259,7 +28470,7 @@ { "defaultValue": "yes", "description": "Enable horizontal flipping", - "name": "EnableHorizontalFlipping", + "name": "Value", "optional": true, "type": "yesorno" } @@ -26286,7 +28497,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"AnimationName\")" + "Value" ] } ] @@ -26306,7 +28517,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -26332,7 +28543,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"AnimationName\")" + "Value" ] } ] @@ -26352,7 +28563,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -26378,7 +28589,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"AnimationName\")" + "Value" ] } ] @@ -26398,7 +28609,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -26424,7 +28635,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"AnimationName\")" + "Value" ] } ] @@ -26444,7 +28655,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -26470,7 +28681,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"AnimationName\")" + "Value" ] } ] @@ -26490,7 +28701,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -26610,7 +28821,7 @@ "name": "RectangleMovement", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/shape-rectangle-plus.svg", "shortDescription": "Move objects in a rectangular pattern.", - "version": "1.2.0", + "version": "1.2.2", "description": [ "Move objects in a rectangular pattern with easing functions from the Tween extension.", "", @@ -27825,7 +30036,7 @@ "Object", "Behavior", "+", - "Object.X() - Object.Behavior::PropertyOldX()" + "Object.X() - OldX" ] }, { @@ -27836,7 +30047,7 @@ "Object", "Behavior", "+", - "Object.Y() - Object.Behavior::PropertyOldY()" + "Object.Y() - OldY" ] } ] @@ -27864,9 +30075,9 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyLeft() + Object.Behavior::DeltaX()", + "Left + Object.Behavior::DeltaX()", "=", - "Object.Behavior::PropertyTop() + Object.Behavior::DeltaY()" + "Top + Object.Behavior::DeltaY()" ] } ] @@ -27967,7 +30178,7 @@ "Object", "Behavior", "=", - "mod(Object.Behavior::PropertyProgress() + TimeDelta() / Object.Behavior::LoopDuration(), 1)" + "mod(Progress + TimeDelta() / Object.Behavior::LoopDuration(), 1)" ] } ] @@ -27995,7 +30206,7 @@ "Object", "Behavior", "=", - "mod(Object.Behavior::PropertyProgress() - TimeDelta() / Object.Behavior::LoopDuration(), 1)" + "mod(Progress - TimeDelta() / Object.Behavior::LoopDuration(), 1)" ] } ] @@ -28031,7 +30242,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Corner\")", + "Corner", "=", "\"Top-left corner\"" ] @@ -28059,7 +30270,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Corner\")", + "Corner", "=", "\"Top-right corner\"" ] @@ -28087,7 +30298,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Corner\")", + "Corner", "=", "\"Bottom-right corner\"" ] @@ -28115,7 +30326,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Corner\")", + "Corner", "=", "\"Bottom-left corner\"" ] @@ -28174,7 +30385,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "2 * (abs(Object.Behavior::PropertyWidth()) + abs(Object.Behavior::PropertyHeight()))" + "2 * (abs(Width) + abs(Height))" ] } ] @@ -28214,7 +30425,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "2 * (Object.Behavior::PropertyHorizontalEdgeDuration() + Object.Behavior::PropertyVerticalEdgeDuration())" + "2 * (HorizontalEdgeDuration + VerticalEdgeDuration)" ] } ] @@ -28254,7 +30465,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHorizontalEdgeDuration()" + "HorizontalEdgeDuration" ] } ] @@ -28294,7 +30505,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyVerticalEdgeDuration()" + "VerticalEdgeDuration" ] } ] @@ -28335,7 +30546,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyWidth()" + "Width" ] } ] @@ -28376,7 +30587,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHeight()" + "Height" ] } ] @@ -28417,7 +30628,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyLeft()" + "Left" ] } ] @@ -28458,7 +30669,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTop()" + "Top" ] } ] @@ -28499,7 +30710,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyLeft() + Object.Behavior::PropertyWidth()" + "Left + Width" ] } ] @@ -28540,7 +30751,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTop() + Object.Behavior::PropertyHeight()" + "Top + Height" ] } ] @@ -28584,7 +30795,7 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyLeft() - GetArgumentAsNumber(\"Value\")" + "Left - Value" ] }, { @@ -28595,7 +30806,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28641,7 +30852,7 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyTop() - GetArgumentAsNumber(\"Value\")" + "Top - Value" ] }, { @@ -28652,7 +30863,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28698,7 +30909,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\") - Object.Behavior::PropertyLeft()" + "Value - Left" ] } ] @@ -28744,7 +30955,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\") - Object.Behavior::PropertyTop()" + "Value - Top" ] } ] @@ -28790,7 +31001,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28836,7 +31047,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28962,7 +31173,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -28982,7 +31193,7 @@ }, { "description": "Easing", - "name": "Easing", + "name": "Value", "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", "type": "stringWithSelector" } @@ -29762,7 +31973,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHorizontalEdgeDuration()" + "HorizontalEdgeDuration" ] } ] @@ -29803,7 +32014,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHorizontalEdgeDuration() + Object.Behavior::PropertyVerticalEdgeDuration()" + "HorizontalEdgeDuration + VerticalEdgeDuration" ] } ] @@ -29844,7 +32055,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "2 * Object.Behavior::PropertyHorizontalEdgeDuration() + Object.Behavior::PropertyVerticalEdgeDuration()" + "2 * HorizontalEdgeDuration + VerticalEdgeDuration" ] } ] @@ -29885,7 +32096,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::HalfCurrentTime() / Object.Behavior::PropertyHorizontalEdgeDuration()" + "Object.Behavior::HalfCurrentTime() / HorizontalEdgeDuration" ] } ] @@ -29900,7 +32111,7 @@ "parameters": [ "Object.Behavior::HalfCurrentTime()", ">=", - "abs(Object.Behavior::PropertyHorizontalEdgeDuration())" + "abs(HorizontalEdgeDuration)" ] } ], @@ -29910,7 +32121,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "(Object.Behavior::HalfCurrentTime() - Object.Behavior::PropertyHorizontalEdgeDuration()) / Object.Behavior::PropertyVerticalEdgeDuration()" + "(Object.Behavior::HalfCurrentTime() - HorizontalEdgeDuration) / VerticalEdgeDuration" ] } ] @@ -29972,7 +32183,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyWidth()" + "Width" ] } ] @@ -30034,7 +32245,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHeight()" + "Height" ] } ] @@ -30096,7 +32307,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHeight()" + "Height" ] } ] @@ -30148,7 +32359,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyWidth()" + "Width" ] } ] @@ -30189,7 +32400,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyProgress() * Object.Behavior::LoopDuration()" + "Progress * Object.Behavior::LoopDuration()" ] } ] @@ -30230,7 +32441,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object. Behavior::LoopDuration() * mod(Object.Behavior::PropertyProgress(), 0.5)" + "Object. Behavior::LoopDuration() * mod(Progress, 0.5)" ] } ] @@ -30271,7 +32482,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Tween::Ease(Object.Behavior::PropertyEasing(), Object.Behavior::EdgeOriginX(), Object.Behavior::EdgeTargetX(), Object.Behavior::EdgeProgress())" + "Tween::Ease(Easing, Object.Behavior::EdgeOriginX(), Object.Behavior::EdgeTargetX(), Object.Behavior::EdgeProgress())" ] } ] @@ -30312,7 +32523,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Tween::Ease(Object.Behavior::PropertyEasing(), Object.Behavior::EdgeOriginY(), Object.Behavior::EdgeTargetY(), Object.Behavior::EdgeProgress())" + "Tween::Ease(Easing, Object.Behavior::EdgeOriginY(), Object.Behavior::EdgeTargetY(), Object.Behavior::EdgeProgress())" ] } ] @@ -30520,7 +32731,7 @@ "name": "PanelSpriteButton", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg", "shortDescription": "A button that can be customized.", - "version": "1.4.4", + "version": "1.4.6", "description": [ "The button can be customized with a background for each state and a label. It handles user interactions and a simple condition can be used to check if it is clicked.", "", @@ -30726,8 +32937,8 @@ }, "parameters": [ "Object", - "TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)", - "TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)" + "TouchX(TouchId, Object.Layer(), 0)", + "TouchY(TouchId, Object.Layer(), 0)" ] } ], @@ -30797,8 +33008,8 @@ }, "parameters": [ "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)" + "TouchX(StartedTouchOrMouseId(Index), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Index), Object.Layer(), 0)" ] } ], @@ -30811,7 +33022,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { @@ -31084,7 +33295,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -31623,7 +33834,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -31730,6 +33941,7 @@ "defaultName": "Button", "description": "A button that can be customized.", "fullName": "Button (panel sprite)", + "isUsingLegacyInstancesRenderer": true, "name": "PanelSpriteButton", "eventsFunctions": [ { @@ -32358,66 +34570,83 @@ ] } ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Idle", - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Idle", - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "PanelSpriteButton::Scale" - }, - "parameters": [ - "Object", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Idle.Variable(Width)" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Idle.Variable(Height)" - ] - }, + "actions": [], + "events": [ { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" - }, - "parameters": [ - "Object", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Width", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Height", + "=", + "Object.Height()" + ] + }, + { + "type": { + "value": "PanelSpriteButton::Scale" + }, + "parameters": [ + "Object", + "=", + "1" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Background", + "=", + "Width" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Background", + "=", + "Height" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "variables": [ + { + "name": "Width", + "type": "number", + "value": 0 + }, + { + "name": "Height", + "type": "number", + "value": 0 + } ] } ] @@ -32684,7 +34913,7 @@ "parameters": [ "Label", "=", - "GetArgumentAsString(\"LabelText\")" + "LabelText" ] }, { @@ -33120,6 +35349,7 @@ "text": "Text", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 20, "color": "0;0;0" } @@ -34657,6 +36887,5 @@ "windowMask": false } } - ], - "externalSourceFiles": [] + ] } \ No newline at end of file diff --git a/examples/platformer/assets/rotate-screen-icon.png b/examples/platformer/assets/rotate-screen-icon.png new file mode 100644 index 000000000..a7726dee3 Binary files /dev/null and b/examples/platformer/assets/rotate-screen-icon.png differ diff --git a/examples/platformer/platformer.json b/examples/platformer/platformer.json index c6047bd19..08030f4f9 100644 --- a/examples/platformer/platformer.json +++ b/examples/platformer/platformer.json @@ -1,9 +1,9 @@ { "firstLayout": "", "gdVersion": { - "build": 216, + "build": 221, "major": 5, - "minor": 4, + "minor": 5, "revision": 0 }, "properties": { @@ -18,7 +18,6 @@ "scaleMode": "linear", "sizeOnStartupMode": "adaptWidth", "templateSlug": "", - "useExternalSourceFiles": false, "version": "1.2.1", "name": "Platformer", "description": "An example of a basic platformer (Mario-like) game. Jump around and collect as many coins as you can!", @@ -148,7 +147,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Idle_1.png", "kind": "image", "metadata": "", @@ -157,7 +155,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Red hero_Idle_2.png", "kind": "image", "metadata": "", @@ -166,7 +163,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Idle_3.png", "kind": "image", "metadata": "", @@ -175,7 +171,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Red hero_Idle_4.png", "kind": "image", "metadata": "", @@ -184,7 +179,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_1.png", "kind": "image", "metadata": "", @@ -193,7 +187,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_2.png", "kind": "image", "metadata": "", @@ -202,7 +195,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_3.png", "kind": "image", "metadata": "", @@ -211,7 +203,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_4.png", "kind": "image", "metadata": "", @@ -220,7 +211,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_5.png", "kind": "image", "metadata": "", @@ -229,7 +219,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_6.png", "kind": "image", "metadata": "", @@ -238,7 +227,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_7.png", "kind": "image", "metadata": "", @@ -247,7 +235,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_8.png", "kind": "image", "metadata": "", @@ -256,7 +243,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_9.png", "kind": "image", "metadata": "", @@ -265,7 +251,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_10.png", "kind": "image", "metadata": "", @@ -274,7 +259,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_11.png", "kind": "image", "metadata": "", @@ -283,7 +267,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_12.png", "kind": "image", "metadata": "", @@ -292,7 +275,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_13.png", "kind": "image", "metadata": "", @@ -301,7 +283,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_14.png", "kind": "image", "metadata": "", @@ -310,7 +291,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_15.png", "kind": "image", "metadata": "", @@ -319,7 +299,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_16.png", "kind": "image", "metadata": "", @@ -328,7 +307,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_17.png", "kind": "image", "metadata": "", @@ -337,7 +315,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_18.png", "kind": "image", "metadata": "", @@ -346,7 +323,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Run_19.png", "kind": "image", "metadata": "", @@ -355,7 +331,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Jump.png", "kind": "image", "metadata": "", @@ -364,7 +339,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Climb_1.png", "kind": "image", "metadata": "", @@ -373,7 +347,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Climb_2.png", "kind": "image", "metadata": "", @@ -382,7 +355,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Climb_3.png", "kind": "image", "metadata": "", @@ -391,7 +363,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Climb_4.png", "kind": "image", "metadata": "", @@ -400,7 +371,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Red hero_Climb_5.png", "kind": "image", "metadata": "", @@ -409,7 +379,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Red hero_Climb_6.png", "kind": "image", "metadata": "", @@ -418,7 +387,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Climb_7.png", "kind": "image", "metadata": "", @@ -427,7 +395,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Climb_8.png", "kind": "image", "metadata": "", @@ -436,7 +403,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Climb_9.png", "kind": "image", "metadata": "", @@ -445,7 +411,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Climb_10.png", "kind": "image", "metadata": "", @@ -454,7 +419,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Climb_11.png", "kind": "image", "metadata": "", @@ -463,7 +427,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Climb_12.png", "kind": "image", "metadata": "", @@ -472,7 +435,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Red hero_Fall.png", "kind": "image", "metadata": "", @@ -481,7 +443,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Platform 1.png", "kind": "image", "metadata": "", @@ -490,7 +451,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Platform 2.png", "kind": "image", "metadata": "", @@ -499,7 +459,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Platform 3.png", "kind": "image", "metadata": "", @@ -508,7 +467,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Corner platform.png", "kind": "image", "metadata": "", @@ -517,7 +475,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Door.png", "kind": "image", "metadata": "", @@ -526,7 +483,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Checkpoint_1.png", "kind": "image", "metadata": "", @@ -535,7 +491,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Checkpoint_2.png", "kind": "image", "metadata": "", @@ -544,7 +499,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Checkpoint_3.png", "kind": "image", "metadata": "", @@ -553,7 +507,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Checkpoint_4.png", "kind": "image", "metadata": "", @@ -562,7 +515,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Clouds.png", "kind": "image", "metadata": "", @@ -571,7 +523,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Moon.png", "kind": "image", "metadata": "", @@ -580,7 +531,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Fly_1.png", "kind": "image", "metadata": "", @@ -589,7 +539,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Fly_2.png", "kind": "image", "metadata": "", @@ -598,7 +547,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Fly_3.png", "kind": "image", "metadata": "", @@ -607,7 +555,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Fly_4.png", "kind": "image", "metadata": "", @@ -616,7 +563,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Fly_5.png", "kind": "image", "metadata": "", @@ -625,7 +571,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Fly_6.png", "kind": "image", "metadata": "", @@ -634,7 +579,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Fly_7.png", "kind": "image", "metadata": "", @@ -643,7 +587,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Fly_8.png", "kind": "image", "metadata": "", @@ -652,7 +595,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Fly_9.png", "kind": "image", "metadata": "", @@ -661,7 +603,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Fly_10.png", "kind": "image", "metadata": "", @@ -670,7 +611,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Monster_Idle_1.png", "kind": "image", "metadata": "", @@ -679,7 +619,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Monster_Idle_2.png", "kind": "image", "metadata": "", @@ -688,7 +627,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Monster_Fire_1.png", "kind": "image", "metadata": "", @@ -697,7 +635,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Monster_Fire_2.png", "kind": "image", "metadata": "", @@ -706,7 +643,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Monster_Fire_3.png", "kind": "image", "metadata": "", @@ -715,7 +651,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Monster_Fire_4.png", "kind": "image", "metadata": "", @@ -724,7 +659,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Monster_Fire_5.png", "kind": "image", "metadata": "", @@ -733,7 +667,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Monster_Fire_6.png", "kind": "image", "metadata": "", @@ -742,7 +675,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Monster_Fire_7.png", "kind": "image", "metadata": "", @@ -751,7 +683,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Monster_Fire_8.png", "kind": "image", "metadata": "", @@ -760,7 +691,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Monster_Fire_9.png", "kind": "image", "metadata": "", @@ -769,7 +699,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Monster_Fire_10.png", "kind": "image", "metadata": "", @@ -778,7 +707,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/tiled_Background.png", "kind": "image", "metadata": "", @@ -787,7 +715,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Coin.png", "kind": "image", "metadata": "", @@ -796,7 +723,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ladder.png", "kind": "image", "metadata": "", @@ -805,7 +731,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/boundary.png", "kind": "image", "metadata": "", @@ -814,7 +739,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/gui/Top arrow round button.png", "kind": "image", "metadata": "", @@ -823,7 +747,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/gui/shadedDark45.png", "kind": "image", "metadata": "", @@ -832,7 +755,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Purple Button With Shadow_Hovered.png", "kind": "image", "metadata": "", @@ -845,7 +767,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Purple Button With Shadow_Idle.png", "kind": "image", "metadata": "", @@ -858,7 +779,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Purple Button With Shadow_Pressed.png", "kind": "image", "metadata": "", @@ -882,7 +802,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/gui/Thumbstick_Dark.png", "kind": "image", "metadata": "", @@ -891,7 +810,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/gui/Thumbstick Boundary_Dark160.png", "kind": "image", "metadata": "", @@ -900,13 +818,24 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/gui/black.png", "kind": "image", "metadata": "", "name": "assets\\gui\\black.png", "smoothed": true, "userAdded": true + }, + { + "file": "assets/rotate-screen-icon.png", + "kind": "image", + "metadata": "", + "name": "rotate-screen-icon.png", + "smoothed": true, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Mobile Layouts/assets/6a8102ce3340bf9f62300ee1a81ef0b2327b2c6e8d62d7dda68d547f5e2b5969_rotate-screen-icon.png", + "name": "rotate-screen-icon.png" + } } ], "resourceFolders": [] @@ -1098,21 +1027,6 @@ "stringProperties": [], "initialVariables": [] }, - { - "angle": 0, - "customSize": true, - "height": 160, - "layer": "UI", - "name": "JumpButton", - "persistentUuid": "8e48ab68-c147-4828-9609-d7cc250c52a1", - "width": 160, - "x": 816, - "y": 432, - "zOrder": 28, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, { "angle": 0, "customSize": true, @@ -1553,21 +1467,6 @@ "stringProperties": [], "initialVariables": [] }, - { - "angle": 0, - "customSize": false, - "height": 160, - "layer": "UI", - "name": "Joystick", - "persistentUuid": "fcbc25c5-15d6-4b85-a6ec-08b9140c8cb7", - "width": 160, - "x": 144, - "y": 432, - "zOrder": 62, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, { "angle": 0, "customSize": false, @@ -5730,7 +5629,8 @@ "TouchID": 0, "TouchDistance": 0, "TouchCounter": 0, - "IsReleased": false + "IsReleased": false, + "Radius": 200 } ], "animations": [ @@ -5793,6 +5693,141 @@ ] } ] + }, + { + "assetStoreId": "e5919fb86a559b00001678c710efe55f4e9f2e032a9ff9610087370f998d57de", + "name": "ScreenOrientationChecker", + "type": "ScreenOrientationChecker::ScreenOrientationChecker", + "variables": [], + "effects": [], + "behaviors": [ + { + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "name": "Anchor", + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "type": "AnchorBehavior::AnchorBehavior", + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "IsForceShown": false, + "BackgroundColor": "24;24;24", + "CornerRadius": 8, + "Padding": 5 + }, + "childrenContent": { + "BackgroundPainter": { + "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 + } + }, + "Icon": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "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 + } + ] + ] + } + ] + } + ] + } + ] + }, + "Text": { + "bold": true, + "italic": false, + "smoothed": true, + "underlined": false, + "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, + "color": "255;255;255" + } + } + } } ], "objectsFolderStructure": { @@ -5889,6 +5924,9 @@ }, { "objectName": "GameOverDialog" + }, + { + "objectName": "ScreenOrientationChecker" } ] }, @@ -5966,6 +6004,86 @@ ], "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": [ + "Joystick" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Joystick", + "", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "Joystick", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "Joystick", + "CursorX(\"UI\")" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -6032,31 +6150,6 @@ ] } ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "SystemInfo::HasTouchScreen" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Delete" - }, - "parameters": [ - "MobileControls", - "" - ] - } - ] } ], "parameters": [] @@ -7333,23 +7426,7 @@ "width": 0 } ], - "effects": [ - { - "effectType": "Scene3D::HemisphereLight", - "name": "3D Light", - "doubleParameters": { - "elevation": 45, - "intensity": 1, - "rotation": 0 - }, - "stringParameters": { - "groundColor": "64;64;64", - "skyColor": "255;255;255", - "top": "Y-" - }, - "booleanParameters": {} - } - ] + "effects": [] }, { "ambientLightColorB": 9191608, @@ -8392,7 +8469,7 @@ "name": "PanelSpriteButton", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg", "shortDescription": "A button that can be customized.", - "version": "1.4.5", + "version": "1.4.6", "description": [ "The button can be customized with a background for each state and a label. It handles user interactions and a simple condition can be used to check if it is clicked.", "", @@ -10231,66 +10308,83 @@ ] } ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Idle", - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Idle", - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "PanelSpriteButton::Scale" - }, - "parameters": [ - "Object", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Idle.Variable(Width)" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Idle.Variable(Height)" - ] - }, + "actions": [], + "events": [ { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" - }, - "parameters": [ - "Object", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Width", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Height", + "=", + "Object.Height()" + ] + }, + { + "type": { + "value": "PanelSpriteButton::Scale" + }, + "parameters": [ + "Object", + "=", + "1" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Background", + "=", + "Width" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Background", + "=", + "Height" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "variables": [ + { + "name": "Width", + "type": "number", + "value": 0 + }, + { + "name": "Height", + "type": "number", + "value": 0 + } ] } ] @@ -11127,7 +11221,7 @@ "name": "PlatformerCharacterAnimator", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Glyphster Pack/Master/SVG/Sports and Fitness/Sports and Fitness_training_running_run.svg", "shortDescription": "Change animations and horizontal flipping of a platformer character automatically.", - "version": "1.1.1", + "version": "1.1.2", "description": [ "Automatically change the animations and horizontal flipping of a platformer character based on movement and interaction with platform objects.", "", @@ -12035,7 +12129,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"EnableAnimationChanges\"" + "\"Value\"" ] } ], @@ -12068,7 +12162,7 @@ { "defaultValue": "yes", "description": "Change animations automatically", - "name": "EnableAnimationChanges", + "name": "Value", "optional": true, "type": "yesorno" } @@ -12106,7 +12200,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"EnableHorizontalFlipping\"" + "\"Value\"" ] } ], @@ -12139,7 +12233,7 @@ { "defaultValue": "yes", "description": "Enable horizontal flipping", - "name": "EnableHorizontalFlipping", + "name": "Value", "optional": true, "type": "yesorno" } @@ -12166,7 +12260,7 @@ "Object", "Behavior", "=", - "AnimationName" + "Value" ] } ] @@ -12186,7 +12280,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -12212,7 +12306,7 @@ "Object", "Behavior", "=", - "AnimationName" + "Value" ] } ] @@ -12232,7 +12326,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -12258,7 +12352,7 @@ "Object", "Behavior", "=", - "AnimationName" + "Value" ] } ] @@ -12278,7 +12372,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -12304,7 +12398,7 @@ "Object", "Behavior", "=", - "AnimationName" + "Value" ] } ] @@ -12324,7 +12418,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -12350,7 +12444,7 @@ "Object", "Behavior", "=", - "AnimationName" + "Value" ] } ] @@ -12370,7 +12464,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -12490,7 +12584,7 @@ "name": "RectangleMovement", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/shape-rectangle-plus.svg", "shortDescription": "Move objects in a rectangular pattern.", - "version": "1.2.1", + "version": "1.2.2", "description": [ "Move objects in a rectangular pattern with easing functions from the Tween extension.", "", @@ -14862,7 +14956,7 @@ }, { "description": "Easing", - "name": "Easing", + "name": "Value", "supplementaryInformation": "[\"linear\",\"easeInQuad\",\"easeOutQuad\",\"easeInOutQuad\",\"easeInCubic\",\"easeOutCubic\",\"easeInOutCubic\",\"easeInQuart\",\"easeOutQuart\",\"easeInOutQuart\",\"easeInQuint\",\"easeOutQuint\",\"easeInOutQuint\",\"easeInOutSine\",\"easeInExpo\",\"easeOutExpo\",\"easeInOutExpo\",\"easeInCirc\",\"easeOutCirc\",\"easeInOutCirc\",\"easeOutBounce\",\"easeInBack\",\"easeOutBack\",\"easeInOutBack\",\"elastic\",\"swingFromTo\",\"swingFrom\",\"swingTo\",\"bounce\",\"bouncePast\",\"easeFromTo\",\"easeFrom\",\"easeTo\"]", "type": "stringWithSelector" } @@ -16400,7 +16494,7 @@ "name": "SmoothCamera", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Computers and Hardware/Computers and Hardware_camcoder_gopro_go_pro_camera.svg", "shortDescription": "Smoothly scroll to follow an object.", - "version": "0.3.2", + "version": "0.3.3", "description": [ "The camera follows an object according to:", "- a frame rate independent catch-up speed to make the scrolling from smooth to strong", @@ -17150,7 +17244,7 @@ "Object", "Behavior", "=", - "TimeFromStart() + WaitingDuration" + "TimeFromStart() + NewWaitingDuration" ] }, { @@ -17161,7 +17255,7 @@ "Object", "Behavior", "=", - "WaitingSpeedXMax" + "NewWaitingSpeedXMax" ] }, { @@ -17172,7 +17266,7 @@ "Object", "Behavior", "=", - "WaitingSpeedYMax" + "NewWaitingSpeedYMax" ] }, { @@ -17183,7 +17277,7 @@ "Object", "Behavior", "=", - "CatchUpDuration" + "NewCatchUpDuration" ] } ] @@ -17220,22 +17314,22 @@ }, { "description": "Waiting duration (in seconds)", - "name": "WaitingDuration", + "name": "NewWaitingDuration", "type": "expression" }, { "description": "Waiting maximum camera target speed X", - "name": "WaitingSpeedXMax", + "name": "NewWaitingSpeedXMax", "type": "expression" }, { "description": "Waiting maximum camera target speed Y", - "name": "WaitingSpeedYMax", + "name": "NewWaitingSpeedYMax", "type": "expression" }, { "description": "Catch up duration (in seconds)", - "name": "CatchUpDuration", + "name": "NewCatchUpDuration", "type": "expression" } ], @@ -17608,7 +17702,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"FollowOnX\"" + "\"Value\"" ] } ], @@ -17640,7 +17734,7 @@ }, { "description": "Follow on X axis", - "name": "FollowOnX", + "name": "Value", "type": "yesorno" } ], @@ -17678,7 +17772,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"FollowOnY\"" + "\"Value\"" ] } ], @@ -17710,7 +17804,7 @@ }, { "description": "Follow on Y axis", - "name": "FollowOnY", + "name": "Value", "type": "yesorno" } ], @@ -17736,7 +17830,7 @@ "Object", "Behavior", "=", - "max(0, SetFollowFreeAreaRight)" + "max(0, Value)" ] } ] @@ -17756,7 +17850,7 @@ }, { "description": "Follow free area right border", - "name": "SetFollowFreeAreaRight", + "name": "Value", "type": "expression" } ], @@ -17782,7 +17876,7 @@ "Object", "Behavior", "=", - "max(0, SetFollowFreeAreaLeft)" + "max(0, Value)" ] } ] @@ -17802,7 +17896,7 @@ }, { "description": "Follow free area left border", - "name": "SetFollowFreeAreaLeft", + "name": "Value", "type": "expression" } ], @@ -17828,7 +17922,7 @@ "Object", "Behavior", "=", - "max(0, FollowFreeAreaTop)" + "max(0, Value)" ] } ] @@ -17848,7 +17942,7 @@ }, { "description": "Follow free area top border", - "name": "FollowFreeAreaTop", + "name": "Value", "type": "expression" } ], @@ -17874,7 +17968,7 @@ "Object", "Behavior", "=", - "max(0, SetFollowFreeAreaBottom)" + "max(0, Value)" ] } ] @@ -17894,7 +17988,7 @@ }, { "description": "Follow free area bottom border", - "name": "SetFollowFreeAreaBottom", + "name": "Value", "type": "expression" } ], @@ -17920,7 +18014,7 @@ "Object", "Behavior", "=", - "max(0, Speed)" + "max(0, Value)" ] } ] @@ -17940,7 +18034,7 @@ }, { "description": "Leftward maximum speed (in ratio per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -17966,7 +18060,7 @@ "Object", "Behavior", "=", - "max(0, Speed)" + "max(0, Value)" ] } ] @@ -17986,7 +18080,7 @@ }, { "description": "Rightward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -18012,7 +18106,7 @@ "Object", "Behavior", "=", - "max(0, Speed)" + "max(0, Value)" ] } ] @@ -18032,7 +18126,7 @@ }, { "description": "Upward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -18058,7 +18152,7 @@ "Object", "Behavior", "=", - "max(0, Speed)" + "max(0, Value)" ] } ] @@ -18078,7 +18172,7 @@ }, { "description": "Downward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -18104,7 +18198,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, LeftwardSpeed)" + "clamp(0, 1, Value)" ] }, { @@ -18115,7 +18209,7 @@ "Object", "Behavior", "=", - "log(1 - LeftwardSpeed)" + "log(1 - Value)" ] } ] @@ -18135,7 +18229,7 @@ }, { "description": "Leftward catch-up speed (in ratio per second)", - "name": "LeftwardSpeed", + "name": "Value", "type": "expression" } ], @@ -18161,7 +18255,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, RightwardSpeed)" + "clamp(0, 1, Value)" ] }, { @@ -18172,7 +18266,7 @@ "Object", "Behavior", "=", - "log(1 - RightwardSpeed)" + "log(1 - Value)" ] } ] @@ -18192,7 +18286,7 @@ }, { "description": "Rightward catch-up speed (in ratio per second)", - "name": "RightwardSpeed", + "name": "Value", "type": "expression" } ], @@ -18218,7 +18312,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, DownwardSpeed)" + "clamp(0, 1, Value)" ] }, { @@ -18229,7 +18323,7 @@ "Object", "Behavior", "=", - "log(1 - DownwardSpeed)" + "log(1 - Value)" ] } ] @@ -18249,7 +18343,7 @@ }, { "description": "Downward catch-up speed (in ratio per second)", - "name": "DownwardSpeed", + "name": "Value", "type": "expression" } ], @@ -18275,7 +18369,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, UpwardSpeed)" + "clamp(0, 1, Value)" ] }, { @@ -18286,7 +18380,7 @@ "Object", "Behavior", "=", - "log(1 - UpwardSpeed)" + "log(1 - Value)" ] } ] @@ -18306,7 +18400,7 @@ }, { "description": "Upward catch-up speed (in ratio per second)", - "name": "UpwardSpeed", + "name": "Value", "type": "expression" } ], @@ -18426,7 +18520,7 @@ "Object", "Behavior", "=", - "CameraOffsetX", + "Value", "" ] } @@ -18447,7 +18541,7 @@ }, { "description": "Camera offset X", - "name": "CameraOffsetX", + "name": "Value", "type": "expression" } ], @@ -18614,7 +18708,7 @@ "Object", "Behavior", "=", - "min(0, ForecastTime)" + "min(0, Value)" ] } ] @@ -18634,7 +18728,7 @@ }, { "description": "Forecast time", - "name": "ForecastTime", + "name": "Value", "type": "expression" } ], @@ -18660,7 +18754,7 @@ "Object", "Behavior", "=", - "min(0, CameraDelay)" + "min(0, Value)" ] } ] @@ -18680,7 +18774,7 @@ }, { "description": "Camera delay", - "name": "CameraDelay", + "name": "Value", "type": "expression" } ], @@ -21788,11 +21882,11 @@ "name": "Checkpoints", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/flag-variant.svg", "shortDescription": "Respawn objects at checkpoints.", - "version": "1.0.1", + "version": "1.0.2", "description": [ "This extension can save checkpoints and respawn objects at the last one.", "", - "The platformer example uses this extension ([open the project online](https://editor.gdevelop.io/?project=example://platformer))\"." + "The platformer example uses this extension ([open the project online](https://editor.gdevelop.io/?project=example://platformer))." ], "origin": { "identifier": "Checkpoints", @@ -21827,9 +21921,9 @@ }, "parameters": [ "ToSaveObject", - "__Checkpoints.Position[\"X\"+GetArgumentAsString(\"CheckpointName\")]", + "__Checkpoints.Position[\"X\"+CheckpointName]", "=", - "GetArgumentAsNumber(\"CoordinateX\")" + "CoordinateX" ] }, { @@ -21838,9 +21932,9 @@ }, "parameters": [ "ToSaveObject", - "__Checkpoints.Position[\"Y\"+GetArgumentAsString(\"CheckpointName\")]", + "__Checkpoints.Position[\"Y\"+CheckpointName]", "=", - "GetArgumentAsNumber(\"CoordinateY\")" + "CoordinateY" ] } ] @@ -21900,7 +21994,7 @@ "parameters": [ "ToLoadObject", "__Checkpoints.Position", - "\"X\" + GetArgumentAsString(\"CheckpointName\")" + "\"X\" + CheckpointName" ] }, { @@ -21910,7 +22004,7 @@ "parameters": [ "ToLoadObject", "__Checkpoints.Position", - "\"Y\" + GetArgumentAsString(\"CheckpointName\")" + "\"Y\" + CheckpointName" ] } ] @@ -21926,7 +22020,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"SetIgnoreUndefined\")", + "SetIgnoreUndefined", "!=", "\"true\"" ] @@ -21945,7 +22039,7 @@ "parameters": [ "ToLoadObject", "__Checkpoints.Position", - "\"Y\" + GetArgumentAsString(\"CheckpointName\")" + "\"Y\" + CheckpointName" ] }, { @@ -21956,7 +22050,7 @@ "parameters": [ "ToLoadObject", "__Checkpoints.Position", - "\"X\" + GetArgumentAsString(\"CheckpointName\")" + "\"X\" + CheckpointName" ] } ] @@ -21974,9 +22068,9 @@ "parameters": [ "ToMoveObject", "=", - "ToLoadObject.Variable(__Checkpoints.Position[\"X\" + GetArgumentAsString(\"CheckpointName\")])", + "ToLoadObject.Variable(__Checkpoints.Position[\"X\" + CheckpointName])", "=", - "ToLoadObject.Variable(__Checkpoints.Position[\"Y\" + GetArgumentAsString(\"CheckpointName\")])" + "ToLoadObject.Variable(__Checkpoints.Position[\"Y\" + CheckpointName])" ] } ] @@ -22026,7 +22120,7 @@ "parameters": [ "ToCheckObject", "__Checkpoints.Position", - "\"Y\" + GetArgumentAsString(\"CheckpointName\")" + "\"Y\" + CheckpointName" ] }, { @@ -22036,7 +22130,7 @@ "parameters": [ "ToCheckObject", "__Checkpoints.Position", - "\"X\" + GetArgumentAsString(\"CheckpointName\")" + "\"X\" + CheckpointName" ] } ], @@ -22068,7 +22162,7 @@ "parameters": [ "ToCheckObject", "__Checkpoints.Position", - "\"X\" + GetArgumentAsString(\"CheckpointName\")" + "\"X\" + CheckpointName" ] }, { @@ -22079,7 +22173,7 @@ "parameters": [ "ToCheckObject", "__Checkpoints.Position", - "\"Y\" + GetArgumentAsString(\"CheckpointName\")" + "\"Y\" + CheckpointName" ] } ] @@ -22126,7 +22220,7 @@ "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.6.2", + "version": "0.6.3", "description": [ "Add support for gamepads (or other controllers).", "", @@ -22165,153 +22259,215 @@ "sceneVariables": [], "eventsFunctions": [ { - "description": "Get the value of the pressure on a gamepad trigger.", - "fullName": "Pressure on a gamepad trigger", - "functionType": "Expression", - "name": "TriggerPressure", - "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, { "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "//Define an new private object javascript for the gamepad extension\r", + "gdjs._extensionController = {\r", + " players: {\r", + " 0: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " 1: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " 2: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " 3: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", + " },\r", + " lastActiveController: -1, // Last active controller\r", + " controllerButtonNames: { //Map associating controller button ids to button names\r", + " \"XBOX\": {\r", + " 0: \"A\",\r", + " 1: \"B\",\r", + " 2: \"X\",\r", + " 3: \"Y\",\r", + " 4: \"LB\",\r", + " 5: \"RB\",\r", + " 6: \"LT\",\r", + " 7: \"RT\",\r", + " 8: \"BACK\",\r", + " 9: \"START\",\r", + " 10: \"CLICK_STICK_LEFT\",\r", + " 11: \"CLICK_STICK_RIGHT\",\r", + " 12: \"UP\",\r", + " 13: \"DOWN\",\r", + " 14: \"LEFT\",\r", + " 15: \"RIGHT\",\r", + " 16: \"NONE\",\r", + " 17: \"NONE\"\r", + " },\r", + " \"PS4\": {\r", + " 0: \"CROSS\",\r", + " 1: \"CIRCLE\",\r", + " 2: \"SQUARE\",\r", + " 3: \"TRIANGLE\",\r", + " 4: \"L1\",\r", + " 5: \"R1\",\r", + " 6: \"L2\",\r", + " 7: \"R2\",\r", + " 8: \"SHARE\",\r", + " 9: \"OPTIONS\",\r", + " 10: \"CLICK_STICK_LEFT\",\r", + " 11: \"CLICK_STICK_RIGHT\",\r", + " 12: \"UP\",\r", + " 13: \"DOWN\",\r", + " 14: \"LEFT\",\r", + " 15: \"RIGHT\",\r", + " 16: \"PS_BUTTON\",\r", + " 17: \"CLICK_TOUCHPAD\"\r", + " }\r", + " }\r", + "};\r", "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const trigger = eventsFunctionContext.getArgument(\"trigger\").toUpperCase();\r", + "gdjs._extensionController.getInputString = function (type, buttonId) {\r", + " const controllerButtonNames = gdjs._extensionController.controllerButtonNames;\r", + " if (controllerButtonNames[type] !== undefined) {\r", + " return controllerButtonNames[type][buttonId];\r", + " }\r", "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in expression: \"Pressure on a gamepad trigger\", is not valid number, must be between 0 and 4.');\r", - " return;\r", + " return \"UNKNOWN_BUTTON\";\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", + "gdjs._extensionController.axisToAngle = function (deltaX, deltaY) {\r", + " const rad = Math.atan2(deltaY, deltaX);\r", + " const deg = rad * (180 / Math.PI);\r", + " return deg;\r", "}\r", "\r", - "const gamepad = gamepads[playerId];\r", + "gdjs._extensionController.isXbox = function (gamepad) {\r", + " return (gamepad ? (\r", + " gamepad.id.toUpperCase().indexOf(\"XBOX\") !== -1\r", + " // \"XINPUT\" cannot be used to check if it is a xbox controller is just a generic\r", + " // name reported in Firefox corresponding to the driver being used by the controller\r", + " // https://gamefaqs.gamespot.com/boards/916373-pc/73341312?page=1\r", + " ) : false);\r", + "}\r", "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", + "//Returns the new value taking into account the dead zone for the player_ID given\r", + "gdjs._extensionController.getNormalizedAxisValue = function (v, player_ID) {\r", + " // gdjs._extensionController = gdjs._extensionController || { deadzone: 0.2 };\r", "\r", - "switch (trigger) {\r", - " case 'LT':\r", - " case 'L2':\r", - " eventsFunctionContext.returnValue = gamepad.buttons[6].value;\r", - " break;\r", + " // Anything smaller than this is assumed to be 0,0\r", + " const DEADZONE = gdjs._extensionController.players[player_ID].deadzone;\r", "\r", - " case 'RT':\r", - " case 'R2':\r", - " eventsFunctionContext.returnValue = gamepad.buttons[7].value;\r", - " break;\r", + " if (Math.abs(v) < DEADZONE) {\r", + " // In the dead zone, set to 0\r", + " v = 0;\r", "\r", - " default:\r", - " eventsFunctionContext.returnValue = -1;\r", - " break;\r", - "}" + " if (v == null) {\r", + " return 0;\r", + " } else {\r", + " return v;\r", + " }\r", + "\r", + " } else {\r", + " // We're outside the dead zone, but we'd like to smooth\r", + " // this value out so it still runs nicely between 0..1.\r", + " // That is, we don't want it to jump suddenly from 0 to\r", + " // DEADZONE.\r", + "\r", + " // Remap v from\r", + " // DEADZONE..1 to 0..(1-DEADZONE)\r", + " // or from\r", + " // -1..-DEADZONE to -(1-DEADZONE)..0\r", + "\r", + " v = v - Math.sign(v) * DEADZONE;\r", + "\r", + " // Remap v from\r", + " // 0..(1-DEADZONE) to 0..1\r", + " // or from\r", + " // -(1-DEADZONE)..0 to -1..0\r", + "\r", + " return v / (1 - DEADZONE);\r", + " }\r", + "};" ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - }, - { - "description": "Trigger button", - "name": "trigger", - "supplementaryInformation": "[\"LT\",\"RT\",\"L2\",\"R2\"]", - "type": "stringWithSelector" - } - ], + "parameters": [], "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", + "fullName": "", + "functionType": "Action", + "name": "onScenePostEvents", + "sentence": "", "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, { "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", - "\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick force\"');\r", - " return;\r", - "}\r", - "\r", - "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a stick force\"');\r", - " return;\r", - "}\r", - "\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "\r", - "switch (stick) {\r", - " case 'LEFT':\r", - " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId)), 0, 1);\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId)), 0, 1);\r", - " break;\r", - "\r", - " default:\r", - " eventsFunctionContext.returnValue = -1;\r", - " break;\r", - "}" + "//Each time a player press a button i save the last button pressed for the next frame", + "/** @type {Gamepad[]} */", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", + "", + "//Get function parameter", + "let countPlayers = Object.keys(gdjs._extensionController.players).length;", + "", + "//Repeat for each players", + "for (let i = 0; i < countPlayers; i++) {", + " let gamepad = gamepads[i]; // Get the gamepad of the player", + "", + " //We have to keep this condition because if the user hasn't plugged in his controller yet, we can't get the controller in the gamepad variable.", + " if (gamepad == null) {", + " continue;", + " }", + "", + " for (let b = 0; b < Object.keys(gamepad.buttons).length; b++) { //For each buttons", + " if (gamepad.buttons[b].pressed) { //One of them is pressed", + " gdjs._extensionController.players[i].lastButtonUsed = b; //Save the button pressed", + "", + " //Save the state of the button for the next frame.", + " gdjs._extensionController.players[i].previousFrameStateButtons[b] = { pressed: true };", + "", + " // Update Last Active Controller", + " gdjs._extensionController.lastActiveController = i;", + " } else {", + " gdjs._extensionController.players[i].previousFrameStateButtons[b] = { pressed: false };", + " }", + " }", + "", + "", + " gdjs._extensionController.players[i].rumble.elapsedTime += runtimeScene.getElapsedTime(runtimeScene) / 1000;", + " if (", + " gdjs._extensionController.players[i].rumble.duration - gdjs._extensionController.players[i].rumble.elapsedTime <= 0 &&", + " (gdjs._extensionController.players[i].rumble.weakMagnitude || gdjs._extensionController.players[i].rumble.strongMagnitude)", + " ) {", + " gdjs._extensionController.players[i].rumble.weakMagnitude = 0;", + " gdjs._extensionController.players[i].rumble.strongMagnitude = 0;", + " }", + "", + "", + "}", + "" ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": true } ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - }, - { - "description": "Stick: \"Left\" or \"Right\"", - "name": "stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" - } - ], + "parameters": [], "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)", + "fullName": "Accelerated speed", "functionType": "Expression", - "name": "StickRotationValue", + "name": "AcceleratedSpeed", "private": true, - "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -22319,225 +22475,376 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetNumberVariable" }, "parameters": [ - "Gamepads::StickAngle(player_ID, stick)" + "AcceleratedSpeed", + "=", + "CurrentSpeed" ] } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - }, - { - "description": "Stick: \"Left\" or \"Right\"", - "name": "stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "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": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", - "\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick rotation\"');\r", - " return;\r", - "}\r", - "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a stick rotation\"');\r", - " return;\r", - "}\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "switch (stick) {\r", - " case 'LEFT':\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId));\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId));\r", - " break;\r", - "\r", - " default:\r", - " eventsFunctionContext.returnValue = -1;\r", - " break;\r", - "}" ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" - }, - { - "description": "Stick: \"Left\" or \"Right\"", - "name": "stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Get the value of axis of a gamepad stick.", - "fullName": "Value of a gamepad axis (deprecated)", - "functionType": "Expression", - "name": "AxisValue", - "private": true, - "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "/** @type {Gamepad[]} */\r", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", - "\r", - "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", - "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\r", - "\r", - "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "if (stick != \"LEFT\" && stick != \"RIGHT\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "if (direction != \"UP\" && direction != \"DOWN\" && direction != \"LEFT\" && direction != \"RIGHT\" && direction != \"HORIZONTAL\" && direction != \"VERTICAL\") {\r", - " console.error('Parameter direction is not valid in expression: \"Value of a gamepad axis\"');\r", - " return;\r", - "}\r", - "const gamepad = gamepads[playerId];\r", - "\r", - "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", - "if (gamepad == null) return;\r", - "\r", - "let parameterError = false;\r", - "switch (stick) {\r", - " case 'LEFT':\r", - " switch (direction) {\r", - " case 'LEFT':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'UP':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'DOWN':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", - " }\r", - " break;\r", - "\r", - " case \"HORIZONTAL\":\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", - " break;\r", - "\r", - " case \"VERTICAL\":\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", - " break;\r", - "\r", - " default:\r", - " break;\r", - " }\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " switch (direction) {\r", - " case 'LEFT':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'RIGHT':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'UP':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", - " }\r", - " break;\r", - "\r", - " case 'DOWN':\r", - " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", - " }\r", - " break;\r", - "\r", - " case \"HORIZONTAL\":\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", - " break;\r", - "\r", - " case \"VERTICAL\":\r", - " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", - " break;\r", - "\r", - " default:\r", - " break;\r", - " }\r", - " break;\r", - "\r", - " default:\r", - " break;\r", - "}\r", - "" + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"TargetedSpeed\"", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(0, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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)" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true + "variables": [ + { + "name": "AcceleratedSpeed", + "type": "number", + "value": 0 + } + ] } ], "expressionType": { @@ -22545,31 +22852,39 @@ }, "parameters": [ { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", + "description": "Current speed", + "name": "CurrentSpeed", "type": "expression" }, { - "description": "Stick: \"Left\" or \"Right\"", - "name": "stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" + "description": "Targeted speed", + "name": "TargetedSpeed", + "type": "expression" }, { - "description": "Direction", - "name": "direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"Horizontal\",\"Vertical\"]", - "type": "stringWithSelector" + "description": "Max speed", + "name": "SpeedMax", + "type": "expression" + }, + { + "description": "Acceleration", + "name": "Acceleration", + "type": "expression" + }, + { + "description": "Deceleration", + "name": "Deceleration", + "type": "expression" } ], "objectGroups": [] }, { - "description": "Return the gamepad stick force on X axis (from -1 at the left to 1 at the right).", - "fullName": "Stick X force", + "description": "Get the value of the pressure on a gamepad trigger.", + "fullName": "Pressure on a gamepad trigger", "functionType": "Expression", - "name": "StickForceX", - "sentence": "", + "name": "TriggerPressure", + "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", "events": [ { "type": "BuiltinCommonInstructions::JsCode", @@ -22578,25 +22893,38 @@ "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", "\r", "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const trigger = eventsFunctionContext.getArgument(\"trigger\").toUpperCase();\r", "\r", "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " console.error('Parameter gamepad identifier in expression: \"Pressure on a gamepad trigger\", is not valid number, must be between 0 and 4.');\r", " return;\r", "}\r", - "if (stick != \"left\" && stick != \"right\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + "if (trigger != \"LT\" && trigger != \"RT\" && trigger != \"L2\" && trigger != \"R2\") {\r", + " console.error('Parameter trigger is not valid in expression: \"Pressure on a gamepad trigger\"');\r", " return;\r", "}\r", + "\r", "const gamepad = gamepads[playerId];\r", "\r", "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", "if (gamepad == null) return;\r", "\r", - "const axisIndex = stick === 'right' ? 2 : 0;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[axisIndex], playerId);\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, @@ -22609,24 +22937,24 @@ "parameters": [ { "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Gamepad", + "name": "player_ID", "type": "expression" }, { - "description": "Stick: \"Left\" or \"Right\"", - "name": "Stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", + "description": "Trigger button", + "name": "trigger", + "supplementaryInformation": "[\"LT\",\"RT\",\"L2\",\"R2\"]", "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": "", + "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", @@ -22635,25 +22963,39 @@ "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", "\r", "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "\r", "\r", "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick force\"');\r", " return;\r", "}\r", - "if (stick != \"left\" && stick != \"right\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + "\r", + "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a stick force\"');\r", " return;\r", "}\r", + "\r", "const gamepad = gamepads[playerId];\r", "\r", "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", "if (gamepad == null) return;\r", "\r", - "const axisIndex = stick === 'right' ? 3 : 1;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[axisIndex], playerId);\r", - "" + "\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId)), 0, 1);\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " eventsFunctionContext.returnValue = gdjs.evtTools.common.clamp(Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId)) + Math.abs(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId)), 0, 1);\r", + " break;\r", + "\r", + " default:\r", + " eventsFunctionContext.returnValue = -1;\r", + " break;\r", + "}" ], "parameterObjects": "", "useStrict": true, @@ -22666,12 +23008,12 @@ "parameters": [ { "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Gamepad", + "name": "player_ID", "type": "expression" }, { "description": "Stick: \"Left\" or \"Right\"", - "name": "Stick", + "name": "stick", "supplementaryInformation": "[\"Left\",\"Right\"]", "type": "stringWithSelector" } @@ -22679,11 +23021,52 @@ "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", + "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(player_ID, stick)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "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", @@ -22693,34 +23076,366 @@ "\r", "//Get function parameters\r", "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", - "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "\r", "\r", "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier in condition: \"Gamepad button released\", is not valid number, must be between 0 and 4.');\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick rotation\"');\r", " return;\r", "}\r", - "if (button === \"\") {\r", - " console.error('Parameter button is not valid in condition: \"Gamepad button released\"');\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", - "\r", "const gamepad = gamepads[playerId];\r", "\r", "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", "if (gamepad == null) return;\r", "\r", - "let buttonId;\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId));\r", + " break;\r", "\r", - "switch (button) {\r", - " case 'A':\r", - " case 'CROSS':\r", - " buttonId = 0;\r", + " case 'RIGHT':\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.axisToAngle(gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId), gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId));\r", " break;\r", - " case 'B':\r", - " case 'CIRCLE':\r", - " buttonId = 1;\r", + "\r", + " default:\r", + " eventsFunctionContext.returnValue = -1;\r", " break;\r", - " case 'X':\r", + "}" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Get the value of axis of a gamepad stick.", + "fullName": "Value of a gamepad axis (deprecated)", + "functionType": "Expression", + "name": "AxisValue", + "private": true, + "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", + "const direction = eventsFunctionContext.getArgument(\"direction\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (stick != \"LEFT\" && stick != \"RIGHT\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (direction != \"UP\" && direction != \"DOWN\" && direction != \"LEFT\" && direction != \"RIGHT\" && direction != \"HORIZONTAL\" && direction != \"VERTICAL\") {\r", + " console.error('Parameter direction is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let parameterError = false;\r", + "switch (stick) {\r", + " case 'LEFT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", + " }\r", + " break;\r", + "\r", + " case \"HORIZONTAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[0], playerId);\r", + " break;\r", + "\r", + " case \"VERTICAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[1], playerId);\r", + " break;\r", + "\r", + " default:\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " switch (direction) {\r", + " case 'LEFT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'RIGHT':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'UP':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) {\r", + " eventsFunctionContext.returnValue = -gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", + " }\r", + " break;\r", + "\r", + " case 'DOWN':\r", + " if (gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", + " }\r", + " break;\r", + "\r", + " case \"HORIZONTAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[2], playerId);\r", + " break;\r", + "\r", + " case \"VERTICAL\":\r", + " eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[3], playerId);\r", + " break;\r", + "\r", + " default:\r", + " break;\r", + " }\r", + " break;\r", + "\r", + " default:\r", + " break;\r", + "}\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "The gamepad identifier: 1, 2, 3 or 4", + "name": "player_ID", + "type": "expression" + }, + { + "description": "Stick: \"Left\" or \"Right\"", + "name": "stick", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + }, + { + "description": "Direction", + "name": "direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"Horizontal\",\"Vertical\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "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": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (stick != \"left\" && stick != \"right\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "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": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", + "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "if (stick != \"left\" && stick != \"right\") {\r", + " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + " return;\r", + "}\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "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": [ + "/** @type {Gamepad[]} */\r", + "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", + "\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const button = eventsFunctionContext.getArgument(\"button\").toUpperCase();\r", + "\r", + "if (playerId < 0 || playerId > 4) {\r", + " console.error('Parameter gamepad identifier in condition: \"Gamepad button released\", is not valid number, must be between 0 and 4.');\r", + " return;\r", + "}\r", + "if (button === \"\") {\r", + " console.error('Parameter button is not valid in condition: \"Gamepad button released\"');\r", + " return;\r", + "}\r", + "\r", + "const gamepad = gamepads[playerId];\r", + "\r", + "//we need keep this condition because when use have not yet plug her controller we can't get the controller in the gamepad variable.\r", + "if (gamepad == null) return;\r", + "\r", + "let buttonId;\r", + "\r", + "switch (button) {\r", + " case 'A':\r", + " case 'CROSS':\r", + " buttonId = 0;\r", + " break;\r", + " case 'B':\r", + " case 'CIRCLE':\r", + " buttonId = 1;\r", + " break;\r", + " case 'X':\r", " case 'SQUARE':\r", " buttonId = 2;\r", " break;\r", @@ -23844,210 +24559,6 @@ ], "objectGroups": [] }, - { - "fullName": "", - "functionType": "Action", - "name": "onFirstSceneLoaded", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] - }, - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "//Define an new private object javascript for the gamepad extension\r", - "gdjs._extensionController = {\r", - " players: {\r", - " 0: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", - " 1: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", - " 2: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", - " 3: { mapping: 'DEFAULT', lastButtonUsed: -1, deadzone: 0.2, previousFrameStateButtons: {}, rumble: {} },\r", - " },\r", - " lastActiveController: -1, // Last active controller\r", - " controllerButtonNames: { //Map associating controller button ids to button names\r", - " \"XBOX\": {\r", - " 0: \"A\",\r", - " 1: \"B\",\r", - " 2: \"X\",\r", - " 3: \"Y\",\r", - " 4: \"LB\",\r", - " 5: \"RB\",\r", - " 6: \"LT\",\r", - " 7: \"RT\",\r", - " 8: \"BACK\",\r", - " 9: \"START\",\r", - " 10: \"CLICK_STICK_LEFT\",\r", - " 11: \"CLICK_STICK_RIGHT\",\r", - " 12: \"UP\",\r", - " 13: \"DOWN\",\r", - " 14: \"LEFT\",\r", - " 15: \"RIGHT\",\r", - " 16: \"NONE\",\r", - " 17: \"NONE\"\r", - " },\r", - " \"PS4\": {\r", - " 0: \"CROSS\",\r", - " 1: \"CIRCLE\",\r", - " 2: \"SQUARE\",\r", - " 3: \"TRIANGLE\",\r", - " 4: \"L1\",\r", - " 5: \"R1\",\r", - " 6: \"L2\",\r", - " 7: \"R2\",\r", - " 8: \"SHARE\",\r", - " 9: \"OPTIONS\",\r", - " 10: \"CLICK_STICK_LEFT\",\r", - " 11: \"CLICK_STICK_RIGHT\",\r", - " 12: \"UP\",\r", - " 13: \"DOWN\",\r", - " 14: \"LEFT\",\r", - " 15: \"RIGHT\",\r", - " 16: \"PS_BUTTON\",\r", - " 17: \"CLICK_TOUCHPAD\"\r", - " }\r", - " }\r", - "};\r", - "\r", - "gdjs._extensionController.getInputString = function (type, buttonId) {\r", - " const controllerButtonNames = gdjs._extensionController.controllerButtonNames;\r", - " if (controllerButtonNames[type] !== undefined) {\r", - " return controllerButtonNames[type][buttonId];\r", - " }\r", - "\r", - " return \"UNKNOWN_BUTTON\";\r", - "}\r", - "\r", - "gdjs._extensionController.axisToAngle = function (deltaX, deltaY) {\r", - " const rad = Math.atan2(deltaY, deltaX);\r", - " const deg = rad * (180 / Math.PI);\r", - " return deg;\r", - "}\r", - "\r", - "gdjs._extensionController.isXbox = function (gamepad) {\r", - " return (gamepad ? (\r", - " gamepad.id.toUpperCase().indexOf(\"XBOX\") !== -1\r", - " // \"XINPUT\" cannot be used to check if it is a xbox controller is just a generic\r", - " // name reported in Firefox corresponding to the driver being used by the controller\r", - " // https://gamefaqs.gamespot.com/boards/916373-pc/73341312?page=1\r", - " ) : false);\r", - "}\r", - "\r", - "//Returns the new value taking into account the dead zone for the player_ID given\r", - "gdjs._extensionController.getNormalizedAxisValue = function (v, player_ID) {\r", - " // gdjs._extensionController = gdjs._extensionController || { deadzone: 0.2 };\r", - "\r", - " // Anything smaller than this is assumed to be 0,0\r", - " const DEADZONE = gdjs._extensionController.players[player_ID].deadzone;\r", - "\r", - " if (Math.abs(v) < DEADZONE) {\r", - " // In the dead zone, set to 0\r", - " v = 0;\r", - "\r", - " if (v == null) {\r", - " return 0;\r", - " } else {\r", - " return v;\r", - " }\r", - "\r", - " } else {\r", - " // We're outside the dead zone, but we'd like to smooth\r", - " // this value out so it still runs nicely between 0..1.\r", - " // That is, we don't want it to jump suddenly from 0 to\r", - " // DEADZONE.\r", - "\r", - " // Remap v from\r", - " // DEADZONE..1 to 0..(1-DEADZONE)\r", - " // or from\r", - " // -1..-DEADZONE to -(1-DEADZONE)..0\r", - "\r", - " v = v - Math.sign(v) * DEADZONE;\r", - "\r", - " // Remap v from\r", - " // 0..(1-DEADZONE) to 0..1\r", - " // or from\r", - " // -(1-DEADZONE)..0 to -1..0\r", - "\r", - " return v / (1 - DEADZONE);\r", - " }\r", - "};" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onScenePostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] - }, - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "//Each time a player press a button i save the last button pressed for the next frame", - "/** @type {Gamepad[]} */", - "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);", - "", - "//Get function parameter", - "let countPlayers = Object.keys(gdjs._extensionController.players).length;", - "", - "//Repeat for each players", - "for (let i = 0; i < countPlayers; i++) {", - " let gamepad = gamepads[i]; // Get the gamepad of the player", - "", - " //We have to keep this condition because if the user hasn't plugged in his controller yet, we can't get the controller in the gamepad variable.", - " if (gamepad == null) {", - " continue;", - " }", - "", - " for (let b = 0; b < Object.keys(gamepad.buttons).length; b++) { //For each buttons", - " if (gamepad.buttons[b].pressed) { //One of them is pressed", - " gdjs._extensionController.players[i].lastButtonUsed = b; //Save the button pressed", - "", - " //Save the state of the button for the next frame.", - " gdjs._extensionController.players[i].previousFrameStateButtons[b] = { pressed: true };", - "", - " // Update Last Active Controller", - " gdjs._extensionController.lastActiveController = i;", - " } else {", - " gdjs._extensionController.players[i].previousFrameStateButtons[b] = { pressed: false };", - " }", - " }", - "", - "", - " gdjs._extensionController.players[i].rumble.elapsedTime += runtimeScene.getElapsedTime(runtimeScene) / 1000;", - " if (", - " gdjs._extensionController.players[i].rumble.duration - gdjs._extensionController.players[i].rumble.elapsedTime <= 0 &&", - " (gdjs._extensionController.players[i].rumble.weakMagnitude || gdjs._extensionController.players[i].rumble.strongMagnitude)", - " ) {", - " gdjs._extensionController.players[i].rumble.weakMagnitude = 0;", - " gdjs._extensionController.players[i].rumble.strongMagnitude = 0;", - " }", - "", - "", - "}", - "" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [], - "objectGroups": [] - }, { "description": "Check if any button is released on a gamepad.", "fullName": "Any gamepad button released", @@ -25019,9 +25530,9 @@ "sharedPropertyDescriptors": [] }, { - "description": "Control a top-down character with a gamepad.", - "fullName": "Top-down gamepad mapper", - "name": "TopDownGamepadMapper", + "description": "Control a 3D physics character with a gamepad.", + "fullName": "3D platformer gamepad mapper", + "name": "Platformer3DGamepadMapper", "objectType": "", "eventsFunctions": [ { @@ -25051,122 +25562,115 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseArrows" + "value": "Gamepads::StickForce" }, "parameters": [ - "Object", - "Behavior" + "", + ">", + "0", + "GamepadIdentifier", + "JoystickIdentifier", + "" ] } ], - "actions": [], - "events": [ + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Left\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } + "type": { + "value": "Physics3D::PhysicsCharacter3D::SetForwardAngle" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D", + "=", + "Gamepads::StickAngle(GamepadIdentifier, JoystickIdentifier) + CameraAngle(Object.Layer())" ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Right\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateRightKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D", + "-90", + "Gamepads::StickForce(GamepadIdentifier, JoystickIdentifier)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"A or Cross\"" ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Up\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"A\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"B or Circle\"" ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Down\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateDownKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"B\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" ] } ] @@ -25176,203 +25680,111 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseLeftStick" + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" }, "parameters": [ "Object", - "Behavior" + "Behavior", + "=", + "\"X or Square\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"X\"", + "\"Left\"" ] } ], - "actions": [], - "events": [ + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"Analog\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "Gamepads::StickRotationValue(GamepadIdentifier, \"Left\")", - "Gamepads::StickForce(GamepadIdentifier, \"Left\")" - ] - } + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Y or Triangle\"" ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"360°\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "Gamepads::StickRotationValue(GamepadIdentifier, \"Left\")", - "sign(Gamepads::StickForce(GamepadIdentifier, \"Left\"))" - ] - } + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Y\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LB or L1\"" ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"8 Directions\"" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "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": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" ] } ] @@ -25382,203 +25794,111 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseRightStick" + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" }, "parameters": [ "Object", - "Behavior" + "Behavior", + "=", + "\"RB or R1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RB\"", + "\"Left\"" ] } ], - "actions": [], - "events": [ + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"Analog\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "Gamepads::StickRotationValue(GamepadIdentifier, \"Right\")", - "Gamepads::StickForce(GamepadIdentifier, \"Right\")" - ] - } + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LT or L2\"" ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"360°\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateStick" - }, - "parameters": [ - "Object", - "TopDownMovement", - "sign(Gamepads::StickForce(GamepadIdentifier, \"Right\"))", - "1" - ] - } + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RT or R2\"" ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"8 Directions\"" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Axis_pushed" - }, - "parameters": [ - "", - "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" - ] - } - ] - } + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" ] } ] @@ -25595,7 +25915,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Gamepads::TopDownGamepadMapper", + "supplementaryInformation": "Gamepads::Platformer3DGamepadMapper", "type": "behavior" } ], @@ -25606,13 +25926,13 @@ { "value": "", "type": "Behavior", - "label": "Top-down movement behavior", + "label": "3D physics character", "description": "", "group": "", "extraInformation": [ - "TopDownMovementBehavior::TopDownMovementBehavior" + "Physics3D::PhysicsCharacter3D" ], - "name": "TopDownMovement" + "name": "PhysicsCharacter3D" }, { "value": "1", @@ -25624,126 +25944,3888 @@ "name": "GamepadIdentifier" }, { - "value": "true", - "type": "Boolean", - "label": "Use directional pad", - "description": "", - "group": "Controls", - "extraInformation": [], - "name": "UseArrows" - }, - { - "value": "true", - "type": "Boolean", - "label": "Use left stick", - "description": "", - "group": "Controls", - "extraInformation": [], - "name": "UseLeftStick" - }, - { - "value": "", - "type": "Boolean", - "label": "Use right stick", + "value": "Left", + "type": "Choice", + "label": "Walk joystick", "description": "", "group": "Controls", - "extraInformation": [], - "name": "UseRightStick" + "extraInformation": [ + "Left", + "Right" + ], + "name": "JoystickIdentifier" }, { - "value": "Analog", + "value": "A or Cross", "type": "Choice", - "label": "Stick mode", + "label": "Jump button", "description": "", "group": "Controls", "extraInformation": [ - "Analog", - "360°", - "8 Directions" + "A or Cross", + "B or Circle", + "X or Square", + "Y or Triangle", + "LB or L1", + "RB or R1", + "LT or L2", + "RT or R2" ], - "name": "StickMode" + "name": "JumpButton" } ], "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "Input", - "extensionNamespace": "", - "fullName": "Multitouch joystick and buttons (sprite)", - "helpPath": "/objects/multitouch-joystick", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMTYiIGN5PSIxNiIgcj0iMTMiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjI4LjQsMTIgMjAsMTIgMjAsMy42ICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMjAsMjguNCAyMCwyMCAyOC40LDIwICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMy42LDIwIDEyLDIwIDEyLDI4LjQgIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIxMiwzLjYgMTIsMTIgMy42LDEyICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIxNiw2IDE2LjcsNyAxNS4zLDcgIi8+DQo8cG9seWdvbiBjbGFzcz0ic3QwIiBwb2ludHM9IjE2LDI2IDE1LjMsMjUgMTYuNywyNSAiLz4NCjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iNiwxNiA3LDE1LjMgNywxNi43ICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIyNiwxNiAyNSwxNi43IDI1LDE1LjMgIi8+DQo8L3N2Zz4NCg==", - "name": "SpriteMultitouchJoystick", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Videogames/Videogames_controller_joystick_arrows_direction.svg", - "shortDescription": "Joysticks or buttons for touchscreens.", - "version": "1.3.1", - "description": [ - "Multitouch joysticks can be used the same way as physical gamepads:", - "- 4 or 8 directions", - "- Analogus pads", - "- Player selection", - "- Controls mapping for top-down movement and platformer characters", - "", - "There are ready-to-use joysticks in the asset-store [multitouch joysticks pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=multitouch-joysticks-multitouch-joysticks)." - ], - "origin": { - "identifier": "SpriteMultitouchJoystick", - "name": "gdevelop-extension-store" - }, - "tags": [ - "multitouch", - "joystick", - "thumbstick", - "controller", - "touchscreen", - "twin stick", - "shooter", - "virtual", - "platformer", - "platform", - "top-down" - ], - "authorIds": [ - "gqDaZjCfevOOxBYkK6zlhtZnXCg1", - "1OgYzWp5UeVPbiWGJwI6vqfgZLC3", - "v0YRpdAnIucZFgiRCCecqVnGKno2", - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ + }, { - "description": "Check if a button is pressed on a gamepad.", - "fullName": "Multitouch controller button pressed", - "functionType": "Condition", - "name": "IsButtonPressed", - "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is pressed", + "description": "Control a 3D physics character with a gamepad.", + "fullName": "3D shooter gamepad mapper", + "name": "Shooter3DGamepadMapper", + "objectType": "", + "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::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"A or Cross\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"A\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"B or Circle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"B\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"X or Square\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"X\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Y or Triangle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Y\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LB or L1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RB or R1\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RB\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"LT or L2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"LT\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::Shooter3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"RT or R2\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"RT\"", + "\"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", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" + }, + { + "value": "Left", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Left", + "Right" + ], + "name": "WalkStick" + }, + { + "value": "Right", + "type": "Choice", + "label": "Camera joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Left", + "Right" + ], + "name": "CameraStick" + }, + { + "value": "A or Cross", + "type": "Choice", + "label": "Jump button", + "description": "", + "group": "Controls", + "extraInformation": [ + "A or Cross", + "B or Circle", + "X or Square", + "Y or Triangle", + "LB or L1", + "RB or R1", + "LT or L2", + "RT or R2" + ], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control camera rotations with a gamepad.", + "fullName": "First person camera gamepad mapper", + "name": "FirstPersonGamepadMapper", + "objectType": "", + "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": "Gamepads::FirstPersonGamepadMapper::SetPropertyCurrentRotationSpeedZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Gamepads::AcceleratedSpeed(CurrentRotationSpeedZ, Gamepads::StickForceX(GamepadIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "CurrentRotationSpeedZ * TimeDelta()" + ] + }, + { + "type": { + "value": "Gamepads::FirstPersonGamepadMapper::SetPropertyCurrentRotationSpeedY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "Gamepads::FirstPersonGamepadMapper::SetPropertyHorizontalRotationSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "Gamepads::FirstPersonGamepadMapper::SetPropertyHorizontalRotationAcceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "Gamepads::FirstPersonGamepadMapper::SetPropertyHorizontalRotationDeceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "Gamepads::FirstPersonGamepadMapper::SetPropertyVerticalRotationSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "Gamepads::FirstPersonGamepadMapper::SetPropertyVerticalRotationAcceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "Gamepads::FirstPersonGamepadMapper::SetPropertyVerticalRotationDeceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "Gamepads::FirstPersonGamepadMapper::SetPropertyVerticalAngleMin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "Gamepads::FirstPersonGamepadMapper::SetPropertyVerticalAngleMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "Gamepads::FirstPersonGamepadMapper::SetPropertyOffsetZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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", + "description": "", + "group": "", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "name": "Object3D" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" + }, + { + "value": "Right", + "type": "Choice", + "label": "Camera joystick", + "description": "", + "group": "", + "extraInformation": [ + "Left", + "Right" + ], + "name": "CameraStick" + }, + { + "value": "180", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationSpeedMax" + }, + { + "value": "360", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationAcceleration" + }, + { + "value": "720", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationDeceleration" + }, + { + "value": "120", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationSpeedMax" + }, + { + "value": "240", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationAcceleration" + }, + { + "value": "480", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationDeceleration" + }, + { + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Minimum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMin" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Maximum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z position offset", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Z", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Y", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedY" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a top-down character with a gamepad.", + "fullName": "Top-down gamepad mapper", + "name": "TopDownGamepadMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "GamepadIdentifier", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyUseArrows" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "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": "Gamepads::TopDownGamepadMapper::PropertyUseLeftStick" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "Gamepads::StickRotationValue(GamepadIdentifier, \"Left\")", + "Gamepads::StickForce(GamepadIdentifier, \"Left\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "Gamepads::StickRotationValue(GamepadIdentifier, \"Left\")", + "sign(Gamepads::StickForce(GamepadIdentifier, \"Left\"))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "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": "Gamepads::TopDownGamepadMapper::PropertyUseRightStick" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "Gamepads::StickRotationValue(GamepadIdentifier, \"Right\")", + "Gamepads::StickForce(GamepadIdentifier, \"Right\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "sign(Gamepads::StickForce(GamepadIdentifier, \"Right\"))", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "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", + "description": "", + "group": "", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" + ], + "name": "TopDownMovement" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use directional pad", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseArrows" + }, + { + "value": "true", + "type": "Boolean", + "label": "Use left stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseLeftStick" + }, + { + "value": "", + "type": "Boolean", + "label": "Use right stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseRightStick" + }, + { + "value": "Analog", + "type": "Choice", + "label": "Stick mode", + "description": "", + "group": "Controls", + "extraInformation": [ + "Analog", + "360°", + "8 Directions" + ], + "name": "StickMode" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Input", + "extensionNamespace": "", + "fullName": "Multitouch joystick and buttons (sprite)", + "helpPath": "/objects/multitouch-joystick", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMTYiIGN5PSIxNiIgcj0iMTMiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjI4LjQsMTIgMjAsMTIgMjAsMy42ICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMjAsMjguNCAyMCwyMCAyOC40LDIwICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMy42LDIwIDEyLDIwIDEyLDI4LjQgIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIxMiwzLjYgMTIsMTIgMy42LDEyICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIxNiw2IDE2LjcsNyAxNS4zLDcgIi8+DQo8cG9seWdvbiBjbGFzcz0ic3QwIiBwb2ludHM9IjE2LDI2IDE1LjMsMjUgMTYuNywyNSAiLz4NCjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iNiwxNiA3LDE1LjMgNywxNi43ICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIyNiwxNiAyNSwxNi43IDI1LDE1LjMgIi8+DQo8L3N2Zz4NCg==", + "name": "SpriteMultitouchJoystick", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Videogames/Videogames_controller_joystick_arrows_direction.svg", + "shortDescription": "Joysticks or buttons for touchscreens.", + "version": "1.6.1", + "description": [ + "Multitouch joysticks can be used the same way as physical gamepads:", + "- 4 or 8 directions", + "- Analogus pads", + "- Player selection", + "- Controls mapping for top-down movement and platformer characters", + "", + "There are ready-to-use joysticks in the asset-store [multitouch joysticks pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=multitouch-joysticks-multitouch-joysticks)." + ], + "origin": { + "identifier": "SpriteMultitouchJoystick", + "name": "gdevelop-extension-store" + }, + "tags": [ + "multitouch", + "joystick", + "thumbstick", + "controller", + "touchscreen", + "twin stick", + "shooter", + "virtual", + "platformer", + "platform", + "top-down" + ], + "authorIds": [ + "gqDaZjCfevOOxBYkK6zlhtZnXCg1", + "1OgYzWp5UeVPbiWGJwI6vqfgZLC3", + "v0YRpdAnIucZFgiRCCecqVnGKno2", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [ + { + "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": [ + { + "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": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"TargetedSpeed\"", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(0, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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 is pressed on a gamepad.", + "fullName": "Multitouch controller button pressed", + "functionType": "Condition", + "name": "IsButtonPressed", + "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Buttons[Button].State", + "=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Button name", + "name": "Button", + "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a button is released on a gamepad.", + "fullName": "Multitouch controller button released", + "functionType": "Condition", + "name": "IsButtonReleased", + "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is released", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "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\",\"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": [ - { - "type": { - "value": "VarSceneTxt" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Buttons[Button].State", - "=", - "\"Pressed\"" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetNumberVariable" }, "parameters": [ - "True" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle", + "=", + "Value" ] } ] @@ -25756,47 +29838,83 @@ "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\"]", + "description": "Joystick name", + "name": "JoystickIdentifier", "type": "string" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" } ], "objectGroups": [] }, { - "description": "Check if a button is released on a gamepad.", - "fullName": "Multitouch controller button released", - "functionType": "Condition", - "name": "IsButtonReleased", - "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is released", + "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": [ + "conditions": [], + "actions": [ { "type": { - "value": "VarSceneTxt" + "value": "SetReturnNumber" }, "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Buttons[Button].State", - "=", - "\"Released\"" + "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": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "YFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Multitouch controller identifier (1, 2, 3, 4...)", @@ -25804,1209 +29922,1190 @@ "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" + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" } ], "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_", + "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": [], - "actions": [ + "conditions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "HasAnyTouchOrMouseStarted" }, "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Buttons[Button].State", - "=", - "ButtonState" + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsString" + }, + "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": "CompareArgumentAsString" + }, + "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": { + "value": "HasGameJustResumed" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Manage touches", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StartedTouchOrMouseCount()", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StartedTouchOrMouseId(TouchIndex)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Move thumb back to center when not being pressed (acts like a spring on a real controller)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasTouchEnded" + }, + "parameters": [ + "", + "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": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "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": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Button name", - "name": "Button", - "type": "string" - }, - { - "description": "Button state", - "name": "ButtonState", - "supplementaryInformation": "[\"Idle\",\"Pressed\",\"Released\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Change the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", - "fullName": "Dead zone radius", - "functionType": "Action", - "name": "SetDeadZone", - "private": true, - "sentence": "Change the dead zone of multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + ], + "parameters": [ { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", - "=", - "DeadZoneRadius" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "type": "string" - }, - { - "description": "Dead zone radius", - "name": "DeadZoneRadius", - "supplementaryInformation": "[]", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Return the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", - "fullName": "Dead zone radius", - "functionType": "Expression", - "name": "DeadZone", - "private": true, - "sentence": "Change multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ dead zone to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "description": "Object", + "name": "Object", + "type": "object" + }, { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Variable(__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone)" - ] + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" + ], + "objectGroups": [] }, { - "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": [ + "description": "the joystick force (from 0 to 1).", + "fullName": "Joystick force", + "functionType": "ExpressionAndCondition", + "name": "JoystickForce", + "sentence": "the joystick force", + "events": [ { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "mod(round(Angle * 8 / 360), 8)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "max(0, JoystickForce - DeadZoneRadius) / (1 - DeadZoneRadius)" + ] + } ] } - ] - } - ], - "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": [ + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Right\"" - ] + "description": "Object", + "name": "Object", + "type": "object" }, { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" - }, - "parameters": [ - "", - "=", - "0", - "Angle", - "" - ] + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" } ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Down\"" - ] - }, + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JoystickForce", + "name": "SetJoystickForce", + "private": true, + "sentence": "", + "events": [ { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" - }, - "parameters": [ - "", - "=", - "1", - "Angle", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SetJoystickForce" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickForce", + "" + ] + } ] } ], - "actions": [ + "parameters": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "description": "Object", + "name": "Object", + "type": "object" + }, { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Left\"" - ] + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" }, { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" - }, - "parameters": [ - "", - "=", - "2", - "Angle", - "" - ] + "description": "", + "name": "Parameter", + "type": "objectList" } ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Up\"" - ] - }, + "description": "Return the angle the joystick is pointing towards (Range: -180 to 180).", + "fullName": "Joystick angle", + "functionType": "Expression", + "name": "JoystickAngle", + "sentence": "", + "events": [ { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" - }, - "parameters": [ - "", - "=", - "3", - "Angle", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "JoystickAngle" + ] + } ] } ], - "actions": [ + "expressionType": { + "type": "expression" + }, + "parameters": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" } - ] - } - ], - "parameters": [ - { - "description": "Angle", - "name": "Angle", - "type": "expression" + ], + "objectGroups": [] }, { - "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\"" - ] - }, + "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": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "0", - "Angle", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickAngle" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SetJoystickAngle" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickAngle", + "" + ] + } ] } ], - "actions": [ + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] + "description": "Angle", + "name": "Value", + "type": "expression" } - ] + ], + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"DownRight\"" - ] - }, + "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": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "1", - "Angle", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::JoystickForce() * cos(ToRad(Object.Behavior::JoystickAngle()))" + ] + } ] } ], - "actions": [ + "expressionType": { + "type": "expression" + }, + "parameters": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" } - ] + ], + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Down\"" - ] - }, + "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": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "2", - "Angle", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.Behavior::JoystickForce() * sin(ToRad(Object.Behavior::JoystickAngle()))" + ] + } ] } ], - "actions": [ + "expressionType": { + "type": "expression" + }, + "parameters": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" } - ] + ], + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"DownLeft\"" - ] - }, + "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": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "3", - "Angle", - "" + "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" + ] + } ] } ], - "actions": [ + "parameters": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "description": "Object", + "name": "Object", + "type": "object" + }, { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Left\"" - ] + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" }, { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "4", - "Angle", - "" - ] + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" } ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"UpLeft\"" - ] - }, + "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": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "5", - "Angle", - "" + "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" + ] + } ] } ], - "actions": [ + "parameters": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "description": "Object", + "name": "Object", + "type": "object" + }, { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Up\"" - ] + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" }, { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "6", - "Angle", - "" - ] + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" } ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"UpRight\"" - ] - }, + "description": "Check if a joystick is pressed.", + "fullName": "Joystick pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Joystick _PARAM0_ is pressed", + "events": [ { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "7", - "Angle", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } ] } ], - "actions": [ + "parameters": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" } - ] - } - ], - "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" + ], + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "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": { - "value": "SpriteMultitouchJoystick::JoystickForce" - }, - "parameters": [ - "", - ">", - "0", - "ControllerIdentifier", - "JoystickIdentifier", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickForce" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, { - "type": { - "value": "SpriteMultitouchJoystick::IsAngleIn4WayDirection" - }, - "parameters": [ - "", - "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", - "Direction", - "" - ] + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" } ], - "actions": [ + "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": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ControllerIdentifier" + ] + } ] } - ] - } - ], - "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 + ], + "expressionType": { + "type": "expression" }, - "comment": "Make sure the joystick has moved from center" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "parameters": [ { - "type": { - "value": "SpriteMultitouchJoystick::JoystickForce" - }, - "parameters": [ - "", - ">", - "0", - "ControllerIdentifier", - "JoystickIdentifier", - "" - ] + "description": "Object", + "name": "Object", + "type": "object" }, { - "type": { - "value": "SpriteMultitouchJoystick::IsAngleIn8WayDirection" - }, - "parameters": [ - "", - "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", - "Direction", - "" - ] + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" } ], - "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" + "objectGroups": [] }, { - "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": [ + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ControllerIdentifier", + "name": "SetControllerIdentifier", + "sentence": "", + "events": [ { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyControllerIdentifier" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } ] } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "supplementaryInformation": "[\"Primary\",\"Secondary\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "the force of multitouch contoller stick (from 0 to 1).", - "fullName": "Stick force", - "functionType": "ExpressionAndCondition", - "name": "StickForce", - "sentence": "multitouch controller _PARAM1_ _PARAM2_ stick force", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + ], + "parameters": [ { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "max(0, Variable(__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force) - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier)) / (1 - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier))" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Stick name", - "name": "JoystickIdentifier", - "supplementaryInformation": "[\"Primary\",\"Secondary\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Change the percentage the thumb has been pulled away from the joystick center (Range: 0 to 1).", - "fullName": "Joystick force", - "functionType": "Action", - "name": "SetJoystickForce", - "private": true, - "sentence": "Change the force of the joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "description": "Object", + "name": "Object", + "type": "object" + }, { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", - "=", - "Value" - ] + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" + ], + "objectGroups": [] }, { - "description": "Joystick name", + "description": "the joystick name.", + "fullName": "Joystick name", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", "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": [ + "sentence": "the joystick name", + "events": [ { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "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": [ + ], + "expressionType": { + "type": "string" + }, + "parameters": [ { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Variable(__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle)" - ] + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" + ], + "objectGroups": [] }, { - "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": [ + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JoystickIdentifier", + "name": "SetJoystickIdentifier", + "sentence": "", + "events": [ { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle", - "=", - "Value" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickIdentifier" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": [ + ], + "parameters": [ { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "SpriteMultitouchJoystick::JoystickForce(ControllerIdentifier, JoystickIdentifier) * cos(ToRad(SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)))" - ] + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" + ], + "objectGroups": [] }, { - "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": [ + "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": { - "value": "SetReturnNumber" - }, - "parameters": [ - "SpriteMultitouchJoystick::JoystickForce(ControllerIdentifier, JoystickIdentifier) * sin(ToRad(SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)))" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "DeadZoneRadius" + ] + } ] } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "supplementaryInformation": "[\"Primary\",\"Secondary\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ - { - "description": "Joystick that can be controlled by interacting with a touchscreen.", - "fullName": "Multitouch Joystick", - "name": "MultitouchJoystick", - "objectType": "", - "private": true, - "eventsFunctions": [ { "fullName": "", - "functionType": "Action", - "name": "onCreated", + "functionType": "ActionWithOperator", + "getterName": "DeadZoneRadius", + "name": "SetDeadZoneRadius", "sentence": "", "events": [ { @@ -27015,23 +31114,24 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::SetDeadZone" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyDeadZoneRadius" }, "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "DeadZoneRadius", - "" + "Object", + "Behavior", + "=", + "Value" ] }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + "value": "SpriteMultitouchJoystick::SetDeadZone" }, "parameters": [ - "Object", - "Behavior", + "", + "ControllerIdentifier", + "JoystickIdentifier", + "Value", "" ] } @@ -27054,10 +31154,11 @@ "objectGroups": [] }, { - "fullName": "", + "description": "Force the joystick into the pressing state.", + "fullName": "Force start pressing", "functionType": "Action", - "name": "onDeActivate", - "sentence": "", + "name": "ForceStartPressing", + "sentence": "Force start pressing _PARAM0_ with touch identifier: _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -27065,12 +31166,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" }, "parameters": [ "Object", "Behavior", - "" + "=", + "Value" ] } ] @@ -27087,10 +31189,93 @@ "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...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "String", + "label": "Joystick name", + "description": "", + "group": "", + "extraInformation": [], + "name": "JoystickIdentifier" + }, + { + "value": "0.4", + "type": "Number", + "label": "Dead zone radius (range: 0 to 1)", + "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", + "group": "", + "extraInformation": [], + "name": "DeadZoneRadius" + }, + { + "value": "0", + "type": "Number", + "label": "Joystick angle (range: -180 to 180)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "JoystickAngle" + }, + { + "value": "0", + "type": "Number", + "label": "Joystick force (range: 0 to 1)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "JoystickForce" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchId" }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchIndex" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Detect button presses made on a touchscreen.", + "fullName": "Multitouch button", + "name": "MultitouchButton", + "objectType": "", + "eventsFunctions": [ { "fullName": "", "functionType": "Action", @@ -27102,9 +31287,11 @@ "conditions": [ { "type": { - "value": "HasGameJustResumed" + "value": "SpriteMultitouchJoystick::MultitouchButton::IsReleased" }, "parameters": [ + "Object", + "Behavior", "" ] } @@ -27112,210 +31299,206 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyIsReleased" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" }, "parameters": [ "Object", "Behavior", + "\"Idle\"", "" ] } ] }, { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Manage touches", - "source": "", - "type": "BuiltinCommonInstructions::Group", + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HasAnyTouchOrMouseStarted" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - } - ], + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StartedTouchOrMouseCount()", + "conditions": [], + "actions": [], "events": [ { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "StartedTouchOrMouseCount()", - "conditions": [], - "actions": [], - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - }, + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ { "type": { "value": "CollisionPoint" }, "parameters": [ "Object", - "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)" + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer())", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer())" ] - } - ], - "actions": [ + }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyRadius" }, "parameters": [ "Object", "Behavior", - "=", - "StartedTouchOrMouseId(TouchIndex)" + ">", + "DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer()), TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer()))" ] } ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StartedTouchOrMouseId(TouchIndex)" + ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "1" - ] - } + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" + }, + "parameters": [ + "Object", + "Behavior", + "\"Pressed\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchIndex" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" ] } ] } ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" }, - "comment": "Move thumb back to center when not being pressed (acts like a spring on a real controller)" + "parameters": [ + "Object", + "Behavior", + "" + ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "HasTouchEnded" - }, - "parameters": [ - "", - "TouchId" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } + "type": { + "value": "HasTouchEnded" + }, + "parameters": [ + "", + "TouchId" ] } ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Update joystick position", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" - }, - "parameters": [ - "Object", - "Behavior", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickAngle" - }, - "parameters": [ - "Object", - "Behavior", - "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(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)", - "" - ] - } + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" + }, + "parameters": [ + "Object", + "Behavior", + "\"Released\"", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyIsReleased" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" ] } - ], - "parameters": [] + ] } ], "parameters": [ @@ -27327,37 +31510,44 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", "type": "behavior" } ], "objectGroups": [] }, { - "description": "the joystick force (from 0 to 1).", - "fullName": "Joystick force", - "functionType": "ExpressionAndCondition", - "name": "JoystickForce", - "sentence": "the joystick force", + "description": "Check if button is released.", + "fullName": "Button released", + "functionType": "Condition", + "name": "IsReleased", + "sentence": "Button _PARAM0_ is released", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyIsReleased" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" }, "parameters": [ - "max(0, JoystickForce - DeadZoneRadius) / (1 - DeadZoneRadius)" + "True" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -27367,45 +31557,41 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "JoystickForce", - "name": "SetJoystickForce", - "private": true, - "sentence": "", + "description": "Check if button is pressed.", + "fullName": "Button pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Button _PARAM0_ is pressed", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickForce" + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyTouchId" }, "parameters": [ "Object", "Behavior", - "=", - "Value" + "!=", + "0" ] - }, + } + ], + "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::SetJoystickForce" + "value": "SetReturnBoolean" }, "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "JoystickForce", - "" + "True" ] } ] @@ -27420,18 +31606,18 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Return the angle the joystick is pointing towards (Range: -180 to 180).", - "fullName": "Joystick angle", - "functionType": "Expression", - "name": "JoystickAngle", - "sentence": "", + "fullName": "Button state", + "functionType": "Action", + "name": "SetButtonState", + "private": true, + "sentence": "Mark the button _PARAM0_ as _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -27439,18 +31625,19 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::SetButtonState" }, "parameters": [ - "JoystickAngle" + "", + "ControllerIdentifier", + "ButtonIdentifier", + "ButtonState", + "" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -27460,95 +31647,242 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", "type": "behavior" + }, + { + "description": "Button state", + "name": "ButtonState", + "supplementaryInformation": "[\"Idle\",\"Pressed\",\"Released\"]", + "type": "stringWithSelector" } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" }, { - "description": "Change the angle the joystick is pointing towards (Range: -180 to 180).", - "fullName": "Joystick angle", + "value": "A", + "type": "String", + "label": "Button identifier", + "description": "", + "group": "", + "extraInformation": [], + "name": "ButtonIdentifier" + }, + { + "value": "0", + "type": "Number", + "label": "TouchID", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchId" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchIndex" + }, + { + "value": "", + "type": "Boolean", + "label": "Button released", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsReleased" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Triggering circle radius", + "description": "This circle adds up to the object collision mask.", + "group": "", + "extraInformation": [], + "name": "Radius" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a platformer character with a multitouch controller.", + "fullName": "Platformer multitouch controller mapper", + "name": "PlatformerMultitouchMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", "functionType": "Action", - "name": "SetJoystickAngle", - "private": true, - "sentence": "Change the joystick angle of _PARAM0_ to _PARAM2_", + "name": "doStepPreEvents", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Left\"", + "" + ] + } + ], "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickAngle" + "value": "PlatformBehavior::SimulateLeftKey" }, "parameters": [ "Object", - "Behavior", - "=", - "Value" + "Property" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::SetJoystickAngle" + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" }, "parameters": [ "", "ControllerIdentifier", "JoystickIdentifier", - "JoystickAngle", + "\"Right\"", "" ] } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "Property" + ] + } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" + "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" + ] + } + ] }, { - "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": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "Property" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsButtonPressed" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JumpButton", + "\"Down\"" + ] + } + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "PlatformBehavior::SimulateJumpKey" }, "parameters": [ - "Object.Behavior::JoystickForce() * cos(ToRad(Object.Behavior::JoystickAngle()))" + "Object", + "Property" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -27558,37 +31892,140 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::PlatformerMultitouchMapper", "type": "behavior" } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Platform character behavior", + "description": "", + "group": "", + "extraInformation": [ + "PlatformBehavior::PlatformerObjectBehavior" + ], + "name": "Property" }, { - "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", + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D platformer multitouch controller mapper", + "name": "Platformer3DMultitouchMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "JoystickIdentifier", + "" + ] + } + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "Physics3D::PhysicsCharacter3D::SetForwardAngle" }, "parameters": [ - "Object.Behavior::JoystickForce() * sin(ToRad(Object.Behavior::JoystickAngle()))" + "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" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -27598,53 +32035,124 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::Platformer3DMultitouchMapper", "type": "behavior" } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D physics character", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" }, { - "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_", + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D shooter multitouch controller mapper", + "name": "Shooter3DMultitouchMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" + "value": "SpriteMultitouchJoystick::StickForce" }, "parameters": [ - "Object", - "Behavior", + "", ">", "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::IsAngleIn4WayDirection" + "value": "SpriteMultitouchJoystick::IsButtonPressed" }, "parameters": [ "", - "JoystickAngle", - "Direction", - "" + "ControllerIdentifier", + "JumpButton", + "\"Down\"" ] } ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" }, "parameters": [ - "True" + "Object", + "PhysicsCharacter3D" ] } ] @@ -27659,114 +32167,148 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::Shooter3DMultitouchMapper", "type": "behavior" - }, - { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", - "type": "stringWithSelector" } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D physics character", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" }, { - "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_", + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control camera rotations with a multitouch controller.", + "fullName": "First person camera multitouch controller mapper", + "name": "FirstPersonMultitouchMapper", + "objectType": "", + "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": [ + "conditions": [], + "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyCurrentRotationSpeedZ" }, "parameters": [ "Object", "Behavior", - ">", - "0", - "" + "=", + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedZ, SpriteMultitouchJoystick::StickForceX(ControllerIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" ] }, { "type": { - "value": "SpriteMultitouchJoystick::IsAngleIn8WayDirection" + "value": "SetAngle" }, "parameters": [ - "", - "JoystickAngle", - "Direction", - "" + "Object", + "+", + "CurrentRotationSpeedZ * TimeDelta()" ] - } - ], - "actions": [ + }, { "type": { - "value": "SetReturnBoolean" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyCurrentRotationSpeedY" }, "parameters": [ - "True" + "Object", + "Behavior", + "=", + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedY, SpriteMultitouchJoystick::StickForceY(ControllerIdentifier, CameraStick) * VerticalRotationSpeedMax, VerticalRotationSpeedMax, VerticalRotationAcceleration, VerticalRotationDeceleration)" ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - }, - { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Check if a joystick is pressed.", - "fullName": "Joystick pressed", - "functionType": "Condition", - "name": "IsPressed", - "sentence": "Joystick _PARAM0_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + "value": "Scene3D::Base3DBehavior::SetRotationY" }, "parameters": [ "Object", - "Behavior", - "!=", - "0" + "Object3D", + "+", + "CurrentRotationSpeedY * TimeDelta()" ] - } - ], - "actions": [ + }, { "type": { - "value": "SetReturnBoolean" + "value": "Scene3D::Base3DBehavior::SetRotationY" }, "parameters": [ - "True" + "Object", + "Object3D", + "=", + "clamp(Object.Object3D::RotationY(), VerticalAngleMin, VerticalAngleMax)" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::LookFromObjectEyes" + }, + "parameters": [ + "Object", + "Behavior", + "" ] } ] @@ -27781,19 +32323,20 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Reset the joystick values (except for angle, which stays the same)", - "fullName": "Reset", + "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", - "name": "Reset", + "group": "Layers and cameras", + "name": "LookFromObjectEyes", "private": true, - "sentence": "Reset the joystick of _PARAM0_", + "sentence": "Move the camera to look though _PARAM0_ eyes", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -27801,25 +32344,62 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickForce" + "value": "CentreCamera" }, "parameters": [ + "", "Object", - "Behavior", + "", + "Object.Layer()", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraZ" + }, + "parameters": [ + "", "=", - "0", + "Object.Object3D::Z() + Object.Object3D::Depth() + OffsetZ", + "", "" ] }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + "value": "Scene3D::SetCameraRotationX" }, "parameters": [ - "Object", - "Behavior", + "", "=", - "0" + "- 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()", + "" ] } ] @@ -27834,19 +32414,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], "objectGroups": [] }, { - "description": "the multitouch controller identifier.", - "fullName": "Multitouch controller identifier", + "description": "the maximum horizontal rotation speed of the object.", + "fullName": "Maximum horizontal rotation speed", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "ControllerIdentifier", - "sentence": "the multitouch controller identifier", + "group": "First person camera multitouch controller mapper horizontal rotation configuration", + "name": "HorizontalRotationSpeedMax", + "sentence": "the maximum horizontal rotation speed", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -27857,7 +32437,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "ControllerIdentifier" + "HorizontalRotationSpeedMax" ] } ] @@ -27875,7 +32455,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], @@ -27884,8 +32464,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "ControllerIdentifier", - "name": "SetControllerIdentifier", + "getterName": "HorizontalRotationSpeedMax", + "name": "SetHorizontalRotationSpeedMax", "sentence": "", "events": [ { @@ -27894,7 +32474,7 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyControllerIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationSpeedMax" }, "parameters": [ "Object", @@ -27915,19 +32495,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], "objectGroups": [] }, { - "description": "the joystick name.", - "fullName": "Joystick name", + "description": "the horizontal rotation acceleration of the object.", + "fullName": "Horizontal rotation acceleration", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "JoystickIdentifier", - "sentence": "the joystick name", + "group": "First person camera multitouch controller mapper horizontal rotation configuration", + "name": "HorizontalRotationAcceleration", + "sentence": "the horizontal rotation acceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -27935,17 +32515,17 @@ "actions": [ { "type": { - "value": "SetReturnString" + "value": "SetReturnNumber" }, "parameters": [ - "JoystickIdentifier" + "HorizontalRotationAcceleration" ] } ] } ], "expressionType": { - "type": "string" + "type": "expression" }, "parameters": [ { @@ -27956,7 +32536,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], @@ -27965,8 +32545,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "JoystickIdentifier", - "name": "SetJoystickIdentifier", + "getterName": "HorizontalRotationAcceleration", + "name": "SetHorizontalRotationAcceleration", "sentence": "", "events": [ { @@ -27975,7 +32555,7 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationAcceleration" }, "parameters": [ "Object", @@ -27996,19 +32576,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "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", + "description": "the horizontal rotation deceleration of the object.", + "fullName": "Horizontal rotation deceleration", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "DeadZoneRadius", - "sentence": "the dead zone radius", + "group": "First person camera multitouch controller mapper horizontal rotation configuration", + "name": "HorizontalRotationDeceleration", + "sentence": "the horizontal rotation deceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -28019,7 +32599,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "DeadZoneRadius" + "HorizontalRotationDeceleration" ] } ] @@ -28037,7 +32617,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], @@ -28046,8 +32626,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "DeadZoneRadius", - "name": "SetDeadZoneRadius", + "getterName": "HorizontalRotationDeceleration", + "name": "SetHorizontalRotationDeceleration", "sentence": "", "events": [ { @@ -28056,7 +32636,7 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyDeadZoneRadius" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationDeceleration" }, "parameters": [ "Object", @@ -28077,296 +32657,38 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "1", - "type": "Number", - "label": "Multitouch controller identifier (1, 2, 3, 4...)", - "description": "", - "group": "", - "extraInformation": [], - "name": "ControllerIdentifier" - }, - { - "value": "Primary", - "type": "String", - "label": "Joystick name", - "description": "", - "group": "", - "extraInformation": [], - "name": "JoystickIdentifier" - }, - { - "value": "0.4", - "type": "Number", - "label": "Dead zone radius (range: 0 to 1)", - "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", - "group": "", - "extraInformation": [], - "name": "DeadZoneRadius" - }, - { - "value": "0", - "type": "Number", - "label": "Joystick angle (range: -180 to 180)", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "JoystickAngle" - }, - { - "value": "0", - "type": "Number", - "label": "Joystick force (range: 0 to 1)", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "JoystickForce" - }, - { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "TouchId" }, { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "TouchIndex" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Detect button presses made on a touchscreen.", - "fullName": "Multitouch button", - "name": "MultitouchButton", - "objectType": "", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", + "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": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::IsReleased" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyIsReleased" - }, - "parameters": [ - "Object", - "Behavior", - "no" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" - }, - "parameters": [ - "Object", - "Behavior", - "\"Idle\"", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "HasAnyTouchOrMouseStarted" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchIndex" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "StartedTouchOrMouseCount()", - "conditions": [], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "CollisionPoint" - }, - "parameters": [ - "Object", - "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "StartedTouchOrMouseId(TouchIndex)" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" - }, - "parameters": [ - "Object", - "Behavior", - "\"Pressed\"", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchIndex" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "1" - ] - } - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "HasTouchEnded" - }, - "parameters": [ - "", - "TouchId" - ] - } - ], - "actions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" - }, - "parameters": [ - "Object", - "Behavior", - "\"Released\"", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyIsReleased" - }, - "parameters": [ - "Object", - "Behavior", - "yes" - ] - }, + "conditions": [], + "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "0" + "VerticalRotationSpeedMax" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -28376,44 +32698,78 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if button is released.", - "fullName": "Button released", - "functionType": "Condition", - "name": "IsReleased", - "sentence": "Button _PARAM0_ is released", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationSpeedMax", + "name": "SetVerticalRotationSpeedMax", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyIsReleased" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationSpeedMax" }, "parameters": [ "Object", - "Behavior" + "Behavior", + "=", + "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": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "VerticalRotationAcceleration" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -28423,41 +32779,32 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if button is pressed.", - "fullName": "Button pressed", - "functionType": "Condition", - "name": "IsPressed", - "sentence": "Button _PARAM0_ is pressed", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationAcceleration", + "name": "SetVerticalRotationAcceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyTouchId" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationAcceleration" }, "parameters": [ "Object", "Behavior", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "=", + "Value" ] } ] @@ -28472,18 +32819,19 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "Button state", - "functionType": "Action", - "name": "SetButtonState", - "private": true, - "sentence": "Mark the button _PARAM0_ as _PARAM2_", + "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", @@ -28491,19 +32839,18 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::SetButtonState" + "value": "SetReturnNumber" }, "parameters": [ - "", - "ControllerIdentifier", - "ButtonIdentifier", - "ButtonState", - "" + "VerticalRotationDeceleration" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -28513,227 +32860,275 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" - }, - { - "description": "Button state", - "name": "ButtonState", - "supplementaryInformation": "[\"Idle\",\"Pressed\",\"Released\"]", - "type": "stringWithSelector" } ], "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "1", - "type": "Number", - "label": "Multitouch controller identifier (1, 2, 3, 4...)", - "description": "", - "group": "", - "extraInformation": [], - "name": "ControllerIdentifier" - }, - { - "value": "A", - "type": "String", - "label": "Button identifier", - "description": "", - "group": "", - "extraInformation": [], - "name": "ButtonIdentifier" - }, - { - "value": "0", - "type": "Number", - "label": "TouchID", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "TouchId" - }, - { - "value": "", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "TouchIndex" }, - { - "value": "", - "type": "Boolean", - "label": "Button released", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "IsReleased" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Control a platformer character with a multitouch controller.", - "fullName": "Platformer multitouch controller mapper", - "name": "PlatformerMultitouchMapper", - "objectType": "", - "eventsFunctions": [ { "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationDeceleration", + "name": "SetVerticalRotationDeceleration", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Left\"", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "PlatformBehavior::SimulateLeftKey" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationDeceleration" }, "parameters": [ "Object", - "Property" + "Behavior", + "=", + "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": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Right\"", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "PlatformBehavior::SimulateRightKey" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Property" + "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": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Up\"", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "PlatformBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "Property" - ] - }, - { - "type": { - "value": "PlatformBehavior::SimulateLadderKey" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMin" }, "parameters": [ "Object", - "Property" + "Behavior", + "=", + "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": [ + "conditions": [], + "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + "value": "SetReturnNumber" }, "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "\"Down\"", - "" + "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": "PlatformBehavior::SimulateDownKey" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMax" }, "parameters": [ "Object", - "Property" + "Behavior", + "=", + "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": [ + "conditions": [], + "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::IsButtonPressed" + "value": "SetReturnNumber" }, "parameters": [ - "", - "ControllerIdentifier", - "JumpButton", - "\"Down\"" + "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": "PlatformBehavior::SimulateJumpKey" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyOffsetZ" }, "parameters": [ "Object", - "Property" + "Behavior", + "=", + "Value" ] } ] @@ -28748,7 +33143,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::PlatformerMultitouchMapper", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], @@ -28759,13 +33154,13 @@ { "value": "", "type": "Behavior", - "label": "Platform character behavior", + "label": "3D capability", "description": "", "group": "", "extraInformation": [ - "PlatformBehavior::PlatformerObjectBehavior" + "Scene3D::Base3DBehavior" ], - "name": "Property" + "name": "Object3D" }, { "value": "1", @@ -28777,25 +33172,124 @@ "name": "ControllerIdentifier" }, { - "value": "Primary", + "value": "Secondary", "type": "Choice", - "label": "Joystick name", + "label": "Camera joystick", "description": "", "group": "Controls", "extraInformation": [ "Primary", "Secondary" ], - "name": "JoystickIdentifier" + "name": "CameraStick" }, { - "value": "A", - "type": "String", - "label": "Jump button name", + "value": "180", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", "description": "", - "group": "Controls", + "group": "Horizontal rotation", "extraInformation": [], - "name": "JumpButton" + "name": "HorizontalRotationSpeedMax" + }, + { + "value": "360", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationAcceleration" + }, + { + "value": "720", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationDeceleration" + }, + { + "value": "120", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationSpeedMax" + }, + { + "value": "240", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationAcceleration" + }, + { + "value": "480", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationDeceleration" + }, + { + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Minimum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMin" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Maximum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z position offset", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Z", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Y", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedY" } ], "sharedPropertyDescriptors": [] @@ -29508,6 +34002,49 @@ ] } ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::PropertyShouldBeHiddenWhenReleased" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Object", + "no", + "" + ] + } + ] } ], "parameters": [ @@ -29572,7 +34109,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyControllerIdentifier()", + "ControllerIdentifier", "" ] }, @@ -29584,7 +34121,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyJoystickIdentifier()", + "JoystickIdentifier", "" ] }, @@ -29596,7 +34133,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyDeadZoneRadius()", + "DeadZoneRadius", "" ] } @@ -29613,6 +34150,176 @@ ], "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": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::SetPropertyShouldBeHiddenWhenReleased" + }, + "parameters": [ + "Object", + "yes" + ] + }, + { + "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", @@ -30333,6 +35040,16 @@ "extraInformation": [], "hidden": true, "name": "ParentOrigin" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShouldBeHiddenWhenReleased" } ], "objects": [ @@ -30447,12 +35164,12 @@ "category": "Visual effect", "extensionNamespace": "", "fullName": "Shake object", - "helpPath": "https://victrisgames.itch.io/gdevelop-camera-shake-example", + "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWFycm93LWFsbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMywxMUgxOEwxNi41LDkuNUwxNy45Miw4LjA4TDIxLjg0LDEyTDE3LjkyLDE1LjkyTDE2LjUsMTQuNUwxOCwxM0gxM1YxOEwxNC41LDE2LjVMMTUuOTIsMTcuOTJMMTIsMjEuODRMOC4wOCwxNy45Mkw5LjUsMTYuNUwxMSwxOFYxM0g2TDcuNSwxNC41TDYuMDgsMTUuOTJMMi4xNiwxMkw2LjA4LDguMDhMNy41LDkuNUw2LDExSDExVjZMOS41LDcuNUw4LjA4LDYuMDhMMTIsMi4xNkwxNS45Miw2LjA4TDE0LjUsNy41TDEzLDZWMTFaIiAvPjwvc3ZnPg==", "name": "ShakeObject", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/arrow-all.svg", "shortDescription": "Shake an object.", - "version": "1.5.6", + "version": "1.5.7", "description": [ "Shake an object (position, angle or scale).", "", @@ -30486,7 +35203,7 @@ "eventsFunctions": [], "eventsBasedBehaviors": [ { - "description": "Shake an object, using one or more ways to shake (position, angle).\nThis behavior can be used on any type of object.", + "description": "Shake objects with translation and rotation.", "fullName": "Shake object (position, angle)", "name": "ShakeObject_PositionAngle", "objectType": "", @@ -30558,7 +35275,7 @@ "Object", "__ShakeObject_Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -30569,7 +35286,7 @@ "Object", "__ShakeObject_PowerX", "=", - "GetArgumentAsNumber(\"PowerX\")" + "PowerX" ] }, { @@ -30580,7 +35297,7 @@ "Object", "__ShakeObject_PowerY", "=", - "GetArgumentAsNumber(\"PowerY\")" + "PowerY" ] }, { @@ -30591,7 +35308,7 @@ "Object", "__ShakeObject_PowerAngle", "=", - "GetArgumentAsNumber(\"PowerAngle\")" + "PowerAngle" ] }, { @@ -30602,7 +35319,7 @@ "Object", "__ShakeObject_TimeBetweenShakes", "=", - "GetArgumentAsNumber(\"TimeBetweenShakes\")" + "TimeBetweenShakes" ] } ] @@ -32472,10 +37189,10 @@ "sharedPropertyDescriptors": [] }, { - "description": "Shake an object, using one or more ways to shake (position, angle, scale)\nThis behavior can only be used on sprite objects.", + "description": "Shake objects with translation, rotation and scale.", "fullName": "Shake object (position, angle, scale)", "name": "ShakeObject_PositionAngleScale", - "objectType": "Sprite", + "objectType": "", "eventsFunctions": [ { "description": "Shake an object, using one or more ways to shake (position, angle, scale). Make sure to \"Stop shaking\" before starting a new shake if it uses different parameters.", @@ -32544,7 +37261,7 @@ "Object", "__ShakeObject_Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -32555,7 +37272,7 @@ "Object", "__ShakeObject_PowerX", "=", - "GetArgumentAsNumber(\"PowerX\")" + "PowerX" ] }, { @@ -32566,7 +37283,7 @@ "Object", "__ShakeObject_PowerY", "=", - "GetArgumentAsNumber(\"PowerY\")" + "PowerY" ] }, { @@ -32577,7 +37294,7 @@ "Object", "__ShakeObject_PowerAngle", "=", - "GetArgumentAsNumber(\"PowerAngle\")" + "PowerAngle" ] }, { @@ -32588,7 +37305,7 @@ "Object", "__ShakeObject_PowerScale", "=", - "GetArgumentAsNumber(\"PowerScale\")" + "PowerScale" ] }, { @@ -32599,7 +37316,7 @@ "Object", "__ShakeObject_TimeBetweenShakes", "=", - "GetArgumentAsNumber(\"TimeBetweenShakes\")" + "TimeBetweenShakes" ] } ] @@ -32846,7 +37563,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -33188,10 +37904,11 @@ "actions": [ { "type": { - "value": "ChangeScale" + "value": "ScalableCapability::ScalableBehavior::SetValue" }, "parameters": [ "Object", + "Scale", "-", "Object.Variable(__ShakeObject_ScaleTravelled)" ] @@ -34096,10 +38813,11 @@ "actions": [ { "type": { - "value": "ChangeScale" + "value": "ScalableCapability::ScalableBehavior::SetValue" }, "parameters": [ "Object", + "Scale", "+", "round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" ] @@ -34377,10 +39095,11 @@ "actions": [ { "type": { - "value": "ChangeScale" + "value": "ScalableCapability::ScalableBehavior::SetValue" }, "parameters": [ "Object", + "Scale", "-", "round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" ] @@ -34637,10 +39356,11 @@ "actions": [ { "type": { - "value": "ChangeScale" + "value": "ScalableCapability::ScalableBehavior::SetValue" }, "parameters": [ "Object", + "Scale", "-", "Object.Variable(__ShakeObject_ScaleTravelled)" ] @@ -34717,39 +39437,547 @@ ], "parameters": [] } - ], - "parameters": [] + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngleScale", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Stop shaking an object.", + "fullName": "Stop shaking an object", + "functionType": "Action", + "name": "StopShaking", + "sentence": "Stop shaking _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ShakeObject::ShakeObject_PositionAngleScale::IsShaking" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_ShakeInProgress", + "=", + "-1" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngleScale", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if an object is shaking.", + "fullName": "Check if an object is shaking", + "functionType": "Condition", + "name": "IsShaking", + "sentence": "_PARAM0_ is shaking", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Object", + "__ShakeObject_ShakeInProgress", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngleScale", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Scalable capability", + "description": "", + "group": "", + "extraInformation": [ + "ScalableCapability::ScalableBehavior" + ], + "name": "Scale" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "name": "Property" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Audio", + "extensionNamespace": "", + "fullName": "Volume Falloff", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZvbHVtZS1zb3VyY2UiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMyA5VjE1SDdMMTIgMjBWNEw3IDlIM00xNiAxNUgxNFY5SDE2VjE1TTIwIDE5SDE4VjVIMjBWMTlaIiAvPjwvc3ZnPg==", + "name": "VolumeFalloff", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/volume-source.svg", + "shortDescription": "Simple volume falloff.", + "version": "1.0.1", + "description": "Simple volume falloff based on distance from an object to another object.", + "tags": [ + "volume", + "sound", + "audio", + "falloff", + "distance" + ], + "authorIds": [ + "1vKGH4y6Y5Myz3MaqRdwpju3arq2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Set volume for a channel based on a falloff distance between two objects.", + "fullName": "Set volume based on falloff", + "functionType": "Action", + "name": "SetVolumeFalloff", + "sentence": "Volume falloff on channel _PARAM1_ (type _PARAM2_) from _PARAM3_ to _PARAM4_ with volume from _PARAM5_ to _PARAM6_ starting at a distance of _PARAM7_ pixels", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StrEqual" + }, + "parameters": [ + "GetArgumentAsString(\"AudioType\")", + "=", + "\"Sound\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVolumeSoundCanal" + }, + "parameters": [ + "", + "GetArgumentAsNumber(\"Channel\")", + "=", + "lerp(GetArgumentAsNumber(\"MinVol\"), GetArgumentAsNumber(\"MaxVol\"), max((GetArgumentAsNumber(\"MaxDistance\") - DistanceBetweenPositions(Source.X(), Source.Y(), Target.X(), Target.Y()))/GetArgumentAsNumber(\"MaxDistance\"), 0))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StrEqual" + }, + "parameters": [ + "GetArgumentAsString(\"AudioType\")", + "=", + "\"Music\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ModVolumeMusicCanal" + }, + "parameters": [ + "", + "GetArgumentAsNumber(\"Channel\")", + "=", + "lerp(GetArgumentAsNumber(\"MinVol\"), GetArgumentAsNumber(\"MaxVol\"), max((GetArgumentAsNumber(\"MaxDistance\") - DistanceBetweenPositions(Source.X(), Source.Y(), Target.X(), Target.Y()))/GetArgumentAsNumber(\"MaxDistance\"), 0))" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Channel identifier", + "name": "Channel", + "type": "expression" + }, + { + "description": "Audio type", + "name": "AudioType", + "supplementaryInformation": "[\"Music\",\"Sound\"]", + "type": "stringWithSelector" + }, + { + "description": "Source object", + "name": "Source", + "type": "objectList" + }, + { + "description": "Target object", + "name": "Target", + "type": "objectList" + }, + { + "description": "Minimum volume", + "longDescription": "From 0 to 100, 100 by default.", + "name": "MinVol", + "type": "expression" + }, + { + "description": "Maximum volume", + "longDescription": "From 0 to 100, 100 by default.", + "name": "MaxVol", + "type": "expression" + }, + { + "description": "Max distance", + "longDescription": "Maximum distance before volume has completely fallen off in pixels.", + "name": "MaxDistance", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "", + "extensionNamespace": "", + "fullName": "", + "helpPath": "", + "iconUrl": "", + "name": "Enemy", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "", + "tags": [], + "authorIds": [], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Trigger a fly enemy death.", + "fullName": "Trigger fly death", + "functionType": "Action", + "name": "TriggerFlyDeath", + "sentence": "Trigger _PARAM1_ death", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Disable the behavior that moved the fly up and down, add a downward force (90 degrees = down) and make fly rotate back and forth" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Fly", + "RectangularMovement", + "no" + ] + }, + { + "type": { + "value": "AddForceAL" + }, + "parameters": [ + "Fly", + "90", + "150", + "1" + ] + }, + { + "type": { + "value": "ShakeObject::ShakeObject_PositionAngle::ShakeObject_PositionAngle" + }, + "parameters": [ + "Fly", + "ShakeObject_PositionAngle", + "300", + "0", + "0", + "30", + "0.3", + "yes", + "" + ] + }, + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Fly", + "Dead", + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "", + "name": "Fly", + "type": "objectList" + }, + { + "description": "", + "name": "RectangularMovement", + "supplementaryInformation": "RectangleMovement::RectangleMovement", + "type": "behavior" + }, + { + "description": "", + "name": "ShakeObject_PositionAngle", + "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngle", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a fly enemy is dead.", + "fullName": "Is the fly dead", + "functionType": "Condition", + "name": "IsFlyDead", + "sentence": "_PARAM1_ is dead", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Fly", + "Dead", + "True" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "", + "name": "Fly", + "type": "objectList" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [ + { + "description": "", + "fullName": "", + "name": "MonsterEnemy", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Timers must be started with an action" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Fire\"" + ] + }, + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "\"Fire\"" + ] + } + ] } ], "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngleScale", + "supplementaryInformation": "Enemy::MonsterEnemy", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Stop shaking an object.", - "fullName": "Stop shaking an object", + "fullName": "", "functionType": "Action", - "name": "StopShaking", - "sentence": "Stop shaking _PARAM0_", + "name": "doStepPreEvents", + "sentence": "", "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Turn \"Fire\" on and off" + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "ShakeObject::ShakeObject_PositionAngleScale::IsShaking" + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Fire\"", + ">=", + "2" + ] + }, + { + "type": { + "value": "Enemy::MonsterEnemy::IsOnFire" }, "parameters": [ "Object", @@ -34761,13 +39989,71 @@ "actions": [ { "type": { - "value": "ModVarObjet" + "value": "ResetObjectTimer" }, "parameters": [ "Object", - "__ShakeObject_ShakeInProgress", + "\"Fire\"" + ] + }, + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", "=", - "-1" + "\"NoFire\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"Fire\"", + ">=", + "2" + ] + }, + { + "type": { + "inverted": true, + "value": "Enemy::MonsterEnemy::IsOnFire" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Fire\"" + ] + }, + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animation", + "=", + "\"Fire\"" ] } ] @@ -34777,37 +40063,36 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngleScale", + "supplementaryInformation": "Enemy::MonsterEnemy", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if an object is shaking.", - "fullName": "Check if an object is shaking", + "description": "Check if an ennemy is on fire.", + "fullName": "On fire", "functionType": "Condition", - "name": "IsShaking", - "sentence": "_PARAM0_ is shaking", + "name": "IsOnFire", + "sentence": "_PARAM0_ is on fire", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "VarObjet" + "value": "AnimatableCapability::AnimatableBehavior::Name" }, "parameters": [ "Object", - "__ShakeObject_ShakeInProgress", + "Animation", "=", - "1" + "\"Fire\"" ] } ], @@ -34825,112 +40110,317 @@ ], "parameters": [ { - "description": "Object", - "name": "Object", - "supplementaryInformation": "Sprite", - "type": "object" + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Enemy::MonsterEnemy", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Animatable capability", + "description": "", + "group": "", + "extraInformation": [ + "AnimatableCapability::AnimatableBehavior" + ], + "name": "Animation" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "", + "extensionNamespace": "", + "fullName": "", + "helpPath": "", + "iconUrl": "", + "name": "Player", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "", + "tags": [], + "authorIds": [], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Animate the character to be absorbed into the portal.", + "fullName": "Absorb into a portal", + "functionType": "Action", + "name": "AnimateFallingIntoPortal", + "sentence": "Animate _PARAM1_ to be absorbed into _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Tween::TweenBehavior::AddObjectPositionTween2" + }, + "parameters": [ + "Player", + "Tween", + "\"MoveIntoPortal\"", + "Portal.CenterX() + Player.Width() / 2", + "Portal.CenterY()", + "\"linear\"", + "1", + "no" + ] + }, + { + "type": { + "value": "Tween::TweenBehavior::AddObjectAngleTween2" + }, + "parameters": [ + "Player", + "Tween", + "\"RotateIntoPortal\"", + "360", + "\"linear\"", + "1", + "no" + ] + }, + { + "type": { + "value": "Wait" + }, + "parameters": [ + "0.75" + ] + }, + { + "type": { + "value": "Tween::TweenBehavior::AddObjectScaleTween2" + }, + "parameters": [ + "Player", + "Tween", + "\"ShrinkIntoPortal\"", + "0.01", + "0.01", + "\"easeInSine\"", + "1", + "yes", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "", + "name": "Player", + "type": "objectList" + }, + { + "description": "", + "name": "Tween", + "supplementaryInformation": "Tween::TweenBehavior", + "type": "behavior" + }, + { + "description": "", + "name": "Portal", + "supplementaryInformation": "Sprite", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Make the character bounce on an ennemy.", + "fullName": "Bounce", + "functionType": "Action", + "name": "Bounce", + "sentence": "_PARAM1_ bounce", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SetCanJump" + }, + "parameters": [ + "Player", + "PlatformerObject" + ] }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngleScale", - "type": "behavior" + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Player", + "PlatformerObject" + ] } - ], - "objectGroups": [] + ] } ], - "propertyDescriptors": [], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "Audio", - "extensionNamespace": "", - "fullName": "Volume Falloff", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZvbHVtZS1zb3VyY2UiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMyA5VjE1SDdMMTIgMjBWNEw3IDlIM00xNiAxNUgxNFY5SDE2VjE1TTIwIDE5SDE4VjVIMjBWMTlaIiAvPjwvc3ZnPg==", - "name": "VolumeFalloff", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/volume-source.svg", - "shortDescription": "Simple volume falloff.", - "version": "1.0.1", - "description": "Simple volume falloff based on distance from an object to another object.", - "tags": [ - "volume", - "sound", - "audio", - "falloff", - "distance" - ], - "authorIds": [ - "1vKGH4y6Y5Myz3MaqRdwpju3arq2" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ + "parameters": [ + { + "description": "", + "name": "Player", + "type": "objectList" + }, + { + "description": "", + "name": "PlatformerObject", + "supplementaryInformation": "PlatformBehavior::PlatformerObjectBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, { - "description": "Set volume for a channel based on a falloff distance between two objects.", - "fullName": "Set volume based on falloff", + "description": "Trigger the character death.", + "fullName": "Trigger character death", "functionType": "Action", - "name": "SetVolumeFalloff", - "sentence": "Volume falloff on channel _PARAM1_ (type _PARAM2_) from _PARAM3_ to _PARAM4_ with volume from _PARAM5_ to _PARAM6_ starting at a distance of _PARAM7_ pixels", + "name": "TriggerDeath", + "sentence": "Trigger _PARAM1_ death", "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If player is dead, move back to the last saved checkpoint position" + }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "StrEqual" + "value": "Checkpoints::LoadCheckpoint" }, "parameters": [ - "GetArgumentAsString(\"AudioType\")", - "=", - "\"Sound\"" + "", + "Player", + "Player", + "\"Checkpoint\"", + "\"Checkpoint\"", + "" ] - } - ], - "actions": [ + }, { "type": { - "value": "ModVolumeSoundCanal" + "value": "PlaySound" }, "parameters": [ "", - "GetArgumentAsNumber(\"Channel\")", - "=", - "lerp(GetArgumentAsNumber(\"MinVol\"), GetArgumentAsNumber(\"MaxVol\"), max((GetArgumentAsNumber(\"MaxDistance\") - DistanceBetweenPositions(Source.X(), Source.Y(), Target.X(), Target.Y()))/GetArgumentAsNumber(\"MaxDistance\"), 0))" + "death.mp3", + "", + "50", + "" ] } ] - }, + } + ], + "parameters": [ + { + "description": "", + "name": "Player", + "type": "objectList" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the character is stepping on the floor.", + "fullName": "Character is stepping on the floor", + "functionType": "Condition", + "name": "IsSteppingOnFloor", + "sentence": "_PARAM1_ is stepping on the floor", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "StrEqual" + "value": "PlatformBehavior::IsOnFloor" }, "parameters": [ - "GetArgumentAsString(\"AudioType\")", + "Player", + "PlatformerObject" + ] + }, + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::Name" + }, + "parameters": [ + "Player", + "Animation", "=", - "\"Music\"" + "\"Run\"" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "Sprite" + }, + "parameters": [ + "Player", + "=", + "4" + ] + }, + { + "type": { + "value": "Sprite" + }, + "parameters": [ + "Player", + "=", + "14" + ] + } ] } ], "actions": [ { "type": { - "value": "ModVolumeMusicCanal" + "value": "SetReturnBoolean" }, "parameters": [ - "", - "GetArgumentAsNumber(\"Channel\")", - "=", - "lerp(GetArgumentAsNumber(\"MinVol\"), GetArgumentAsNumber(\"MaxVol\"), max((GetArgumentAsNumber(\"MaxDistance\") - DistanceBetweenPositions(Source.X(), Source.Y(), Target.X(), Target.Y()))/GetArgumentAsNumber(\"MaxDistance\"), 0))" + "True" ] } ] @@ -34938,43 +40428,16 @@ ], "parameters": [ { - "description": "Channel identifier", - "name": "Channel", - "type": "expression" - }, - { - "description": "Audio type", - "name": "AudioType", - "supplementaryInformation": "[\"Music\",\"Sound\"]", - "type": "stringWithSelector" - }, - { - "description": "Source object", - "name": "Source", - "type": "objectList" - }, - { - "description": "Target object", - "name": "Target", + "description": "", + "name": "Player", + "supplementaryInformation": "Sprite", "type": "objectList" }, { - "description": "Minimum volume", - "longDescription": "From 0 to 100, 100 by default.", - "name": "MinVol", - "type": "expression" - }, - { - "description": "Maximum volume", - "longDescription": "From 0 to 100, 100 by default.", - "name": "MaxVol", - "type": "expression" - }, - { - "description": "Max distance", - "longDescription": "Maximum distance before volume has completely fallen off in pixels.", - "name": "MaxDistance", - "type": "expression" + "description": "", + "name": "PlatformerObject", + "supplementaryInformation": "PlatformBehavior::PlatformerObjectBehavior", + "type": "behavior" } ], "objectGroups": [] @@ -34990,7 +40453,7 @@ "fullName": "", "helpPath": "", "iconUrl": "", - "name": "Enemy", + "name": "UserInterface", "previewIconUrl": "", "shortDescription": "", "version": "", @@ -35002,155 +40465,324 @@ "sceneVariables": [], "eventsFunctions": [ { - "description": "Trigger a fly enemy death.", - "fullName": "Trigger fly death", + "description": "Stretch the object to fill the screen", + "fullName": "Stretch to fill the screen", "functionType": "Action", - "name": "TriggerFlyDeath", - "sentence": "Trigger _PARAM1_ death", + "name": "StretchToFillScreen", + "sentence": "Stretch _PARAM1_ to fill the screen", "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Disable the behavior that moved the fly up and down, add a downward force (90 degrees = down) and make fly rotate back and forth" - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "ActivateBehavior" + "value": "ResizableCapability::ResizableBehavior::SetWidth" }, "parameters": [ - "Fly", - "RectangularMovement", - "no" + "EndScreenBackground", + "Resizable", + "=", + "CameraWidth(EndScreenBackground.Layer())" ] }, { "type": { - "value": "AddForceAL" + "value": "ResizableCapability::ResizableBehavior::SetHeight" }, "parameters": [ - "Fly", - "90", - "150", - "1" + "EndScreenBackground", + "Resizable", + "=", + "CameraHeight(EndScreenBackground.Layer())" ] - }, + } + ] + } + ], + "parameters": [ + { + "description": "", + "name": "EndScreenBackground", + "supplementaryInformation": "TiledSpriteObject::TiledSprite", + "type": "objectList" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Input", + "extensionNamespace": "", + "fullName": "Screen Orientation Checker", + "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.0.2", + "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": [ + { + "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": "ShakeObject::ShakeObject_PositionAngle::ShakeObject_PositionAngle" + "value": "SetStringVariable" }, "parameters": [ - "Fly", - "ShakeObject_PositionAngle", - "300", - "0", - "0", - "30", - "0.3", - "yes", - "" + "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", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "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": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "!=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + } + ] + }, + { + "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": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" + }, + "parameters": [ + "Object", + "no" + ] + } + ] + } + ] + } ] }, - { - "type": { - "value": "SetObjectVariableAsBoolean" - }, - "parameters": [ - "Fly", - "Dead", - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "", - "name": "Fly", - "type": "objectList" - }, - { - "description": "", - "name": "RectangularMovement", - "supplementaryInformation": "RectangleMovement::RectangleMovement", - "type": "behavior" - }, - { - "description": "", - "name": "ShakeObject_PositionAngle", - "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngle", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if a fly enemy is dead.", - "fullName": "Is the fly dead", - "functionType": "Condition", - "name": "IsFlyDead", - "sentence": "_PARAM1_ is dead", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ObjectVariableAsBoolean" - }, - "parameters": [ - "Fly", - "Dead", - "True" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "", - "name": "Fly", - "type": "objectList" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ - { - "description": "", - "fullName": "", - "name": "MonsterEnemy", - "objectType": "", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -35161,622 +40793,758 @@ "textG": 0, "textR": 0 }, - "comment": "Timers must be started with an action" + "comment": "Show/hide the screen as needed" }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsShown" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" + ] + } + ] + } + ], "actions": [ { "type": { - "value": "ResetObjectTimer" + "value": "PrimitiveDrawing::FillColor" }, "parameters": [ - "Object", - "\"Fire\"" + "BackgroundPainter", + "BackgroundColor" ] }, { "type": { - "value": "AnimatableCapability::AnimatableBehavior::SetName" + "value": "PrimitiveDrawing::RoundedRectangle" + }, + "parameters": [ + "BackgroundPainter", + "Padding", + "Padding", + "Object.Width()-Padding", + "Object.Height()-Padding", + "CornerRadius" + ] + }, + { + "type": { + "value": "Montre" }, "parameters": [ "Object", - "Animation", - "=", - "\"Fire\"" + "" ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Enemy::MonsterEnemy", - "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": "Turn \"Fire\" on and off" }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "CompareObjectTimer" + "inverted": true, + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsShown" }, "parameters": [ - "Object", - "\"Fire\"", - ">=", - "2" + "Object" ] }, { "type": { - "value": "Enemy::MonsterEnemy::IsOnFire" + "inverted": true, + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" }, "parameters": [ - "Object", - "Behavior", - "" + "Object" ] } ], "actions": [ { "type": { - "value": "ResetObjectTimer" + "value": "Cache" }, "parameters": [ - "Object", - "\"Fire\"" + "Object" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { "type": { - "value": "AnimatableCapability::AnimatableBehavior::SetName" + "value": "MettreY" }, "parameters": [ - "Object", - "Animation", + "Icon", "=", - "\"NoFire\"" + "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": { - "value": "CompareObjectTimer" + "inverted": true, + "value": "Tween::Exists" }, "parameters": [ - "Object", - "\"Fire\"", - ">=", - "2" + "Icon", + "Tween", + "\"Rotate\"" ] }, { "type": { "inverted": true, - "value": "Enemy::MonsterEnemy::IsOnFire" + "value": "Tween::Exists" }, "parameters": [ - "Object", - "Behavior", - "" + "Icon", + "Tween", + "\"RotateBack\"" ] } ], "actions": [ { "type": { - "value": "ResetObjectTimer" - }, - "parameters": [ - "Object", - "\"Fire\"" - ] - }, - { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::SetName" + "value": "Tween::TweenBehavior::AddObjectAngleTween2" }, "parameters": [ - "Object", - "Animation", - "=", - "\"Fire\"" + "Icon", + "Tween", + "\"Rotate\"", + "8", + "\"easeInOutQuad\"", + "2", + "" ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Enemy::MonsterEnemy", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if an ennemy is on fire.", - "fullName": "On fire", - "functionType": "Condition", - "name": "IsOnFire", - "sentence": "_PARAM0_ is on fire", - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "AnimatableCapability::AnimatableBehavior::Name" + "value": "Tween::HasFinished" }, "parameters": [ - "Object", - "Animation", - "=", - "\"Fire\"" + "Icon", + "Tween", + "\"RotateBack\"" ] } ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "Tween::TweenBehavior::AddObjectAngleTween2" }, "parameters": [ - "True" + "Icon", + "Tween", + "\"Rotate\"", + "8", + "\"easeInOutQuad\"", + "2", + "" ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Enemy::MonsterEnemy", - "type": "behavior" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "Animatable capability", - "description": "", - "group": "", - "extraInformation": [ - "AnimatableCapability::AnimatableBehavior" - ], - "name": "Animation" - } - ], - "sharedPropertyDescriptors": [] - } - ], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "", - "extensionNamespace": "", - "fullName": "", - "helpPath": "", - "iconUrl": "", - "name": "Player", - "previewIconUrl": "", - "shortDescription": "", - "version": "", - "description": "", - "tags": [], - "authorIds": [], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Animate the character to be absorbed into the portal.", - "fullName": "Absorb into a portal", - "functionType": "Action", - "name": "AnimateFallingIntoPortal", - "sentence": "Animate _PARAM1_ to be absorbed into _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Tween::TweenBehavior::AddObjectPositionTween2" - }, - "parameters": [ - "Player", - "Tween", - "\"MoveIntoPortal\"", - "Portal.CenterX() + Player.Width() / 2", - "Portal.CenterY()", - "\"linear\"", - "1", - "no" - ] - }, - { - "type": { - "value": "Tween::TweenBehavior::AddObjectAngleTween2" - }, - "parameters": [ - "Player", - "Tween", - "\"RotateIntoPortal\"", - "360", - "\"linear\"", - "1", - "no" - ] - }, - { - "type": { - "value": "Wait" - }, - "parameters": [ - "0.75" - ] - }, - { - "type": { - "value": "Tween::TweenBehavior::AddObjectScaleTween2" - }, - "parameters": [ - "Player", - "Tween", - "\"ShrinkIntoPortal\"", - "0.01", - "0.01", - "\"easeInSine\"", - "1", - "yes", - "yes" - ] - } - ] - } - ], - "parameters": [ - { - "description": "", - "name": "Player", - "type": "objectList" - }, - { - "description": "", - "name": "Tween", - "supplementaryInformation": "Tween::TweenBehavior", - "type": "behavior" - }, - { - "description": "", - "name": "Portal", - "supplementaryInformation": "Sprite", - "type": "objectList" - } - ], - "objectGroups": [] - }, - { - "description": "Make the character bounce on an ennemy.", - "fullName": "Bounce", - "functionType": "Action", - "name": "Bounce", - "sentence": "_PARAM1_ bounce", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SetCanJump" - }, - "parameters": [ - "Player", - "PlatformerObject" - ] - }, - { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Player", - "PlatformerObject" - ] - } - ] - } - ], - "parameters": [ - { - "description": "", - "name": "Player", - "type": "objectList" - }, - { - "description": "", - "name": "PlatformerObject", - "supplementaryInformation": "PlatformBehavior::PlatformerObjectBehavior", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Trigger the character death.", - "fullName": "Trigger character death", - "functionType": "Action", - "name": "TriggerDeath", - "sentence": "Trigger _PARAM1_ death", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "If player is dead, move back to the last saved checkpoint position" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Checkpoints::LoadCheckpoint" - }, - "parameters": [ - "", - "Player", - "Player", - "\"Checkpoint\"", - "\"Checkpoint\"", - "" + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Icon", + "Tween", + "\"RotateBack\"" + ] + } ] }, { - "type": { - "value": "PlaySound" - }, - "parameters": [ - "", - "death.mp3", - "", - "50", - "" + "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": "", - "name": "Player", - "type": "objectList" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the character is stepping on the floor.", - "fullName": "Character is stepping on the floor", - "functionType": "Condition", - "name": "IsSteppingOnFloor", - "sentence": "_PARAM1_ is stepping on the floor", - "events": [ + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + } + ], + "objectGroups": [] + }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "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", + "group": "Screen Orientation Checker configuration", + "name": "IsForceShown", + "sentence": "_PARAM0_ is forced to be shown", + "events": [ { - "type": { - "value": "PlatformBehavior::IsOnFloor" - }, - "parameters": [ - "Player", - "PlatformerObject" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } ] - }, + } + ], + "parameters": [ { - "type": { - "value": "AnimatableCapability::AnimatableBehavior::Name" - }, - "parameters": [ - "Player", - "Animation", - "=", - "\"Run\"" + "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", + "group": "Screen Orientation Checker configuration", + "name": "SetIsForceShown", + "sentence": "Force _PARAM0_ to be shown: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsForceShown" + }, + "parameters": [ + "Object", + "no" + ] + } ] }, { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "Sprite" + "value": "GetArgumentAsBoolean" }, "parameters": [ - "Player", - "=", - "4" + "\"Value\"" ] - }, + } + ], + "actions": [ { "type": { - "value": "Sprite" + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsForceShown" }, "parameters": [ - "Player", - "=", - "14" + "Object", + "yes" ] } ] } ], - "actions": [ + "parameters": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", + "type": "object" + }, + { + "defaultValue": "yes", + "description": "Force show the screen?", + "name": "Value", + "optional": true, + "type": "yesorno" } - ] + ], + "objectGroups": [] } ], - "parameters": [ + "propertyDescriptors": [ { + "value": "", + "type": "Boolean", + "label": "", "description": "", - "name": "Player", - "supplementaryInformation": "Sprite", - "type": "objectList" + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsShown" + }, + { + "value": "", + "type": "Boolean", + "label": "Force show the screen", + "description": "Use this to test the screen in your game", + "group": "", + "extraInformation": [], + "name": "IsForceShown" }, { + "value": "5", + "type": "Number", + "unit": "Pixel", + "label": "Padding", "description": "", - "name": "PlatformerObject", - "supplementaryInformation": "PlatformBehavior::PlatformerObjectBehavior", - "type": "behavior" + "group": "Appearance", + "extraInformation": [], + "name": "Padding" + }, + { + "value": "10", + "type": "Number", + "unit": "Pixel", + "label": "Corner radius", + "description": "Corner radius for the background", + "group": "Appearance", + "extraInformation": [], + "name": "CornerRadius" + }, + { + "value": "0;0;0", + "type": "Color", + "label": "Background color", + "description": "", + "group": "Appearance", + "extraInformation": [], + "name": "BackgroundColor" } ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "", - "extensionNamespace": "", - "fullName": "", - "helpPath": "", - "iconUrl": "", - "name": "UserInterface", - "previewIconUrl": "", - "shortDescription": "", - "version": "", - "description": "", - "tags": [], - "authorIds": [], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Stretch the object to fill the screen", - "fullName": "Stretch to fill the screen", - "functionType": "Action", - "name": "StretchToFillScreen", - "sentence": "Stretch _PARAM1_ to fill the screen", - "events": [ + "objects": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "assetStoreId": "", + "bold": true, + "italic": false, + "name": "Text", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ { - "type": { - "value": "ResizableCapability::ResizableBehavior::SetWidth" - }, - "parameters": [ - "EndScreenBackground", - "Resizable", - "=", - "CameraWidth(EndScreenBackground.Layer())" - ] + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 0, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false }, { - "type": { - "value": "ResizableCapability::ResizableBehavior::SetHeight" - }, - "parameters": [ - "EndScreenBackground", - "Resizable", - "=", - "CameraHeight(EndScreenBackground.Layer())" + "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, + "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 + } + ] + ] + } + ] + } ] } ] } ], - "parameters": [ + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Text" + }, + { + "objectName": "BackgroundPainter" + }, + { + "objectName": "Icon" + } + ] + }, + "objectsGroups": [], + "layers": [ { - "description": "", - "name": "EndScreenBackground", - "supplementaryInformation": "TiledSpriteObject::TiledSprite", - "type": "objectList" + "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": [] } ], - "objectGroups": [] + "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": [] + } + ] } - ], - "eventsBasedBehaviors": [], - "eventsBasedObjects": [] + ] } ], - "externalLayouts": [], - "externalSourceFiles": [] + "externalLayouts": [ + { + "associatedLayout": "Level", + "name": "Touch controls", + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 160, + "layer": "UI", + "name": "Joystick", + "persistentUuid": "4fa63ba7-da33-466c-9e2d-29c710e232a1", + "width": 160, + "x": 144, + "y": 420, + "zOrder": 62, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 160, + "layer": "UI", + "name": "JumpButton", + "persistentUuid": "62ea7557-4333-4a0d-a16a-5709dae5b0b9", + "width": 160, + "x": 816, + "y": 420, + "zOrder": 28, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 540, + "layer": "UI", + "name": "ScreenOrientationChecker", + "persistentUuid": "449a3b88-d4ee-4039-b9de-95d6c27e30fd", + "width": 960, + "x": 0, + "y": 0, + "zOrder": 63, + "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.7291666666666666, + "windowMask": false + } + } + ] } \ No newline at end of file diff --git a/examples/wave-defense-shooter/assets/rotate-screen-icon.png b/examples/wave-defense-shooter/assets/rotate-screen-icon.png new file mode 100644 index 000000000..a7726dee3 Binary files /dev/null and b/examples/wave-defense-shooter/assets/rotate-screen-icon.png differ diff --git a/examples/wave-defense-shooter/wave-defense-shooter.json b/examples/wave-defense-shooter/wave-defense-shooter.json index e5af7c5f6..816f6751c 100644 --- a/examples/wave-defense-shooter/wave-defense-shooter.json +++ b/examples/wave-defense-shooter/wave-defense-shooter.json @@ -1,9 +1,9 @@ { "firstLayout": "", "gdVersion": { - "build": 99, - "major": 4, - "minor": 0, + "build": 221, + "major": 5, + "minor": 5, "revision": 0 }, "properties": { @@ -16,9 +16,8 @@ "pixelsRounding": true, "projectUuid": "a9dd0966-1216-45c7-abfa-940dc5a704f0", "scaleMode": "nearest", - "sizeOnStartupMode": "", + "sizeOnStartupMode": "scaleOuter", "templateSlug": "", - "useExternalSourceFiles": false, "version": "1.0.0", "name": "Wave Defense Example", "description": "Create a wave defense game without coding, using GDevelop. This beginner-friendly example covers player movement, firing a bullet, enemy logic, leveling up character stats, mobile controls, and spawning the enemies.", @@ -94,7 +93,6 @@ "resources": { "resources": [ { - "alwaysLoaded": false, "file": "assets/TheRoom2.png", "kind": "image", "metadata": "", @@ -103,7 +101,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Player1.png", "kind": "image", "metadata": "", @@ -112,7 +109,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Player2.png", "kind": "image", "metadata": "", @@ -121,7 +117,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Player3.png", "kind": "image", "metadata": "", @@ -130,7 +125,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Player4.png", "kind": "image", "metadata": "", @@ -139,7 +133,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Player22.png", "kind": "image", "metadata": "", @@ -148,7 +141,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Gun1.png", "kind": "image", "metadata": "", @@ -157,7 +149,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Bullet.png", "kind": "image", "metadata": "", @@ -166,7 +157,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Ghost1.png", "kind": "image", "metadata": "", @@ -175,7 +165,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Ghost2.png", "kind": "image", "metadata": "", @@ -184,7 +173,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Ghost3.png", "kind": "image", "metadata": "", @@ -193,7 +181,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Ghost4.png", "kind": "image", "metadata": "", @@ -202,7 +189,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Collision Masks.png", "kind": "image", "metadata": "", @@ -211,7 +197,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Enemy_Spawn_Location.png", "kind": "image", "metadata": "", @@ -220,7 +205,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/EnemyHealthBar2.png", "kind": "image", "metadata": "", @@ -229,7 +213,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Ghost_Hurt1.png", "kind": "image", "metadata": "", @@ -238,7 +221,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Ghost_Hurt2.png", "kind": "image", "metadata": "", @@ -247,7 +229,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Ghost_Hurt3.png", "kind": "image", "metadata": "", @@ -256,7 +237,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Ghost_Hurt4.png", "kind": "image", "metadata": "", @@ -275,7 +255,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Vingette.png", "kind": "image", "metadata": "", @@ -291,7 +270,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/8BitOperatorPlus8Regular_Edited3.png", "kind": "image", "metadata": "", @@ -300,7 +278,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Square White Slider Border.png", "kind": "image", "metadata": "", @@ -313,7 +290,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Square White Slider Fill Bar.png", "kind": "image", "metadata": "", @@ -326,7 +302,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Square White Slider Thumb.png", "kind": "image", "metadata": "", @@ -339,7 +314,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Flat Bar Red Fill Bar.png", "kind": "image", "metadata": "", @@ -352,7 +326,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Flat Bar White Border.png", "kind": "image", "metadata": "", @@ -365,7 +338,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/EXPPoint2.png", "kind": "image", "metadata": "{\"extension\":\".png\"}", @@ -374,7 +346,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Transparent Button With White Blue Border_Hovered.png", "kind": "image", "metadata": "", @@ -387,7 +358,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Transparent Button With White Blue Border_Idle.png", "kind": "image", "metadata": "", @@ -400,7 +370,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Transparent Button With White Blue Border_Pressed.png", "kind": "image", "metadata": "", @@ -424,7 +393,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Spider1.png", "kind": "image", "metadata": "", @@ -433,7 +401,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Spider2.png", "kind": "image", "metadata": "", @@ -442,7 +409,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Spider3.png", "kind": "image", "metadata": "", @@ -451,7 +417,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Spider4.png", "kind": "image", "metadata": "", @@ -460,7 +425,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/SpiderCharging1.png", "kind": "image", "metadata": "", @@ -469,7 +433,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/SpiderCharging2.png", "kind": "image", "metadata": "", @@ -478,7 +441,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/SpiderHurt.png", "kind": "image", "metadata": "", @@ -487,7 +449,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ImpFly1.png", "kind": "image", "metadata": "", @@ -496,7 +457,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ImpFly2.png", "kind": "image", "metadata": "", @@ -505,7 +465,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ImpFly3.png", "kind": "image", "metadata": "", @@ -514,7 +473,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ImpFly5.png", "kind": "image", "metadata": "", @@ -523,7 +481,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/ImpFly6.png", "kind": "image", "metadata": "", @@ -532,7 +489,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ImpHurt.png", "kind": "image", "metadata": "", @@ -541,7 +497,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/EnemyBullet1.png", "kind": "image", "metadata": "", @@ -550,7 +505,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/EnemyBullet2.png", "kind": "image", "metadata": "", @@ -559,7 +513,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/SpiderShadow.png", "kind": "image", "metadata": "", @@ -568,7 +521,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/SpiderDropping.png", "kind": "image", "metadata": "", @@ -577,7 +529,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Line light joystick border.png", "kind": "image", "metadata": "", @@ -590,7 +541,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Line light joystick thumb.png", "kind": "image", "metadata": "", @@ -603,7 +553,6 @@ } }, { - "alwaysLoaded": false, "file": "desktop-icon-512.png", "kind": "image", "metadata": "", @@ -612,7 +561,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "android-icon-192.png", "kind": "image", "metadata": "", @@ -621,7 +569,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "android-icon-144.png", "kind": "image", "metadata": "", @@ -630,7 +577,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "android-icon-96.png", "kind": "image", "metadata": "", @@ -639,7 +585,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "android-icon-72.png", "kind": "image", "metadata": "", @@ -648,7 +593,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "android-icon-48.png", "kind": "image", "metadata": "", @@ -657,7 +601,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "android-icon-36.png", "kind": "image", "metadata": "", @@ -666,7 +609,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "android-windowSplashScreenAnimatedIcon.png", "kind": "image", "metadata": "", @@ -675,7 +617,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-1024.png", "kind": "image", "metadata": "", @@ -684,7 +625,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-180.png", "kind": "image", "metadata": "", @@ -693,7 +633,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-167.png", "kind": "image", "metadata": "", @@ -702,7 +641,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-152.png", "kind": "image", "metadata": "", @@ -711,7 +649,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-144.png", "kind": "image", "metadata": "", @@ -720,7 +657,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-120.png", "kind": "image", "metadata": "", @@ -729,7 +665,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-114.png", "kind": "image", "metadata": "", @@ -738,7 +673,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-100.png", "kind": "image", "metadata": "", @@ -747,7 +681,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-87.png", "kind": "image", "metadata": "", @@ -756,7 +689,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-80.png", "kind": "image", "metadata": "", @@ -765,7 +697,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-76.png", "kind": "image", "metadata": "", @@ -774,7 +705,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-72.png", "kind": "image", "metadata": "", @@ -783,7 +713,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-60.png", "kind": "image", "metadata": "", @@ -792,7 +721,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-58.png", "kind": "image", "metadata": "", @@ -801,7 +729,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-57.png", "kind": "image", "metadata": "", @@ -810,7 +737,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-50.png", "kind": "image", "metadata": "", @@ -819,7 +745,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-40.png", "kind": "image", "metadata": "", @@ -828,7 +753,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-29.png", "kind": "image", "metadata": "", @@ -837,7 +761,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "ios-icon-20.png", "kind": "image", "metadata": "", @@ -846,13 +769,24 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "thumbnail.png", "kind": "image", "metadata": "", "name": "thumbnail.png", "smoothed": false, "userAdded": true + }, + { + "file": "assets/rotate-screen-icon.png", + "kind": "image", + "metadata": "", + "name": "rotate-screen-icon.png", + "smoothed": false, + "userAdded": false, + "origin": { + "identifier": "https://asset-resources.gdevelop.io/public-resources/Mobile Layouts/assets/6a8102ce3340bf9f62300ee1a81ef0b2327b2c6e8d62d7dda68d547f5e2b5969_rotate-screen-icon.png", + "name": "rotate-screen-icon.png" + } } ], "resourceFolders": [] @@ -878,19 +812,19 @@ "fillOpacity": 255, "outlineSize": 1, "outlineOpacity": 255, + "absoluteCoordinates": false, + "clearBetweenFrames": true, + "antialiasing": "none", "fillColor": { - "b": 0, + "r": 0, "g": 0, - "r": 0 + "b": 0 }, "outlineColor": { - "b": 0, + "r": 0, "g": 0, - "r": 0 - }, - "absoluteCoordinates": false, - "clearBetweenFrames": true, - "antialiasing": "none" + "b": 0 + } }, { "assetStoreId": "", @@ -912,19 +846,19 @@ "fillOpacity": 180, "outlineSize": 1, "outlineOpacity": 180, + "absoluteCoordinates": true, + "clearBetweenFrames": false, + "antialiasing": "none", "fillColor": { - "b": 0, + "r": 0, "g": 0, - "r": 0 + "b": 0 }, "outlineColor": { - "b": 0, + "r": 0, "g": 0, - "r": 0 - }, - "absoluteCoordinates": true, - "clearBetweenFrames": false, - "antialiasing": "none" + "b": 0 + } } ], "objectsFolderStructure": { @@ -980,7 +914,7 @@ "gridColor": 10401023, "gridAlpha": 0.8, "snap": true, - "zoomFactor": 0.5017435328637433, + "zoomFactor": 0.6328535003246556, "windowMask": false }, "objectsGroups": [ @@ -1000,6 +934,49 @@ "name": "Quit" } ] + }, + { + "name": "SettingsElement", + "objects": [ + { + "name": "SoundSlider" + }, + { + "name": "MusicSlider" + }, + { + "name": "SoundVolume" + }, + { + "name": "MusicVolume" + }, + { + "name": "Back" + }, + { + "name": "SettingsMarker" + } + ] + }, + { + "name": "MainMenuElement", + "objects": [ + { + "name": "Title" + }, + { + "name": "Play" + }, + { + "name": "SettingsLabel" + }, + { + "name": "Quit" + }, + { + "name": "Marker" + } + ] } ], "variables": [ @@ -1190,6 +1167,22 @@ "numberProperties": [], "stringProperties": [], "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 432, + "layer": "Screen orientation checker", + "name": "ScreenOrientationChecker", + "persistentUuid": "8e638f14-77bd-4ca0-8b91-186b839b45ae", + "width": 768, + "x": 0, + "y": 0, + "zOrder": 13, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] } ], "objects": [ @@ -1592,6 +1585,7 @@ "text": "It displays the value when it changes.", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 20, "color": "221;221;221" } @@ -1674,6 +1668,7 @@ "text": "It displays the value when it changes.", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 20, "color": "221;221;221" } @@ -1689,6 +1684,141 @@ "width": 22 } } + }, + { + "assetStoreId": "e5919fb86a559b00001678c710efe55f4e9f2e032a9ff9610087370f998d57de", + "name": "ScreenOrientationChecker", + "type": "ScreenOrientationChecker::ScreenOrientationChecker", + "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 + }, + "childrenContent": { + "BackgroundPainter": { + "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 + } + }, + "Icon": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "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 + } + ] + ] + } + ] + } + ] + } + ] + }, + "Text": { + "bold": true, + "italic": false, + "smoothed": true, + "underlined": false, + "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, + "color": "255;255;255" + } + } + } } ], "objectsFolderStructure": { @@ -1731,6 +1861,9 @@ }, { "objectName": "Quit" + }, + { + "objectName": "ScreenOrientationChecker" } ] }, @@ -1829,6 +1962,56 @@ "" ] } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SystemInfo::IsMobile" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "ShowLayer" + }, + "parameters": [ + "", + "\"Screen orientation checker\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCenterX" + }, + "parameters": [ + "MainMenuElement", + "=", + "0.5 * CameraWidth()" + ] + }, + { + "type": { + "value": "SetCenterX" + }, + "parameters": [ + "SettingsElement", + "=", + "1.5 * CameraWidth()" + ] + } ] }, { @@ -2181,9 +2364,50 @@ "visibility": true, "cameras": [], "effects": [] + }, + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": true, + "name": "Screen orientation checker", + "renderingType": "", + "visibility": false, + "cameras": [], + "effects": [ + { + "effectType": "Scene3D::HemisphereLight", + "name": "3D Light", + "doubleParameters": { + "elevation": 45, + "intensity": 1, + "rotation": 0 + }, + "stringParameters": { + "groundColor": "64;64;64", + "skyColor": "255;255;255", + "top": "Y-" + }, + "booleanParameters": {} + } + ] } ], "behaviorsSharedData": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior" + }, + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, { "name": "ButtonFSM", "type": "ButtonStates::ButtonFSM" @@ -2200,6 +2424,10 @@ "name": "Flippable", "type": "FlippableCapability::FlippableBehavior" }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, { "name": "Resizable", "type": "ResizableCapability::ResizableBehavior" @@ -2207,6 +2435,10 @@ { "name": "Scale", "type": "ScalableCapability::ScalableBehavior" + }, + { + "name": "Text", + "type": "TextContainerCapability::TextContainerBehavior" } ] }, @@ -2832,38 +3064,6 @@ "numberProperties": [], "stringProperties": [], "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 32, - "height": 96, - "layer": "MobileControls", - "name": "Movement", - "persistentUuid": "6c9f1cd5-970f-42b1-a77e-80129b1ef763", - "width": 96, - "x": 80, - "y": 336, - "zOrder": 34, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 32, - "height": 96, - "layer": "MobileControls", - "name": "Aiming", - "persistentUuid": "35c16455-2e53-4abd-9bc7-3e9e06abc880", - "width": 96, - "x": 688, - "y": 336, - "zOrder": 35, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] } ], "objects": [ @@ -4791,7 +4991,18 @@ "type": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "variables": [], "effects": [], - "behaviors": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], "content": { "PreviousHighValueDuration": 0, "ShowLabel": true, @@ -4864,6 +5075,7 @@ "text": "8 / 16", "font": "", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 16, "color": "255;255;255" } @@ -4998,6 +5210,7 @@ "text": "", "font": "Kenney Mini Square.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 40, "color": "255;255;255" } @@ -5081,6 +5294,7 @@ "text": "", "font": "Kenney Mini Square.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 45, "color": "255;255;255" } @@ -5164,6 +5378,7 @@ "text": "", "font": "Kenney Mini Square.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 45, "color": "255;255;255" } @@ -5217,6 +5432,7 @@ "text": "Wave: 1", "font": "Kenney Mini Square.ttf", "textAlignment": "left", + "verticalTextAlignment": "top", "characterSize": 40, "color": "255;255;255" } @@ -5536,7 +5752,7 @@ "effects": [], "behaviors": [], "content": { - "ControllerIdentifier": 2, + "ControllerIdentifier": 1, "JoystickIdentifier": "Secondary" }, "childrenContent": { @@ -5611,6 +5827,141 @@ ] } } + }, + { + "assetStoreId": "e5919fb86a559b00001678c710efe55f4e9f2e032a9ff9610087370f998d57de", + "name": "ScreenOrientationChecker", + "type": "ScreenOrientationChecker::ScreenOrientationChecker", + "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 + }, + "childrenContent": { + "BackgroundPainter": { + "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 + } + }, + "Icon": { + "adaptCollisionMaskAutomatically": true, + "updateIfNotVisible": false, + "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 + } + ] + ] + } + ] + } + ] + } + ] + }, + "Text": { + "bold": true, + "italic": false, + "smoothed": true, + "underlined": false, + "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, + "color": "255;255;255" + } + } + } } ], "objectsFolderStructure": { @@ -5653,11 +6004,14 @@ { "objectName": "StatsLabel" }, + { + "objectName": "Movement" + }, { "objectName": "Aiming" }, { - "objectName": "Movement" + "objectName": "ScreenOrientationChecker" } ] }, @@ -5805,6 +6159,14 @@ "SpiderSpawnPoints" ] }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "SpawnPoints" + ] + }, { "type": { "value": "CameraShake::SetLayerRotationAmplitude" @@ -5882,7 +6244,6 @@ "conditions": [ { "type": { - "inverted": true, "value": "SystemInfo::IsMobile" }, "parameters": [] @@ -5891,20 +6252,58 @@ "actions": [ { "type": { - "value": "Delete" + "value": "BuiltinExternalLayouts::CreateObjectsFromExternalLayout" }, "parameters": [ - "Movement", - "" + "", + "\"Touch controls\"", + "0", + "0", + "0" ] - }, + } + ], + "events": [ { - "type": { - "value": "Delete" - }, - "parameters": [ - "Aiming", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Movement" + ] + }, + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Aiming" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Movement", + "", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Aiming", + "", + "" + ] + } ] } ] @@ -5914,6 +6313,60 @@ ], "parameters": [] }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "Movement", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "Movement", + "CursorX(\"UI\")" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::HasTouchStartedOnScreenSide" + }, + "parameters": [ + "", + "Movement", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::TeleportAndPress" + }, + "parameters": [ + "Aiming", + "CursorX(\"UI\")" + ] + } + ] + }, { "colorB": 228, "colorG": 176, @@ -6999,57 +7452,19 @@ "" ] } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SystemInfo::IsMobile" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "RotateTowardAngle" - }, - "parameters": [ - "Gun", - "SpriteMultitouchJoystick::StickAngle(2, \"Secondary\")", - "0", - "0" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SystemInfo::IsMobile" - }, - "parameters": [] - } ], - "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + "value": "PosX" }, "parameters": [ - "", - "2", - "\"Secondary\"", - "\"Left\"", - "" + "Player", + "<", + "CursorX()" ] } ], @@ -7061,7 +7476,7 @@ "parameters": [ "Player", "Flippable", - "yes" + "" ] }, { @@ -7071,7 +7486,7 @@ "parameters": [ "Gun", "Flippable", - "yes" + "" ] } ] @@ -7081,14 +7496,12 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + "value": "PosX" }, "parameters": [ - "", - "2", - "\"Secondary\"", - "\"Right\"", - "" + "Player", + ">", + "CursorX()" ] } ], @@ -7100,7 +7513,7 @@ "parameters": [ "Player", "Flippable", - "" + "yes" ] }, { @@ -7110,7 +7523,7 @@ "parameters": [ "Gun", "Flippable", - "" + "yes" ] } ] @@ -7122,25 +7535,38 @@ "conditions": [ { "type": { - "inverted": true, "value": "SystemInfo::IsMobile" }, "parameters": [] } ], - "actions": [], + "actions": [ + { + "type": { + "value": "RotateTowardAngle" + }, + "parameters": [ + "Gun", + "SpriteMultitouchJoystick::StickAngle(1, \"Secondary\")", + "0", + "0" + ] + } + ], "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "PosX" + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" }, "parameters": [ - "Player", - "<", - "CursorX()" + "", + "1", + "\"Secondary\"", + "\"Left\"", + "" ] } ], @@ -7152,7 +7578,7 @@ "parameters": [ "Player", "Flippable", - "" + "yes" ] }, { @@ -7162,7 +7588,7 @@ "parameters": [ "Gun", "Flippable", - "" + "yes" ] } ] @@ -7172,12 +7598,14 @@ "conditions": [ { "type": { - "value": "PosX" + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" }, "parameters": [ - "Player", - ">", - "CursorX()" + "", + "1", + "\"Secondary\"", + "\"Right\"", + "" ] } ], @@ -7189,7 +7617,7 @@ "parameters": [ "Player", "Flippable", - "yes" + "" ] }, { @@ -7199,7 +7627,7 @@ "parameters": [ "Gun", "Flippable", - "yes" + "" ] } ] @@ -7235,11 +7663,11 @@ "subInstructions": [ { "type": { - "value": "MouseButtonPressed" + "value": "MouseButtonFromTextPressed" }, "parameters": [ "", - "Left" + "\"Left\"" ] }, { @@ -7259,7 +7687,7 @@ "", ">", "0", - "2", + "1", "\"Secondary\"", "" ] @@ -7927,7 +8355,7 @@ "Gun", "FireBullet", "=", - "Gun.FireBullet::Cooldown()*0.9", + "Gun.FireBullet::Cooldown() * 0.9", "" ] } @@ -7965,7 +8393,7 @@ "Gun", "FireBullet", "=", - "Gun.FireBullet::AngleVariance()*0.9", + "Gun.FireBullet::AngleVariance() * 0.9", "" ] } @@ -8113,6 +8541,14 @@ } ], "behaviorsSharedData": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior" + }, + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, { "name": "BoidsMovement", "type": "BoidsMovement::BoidsMovement" @@ -8137,6 +8573,10 @@ "name": "Health", "type": "Health::Health" }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, { "name": "Resizable", "type": "ResizableCapability::ResizableBehavior" @@ -8149,6 +8589,10 @@ "name": "ShakeObject_PositionAngle", "type": "ShakeObject::ShakeObject_PositionAngle" }, + { + "name": "Text", + "type": "TextContainerCapability::TextContainerBehavior" + }, { "name": "TopDownMovement", "type": "TopDownMovementBehavior::TopDownMovementBehavior" @@ -8176,7 +8620,7 @@ "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.2.2", + "version": "1.6.1", "description": [ "Multitouch joysticks can be used the same way as physical gamepads:", "- 4 or 8 directions", @@ -8211,111 +8655,47 @@ ], "dependencies": [], "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Check if a button is pressed on a gamepad.", - "fullName": "Multitouch controller button pressed", - "functionType": "Condition", - "name": "IsButtonPressed", - "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarSceneTxt" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", - "=", - "\"Pressed\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Button name", - "name": "Button", - "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", - "type": "string" - } - ], - "objectGroups": [] - }, + "sceneVariables": [ { - "description": "Check if a button is released on a gamepad.", - "fullName": "Multitouch controller button released", - "functionType": "Condition", - "name": "IsButtonReleased", - "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is released", - "events": [ + "name": "Controllers", + "type": "array", + "children": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "type": "structure", + "children": [ { - "type": { - "value": "VarSceneTxt" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", - "=", - "\"Released\"" + "name": "Buttons", + "type": "array", + "children": [ + { + "type": "structure", + "children": [ + { + "name": "State", + "type": "string", + "value": "Idle" + } + ] + } ] - } - ], - "actions": [ + }, { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] + "name": "Joystick", + "type": "structure", + "children": [] } ] } - ], - "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": [] - }, + ] + } + ], + "eventsFunctions": [ { - "description": "Change a button state for a multitouch controller.", - "fullName": "Button state", - "functionType": "Action", - "name": "SetButtonState", + "fullName": "Accelerated speed", + "functionType": "Expression", + "name": "AcceleratedSpeed", "private": true, - "sentence": "Mark _PARAM2_ button as _PARAM3_ for multitouch controller _PARAM1_", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -8323,100 +8703,614 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "AcceleratedSpeed", "=", - "GetArgumentAsString(\"ButtonState\")" + "CurrentSpeed" ] } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Button name", - "name": "Button", - "type": "string" - }, - { - "description": "Button state", - "name": "ButtonState", - "supplementaryInformation": "[\"Idle\",\"Pressed\",\"Released\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Change the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", - "fullName": "Dead zone radius", - "functionType": "Action", - "name": "SetDeadZone", - "private": true, - "sentence": "Change the dead zone of multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + ], + "events": [ { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone", - "=", - "GetArgumentAsNumber(\"DeadZoneRadius\")" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } ] - } - ] - } - ], - "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" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + ">", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"TargetedSpeed\"", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "parameters": [ + "\"CurrentSpeed\"", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(0, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CompareArgumentAsNumber" + }, + "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 is pressed on a gamepad.", + "fullName": "Multitouch controller button pressed", + "functionType": "Condition", + "name": "IsButtonPressed", + "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Buttons[Button].State", + "=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Button name", + "name": "Button", + "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a button is released on a gamepad.", + "fullName": "Multitouch controller button released", + "functionType": "Condition", + "name": "IsButtonReleased", + "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is released", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone)" + "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\",\"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" ] } ] @@ -8456,7 +9350,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 4 / 360), 4)" + "mod(round(Angle * 4 / 360), 4)" ] } ] @@ -8491,7 +9385,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 8 / 360), 8)" + "mod(round(Angle * 8 / 360), 8)" ] } ] @@ -8525,7 +9419,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -8538,7 +9432,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8562,7 +9456,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -8575,7 +9469,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8599,7 +9493,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -8612,7 +9506,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8636,7 +9530,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -8649,7 +9543,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8697,7 +9591,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -8710,7 +9604,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8734,7 +9628,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownRight\"" ] @@ -8747,7 +9641,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8771,7 +9665,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -8784,7 +9678,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8808,7 +9702,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownLeft\"" ] @@ -8821,7 +9715,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8845,7 +9739,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -8858,7 +9752,7 @@ "", "=", "4", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8882,7 +9776,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpLeft\"" ] @@ -8895,7 +9789,7 @@ "", "=", "5", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8919,7 +9813,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -8932,7 +9826,7 @@ "", "=", "6", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8956,7 +9850,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpRight\"" ] @@ -8969,7 +9863,7 @@ "", "=", "7", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9030,9 +9924,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -9042,8 +9936,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -9110,9 +10004,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -9122,8 +10016,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -9178,7 +10072,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -9198,6 +10092,11 @@ "name": "JoystickIdentifier", "supplementaryInformation": "[\"Primary\",\"Secondary\"]", "type": "stringWithSelector" + }, + { + "description": "", + "name": "Coucou", + "type": "expression" } ], "objectGroups": [] @@ -9218,7 +10117,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Force)" + "max(0, Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier)) / (1 - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -9256,12 +10155,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Force", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -9303,7 +10202,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -9343,7 +10242,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle" ] } ] @@ -9381,12 +10280,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -9427,7 +10326,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::JoystickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\")) * cos(ToRad(SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))))" + "XFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -9467,7 +10366,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::JoystickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\")) * sin(ToRad(SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))))" + "YFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -9490,6 +10389,123 @@ } ], "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": "CompareArgumentAsString" + }, + "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": "CompareArgumentAsString" + }, + "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": [ @@ -9516,9 +10532,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyDeadZoneRadius()", + "ControllerIdentifier", + "JoystickIdentifier", + "DeadZoneRadius", "" ] }, @@ -9680,8 +10696,8 @@ }, "parameters": [ "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)" + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer(), 0)" ] } ], @@ -9694,7 +10710,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] } ] @@ -9741,7 +10757,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -9793,8 +10809,8 @@ "parameters": [ "Object", "Behavior", - "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))", - "AngleBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0))" + "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))" ] }, { @@ -9805,7 +10821,7 @@ "Object", "Behavior", "=", - "clamp(2 * DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0), TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)) / Object.Width(), 0, 1)", + "clamp(2 * DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(TouchId, Object.Layer(), 0), TouchY(TouchId, Object.Layer(), 0)) / Object.Width(), 0, 1)", "" ] } @@ -9846,7 +10862,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickForce()" + "max(0, JoystickForce - DeadZoneRadius) / (1 - DeadZoneRadius)" ] } ] @@ -9890,7 +10906,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -9899,9 +10915,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickForce()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickForce", "" ] } @@ -9919,6 +10935,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "", + "name": "Parameter", + "type": "objectList" } ], "objectGroups": [] @@ -9939,7 +10960,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickAngle()" + "JoystickAngle" ] } ] @@ -9983,7 +11004,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -9992,9 +11013,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickAngle()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickAngle", "" ] } @@ -10113,13 +11134,14 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyJoystickForce" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" }, "parameters": [ "Object", "Behavior", ">", - "Object.Behavior::PropertyDeadZoneRadius()" + "0", + "" ] }, { @@ -10128,8 +11150,8 @@ }, "parameters": [ "", - "Object.Behavior::JoystickAngle()", - "GetArgumentAsString(\"Direction\")", + "JoystickAngle", + "Direction", "" ] } @@ -10179,13 +11201,14 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyJoystickForce" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" }, "parameters": [ "Object", "Behavior", ">", - "Object.Behavior::PropertyDeadZoneRadius()" + "0", + "" ] }, { @@ -10194,8 +11217,8 @@ }, "parameters": [ "", - "Object.Behavior::JoystickAngle()", - "GetArgumentAsString(\"Direction\")", + "JoystickAngle", + "Direction", "" ] } @@ -10352,7 +11375,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyControllerIdentifier()" + "ControllerIdentifier" ] } ] @@ -10395,7 +11418,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -10433,7 +11456,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyJoystickIdentifier()" + "JoystickIdentifier" ] } ] @@ -10476,7 +11499,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -10514,7 +11537,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDeadZoneRadius()" + "DeadZoneRadius" ] } ] @@ -10557,7 +11580,59 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "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": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -10574,6 +11649,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "Touch identifier", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -10748,12 +11828,31 @@ "conditions": [ { "type": { - "value": "CollisionPoint" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex()), Object.Layer(), 0)" + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer())", + "TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer())" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyRadius" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer()), TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer()))" + ] + } ] } ], @@ -10766,7 +11865,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] }, { @@ -10822,7 +11921,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -10990,9 +12089,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyButtonIdentifier()", - "GetArgumentAsString(\"ButtonState\")", + "ControllerIdentifier", + "ButtonIdentifier", + "ButtonState", "" ] } @@ -11069,6 +12168,16 @@ "extraInformation": [], "hidden": true, "name": "IsReleased" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Triggering circle radius", + "description": "This circle adds up to the object collision mask.", + "group": "", + "extraInformation": [], + "name": "Radius" } ], "sharedPropertyDescriptors": [] @@ -11094,8 +12203,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -11122,8 +12231,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -11150,8 +12259,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -11187,8 +12296,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -11215,8 +12324,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJumpButton()", + "ControllerIdentifier", + "JumpButton", "\"Down\"" ] } @@ -11296,9 +12405,9 @@ "sharedPropertyDescriptors": [] }, { - "description": "Control a top-down character with a multitouch controller.", - "fullName": "Top-down multitouch controller mapper", - "name": "TopDownMultitouchMapper", + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D platformer multitouch controller mapper", + "name": "Platformer3DMultitouchMapper", "objectType": "", "eventsFunctions": [ { @@ -11312,55 +12421,171 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "value": "SpriteMultitouchJoystick::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "JoystickIdentifier", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SetForwardAngle" }, "parameters": [ "Object", - "Behavior", + "PhysicsCharacter3D", "=", - "\"Analog\"" + "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": "TopDownMovementBehavior::SimulateStick" + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" }, "parameters": [ "Object", - "TopDownMovement", - "SpriteMultitouchJoystick::StickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", - "SpriteMultitouchJoystick::StickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())" + "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", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D shooter multitouch controller mapper", + "name": "Shooter3DMultitouchMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "value": "SpriteMultitouchJoystick::StickForce" }, "parameters": [ - "Object", - "Behavior", - "=", - "\"360°\"" + "", + ">", + "0", + "ControllerIdentifier", + "JoystickIdentifier", + "" ] } ], "actions": [ { "type": { - "value": "TopDownMovementBehavior::SimulateStick" + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" }, "parameters": [ "Object", - "TopDownMovement", - "SpriteMultitouchJoystick::StickAngle(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier())", - "sign(SpriteMultitouchJoystick::StickForce(Object.Behavior::PropertyControllerIdentifier(), Object.Behavior::PropertyJoystickIdentifier()))" + "PhysicsCharacter3D", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -11370,60 +12595,1294 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "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", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control camera rotations with a multitouch controller.", + "fullName": "First person camera multitouch controller mapper", + "name": "FirstPersonMultitouchMapper", + "objectType": "", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyCurrentRotationSpeedZ" }, "parameters": [ "Object", "Behavior", "=", - "\"8 Directions\"" + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedZ, SpriteMultitouchJoystick::StickForceX(ControllerIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "CurrentRotationSpeedZ * TimeDelta()" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyCurrentRotationSpeedY" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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", + "" ] } - ], - "actions": [], - "events": [ + ] + } + ], + "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "TopDownMovementBehavior::DiagonalsAllowed" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "\"Left\"", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateLeftKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } + "type": { + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationAcceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationDeceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationSpeedMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationAcceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationDeceleration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMin" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMax" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyOffsetZ" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "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", + "description": "", + "group": "", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "name": "Object3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" + }, + { + "value": "Secondary", + "type": "Choice", + "label": "Camera joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "CameraStick" + }, + { + "value": "180", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationSpeedMax" + }, + { + "value": "360", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationAcceleration" + }, + { + "value": "720", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Horizontal rotation", + "extraInformation": [], + "name": "HorizontalRotationDeceleration" + }, + { + "value": "120", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationSpeedMax" + }, + { + "value": "240", + "type": "Number", + "label": "Rotation acceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationAcceleration" + }, + { + "value": "480", + "type": "Number", + "label": "Rotation deceleration", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalRotationDeceleration" + }, + { + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Minimum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMin" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Maximum angle", + "description": "", + "group": "Vertical rotation", + "extraInformation": [], + "name": "VerticalAngleMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z position offset", + "description": "", + "group": "Position", + "extraInformation": [], + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Z", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Y", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "CurrentRotationSpeedY" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a top-down character with a multitouch controller.", + "fullName": "Top-down multitouch controller mapper", + "name": "TopDownMultitouchMapper", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "sign(SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "TopDownMovementBehavior::DiagonalsAllowed" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } ] }, { @@ -11435,8 +13894,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -11463,8 +13922,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -11491,8 +13950,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -11536,8 +13995,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -11564,8 +14023,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -11592,8 +14051,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -11620,8 +14079,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -11648,8 +14107,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"UpLeft\"", "" ] @@ -11685,8 +14144,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"UpRight\"", "" ] @@ -11722,8 +14181,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"DownLeft\"", "" ] @@ -11759,8 +14218,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"DownRight\"", "" ] @@ -11860,9 +14319,16 @@ ], "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", "eventsFunctions": [ { @@ -11996,6 +14462,49 @@ ] } ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::PropertyShouldBeHiddenWhenReleased" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Object", + "no", + "" + ] + } + ] } ], "parameters": [ @@ -12060,7 +14569,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyControllerIdentifier()", + "ControllerIdentifier", "" ] }, @@ -12072,7 +14581,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyJoystickIdentifier()", + "JoystickIdentifier", "" ] }, @@ -12084,7 +14593,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyDeadZoneRadius()", + "DeadZoneRadius", "" ] } @@ -12101,6 +14610,176 @@ ], "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": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::SetPropertyShouldBeHiddenWhenReleased" + }, + "parameters": [ + "Object", + "yes" + ] + }, + { + "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", @@ -12447,7 +15126,7 @@ "parameters": [ "Border", "MultitouchJoystick", - "GetArgumentAsString(\"Direction\")", + "Direction", "" ] } @@ -12497,7 +15176,7 @@ "parameters": [ "Border", "MultitouchJoystick", - "GetArgumentAsString(\"Direction\")", + "Direction", "" ] } @@ -12585,7 +15264,7 @@ "Border", "MultitouchJoystick", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -12657,7 +15336,7 @@ "Border", "MultitouchJoystick", "=", - "GetArgumentAsString(\"Value\")", + "Value", "" ] } @@ -12729,7 +15408,7 @@ "Border", "MultitouchJoystick", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -12821,6 +15500,16 @@ "extraInformation": [], "hidden": true, "name": "ParentOrigin" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShouldBeHiddenWhenReleased" } ], "objects": [ @@ -12894,7 +15583,39 @@ "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": [] } ] }, @@ -12908,7 +15629,7 @@ "name": "BoidsMovement", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Glyphster Pack/Master/SVG/Restaurant/Restaurant_restaurant_seafood_animal_fish.svg", "shortDescription": "Simulates flocks movement.", - "version": "0.2.2", + "version": "0.3.2", "description": [ "Simulates swarms or flocks movement following the separation, alignment, cohesion principles. The flock can be attracted to a location or avoid some obstacles.", "", @@ -12931,7 +15652,14 @@ ], "dependencies": [], "globalVariables": [], - "sceneVariables": [], + "sceneVariables": [ + { + "folded": true, + "name": "HasAlreadyRunThisFrame", + "type": "boolean", + "value": false + } + ], "eventsFunctions": [ { "description": "Define helper classes JavaScript code.", @@ -13302,9 +16030,9 @@ " */", " constructor() {", " /**", - " * @type {Map}", + " * @type {Set}", " */", - " this.boids = new Map();", + " this.boids = new Set();", " this.boidsRBush = new rbush();", " }", "", @@ -13314,8 +16042,13 @@ " * @returns {Boid} the created Boid", " */", " add(behavior) {", - " const boid = new Boid(behavior);", - " this.boids.set(behavior.owner.id, boid);", + " if (!behavior.__boidsExtension) {", + " behavior.__boidsExtension = {", + " boid: new Boid(behavior)", + " };", + " }", + " const boid = behavior.__boidsExtension.boid;", + " this.boids.add(boid);", " this.addToRBush(boid);", " return boid;", " }", @@ -13341,9 +16074,10 @@ " * @param {gdjs.RuntimeBehavior} behavior", " */", " remove(behavior) {", - " this.boids.delete(behavior.owner.id);", + " const boid = behavior.__boidsExtension.boid;", + " this.boids.delete(boid);", "", - " this.removeFromRBush(behavior.__boidsExtension.boid);", + " this.removeFromRBush(boid);", " }", "", " /**", @@ -13358,12 +16092,14 @@ " * Move all instances.", " */", " moveAll() {", - " this.boids.forEach(boid => boid.flock());", - " this.boids.forEach(boid => {", + " for (const boid of this.boids) {", + " boid.flock();", + " }", + " for (const boid of this.boids) {", " boid.move();", " this.removeFromRBush(boid);", " this.addToRBush(boid);", - " });", + " }", " }", "", " /**", @@ -13383,6 +16119,7 @@ " searchArea.maxX = x + radius;", " searchArea.maxY = y + radius;", " // TODO The R-Tree should not allocate an array.", + " /** @type {Array} */", " const nearbys = this.boidsRBush.search(searchArea);", "", " const radiusSq = radius * radius;", @@ -13396,6 +16133,9 @@ " if (object === otherObject) {", " continue;", " }", + " if (behavior._getCollisionLayer() !== behavior._getCollisionLayer()) {", + " continue;", + " }", " const distanceSq = object.getSqDistanceToObject(otherObject);", " if (distanceSq < radiusSq) {", " foundBoids.push(behavior.__boidsExtension.boid);", @@ -13470,9 +16210,7 @@ "const object = objects[0];\r", "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r", "const behavior = object.getBehavior(behaviorName);\r", - "behavior.__boidsExtension = behavior.__boidsExtension || {\r", - " boid: runtimeScene.__boidsExtension.boidsManager.add(behavior),\r", - "};" + "runtimeScene.__boidsExtension.boidsManager.add(behavior);" ], "parameterObjects": "Object", "useStrict": true, @@ -13517,10 +16255,11 @@ "conditions": [ { "type": { - "value": "SceneVariableAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "__BoidsBehaviour_hasAlreadyRunThisFrame", + "HasAlreadyRunThisFrame", + "=", "" ] } @@ -13528,21 +16267,25 @@ "actions": [ { "type": { - "value": "SetSceneVariableAsBoolean" + "value": "SetBooleanVariable" }, "parameters": [ - "__BoidsBehaviour_hasAlreadyRunThisFrame", - "True" + "HasAlreadyRunThisFrame", + "True", + "" ] } ], "events": [ { "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "runtimeScene.__boidsExtension.boidsManager.moveAll();", + "inlineCode": [ + "runtimeScene.__boidsExtension.boidsManager.moveAll();\r", + "" + ], "parameterObjects": "Object", "useStrict": true, - "eventsSheetExpanded": true + "eventsSheetExpanded": false } ] } @@ -13574,11 +16317,12 @@ "actions": [ { "type": { - "value": "SetSceneVariableAsBoolean" + "value": "SetBooleanVariable" }, "parameters": [ - "__BoidsBehaviour_hasAlreadyRunThisFrame", - "False" + "HasAlreadyRunThisFrame", + "False", + "" ] } ] @@ -13834,8 +16578,7 @@ "Behavior", "TargetedObject.CenterX()", "TargetedObject.CenterY()", - "DecisionWeight", - "GetArgumentAsNumber(\"DecisionWeight\")" + "DecisionWeight" ] } ] @@ -13891,56 +16634,15 @@ "actions": [ { "type": { - "value": "BoidsMovement::BoidsMovement::SetPropertyTrajectoryDistance" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TrajectoryDistance", "=", "(Object.Behavior::VelocityX() * (Object.CenterY() - CenterY) + Object.Behavior::VelocityY() * (CenterX - Object.CenterX())) / Object.Behavior::Speed()" ] } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "If this distance is smaller than the specified radius, the Boid must try turn in the right direction to avoid the area." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BoidsMovement::BoidsMovement::PropertyTrajectoryDistance" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "- Radius" - ] - }, - { - "type": { - "value": "BoidsMovement::BoidsMovement::PropertyTrajectoryDistance" - }, - "parameters": [ - "Object", - "Behavior", - "<", - "Radius" - ] - } ], - "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Comment", @@ -13952,82 +16654,128 @@ "textG": 0, "textR": 0 }, - "comment": "(normalX ; normalY)" + "comment": "If this distance is smaller than the specified radius, the Boid must try turn in the right direction to avoid the area." }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BoidsMovement::BoidsMovement::PropertyTrajectoryDistance" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TrajectoryDistance", ">", - "0" + "- Radius" ] - } - ], - "actions": [ + }, { "type": { - "value": "BoidsMovement::BoidsMovement::MoveInDirection" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", - "-(CenterY - Object.CenterY())", - "CenterX - Object.CenterX()", - "DecisionWeight", - "" + "TrajectoryDistance", + "<", + "Radius" ] } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "(-normalX ; -normalY)" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + ], + "actions": [], + "events": [ { - "type": { - "value": "BoidsMovement::BoidsMovement::PropertyTrajectoryDistance" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "Object", - "Behavior", - "<", - "0" + "comment": "(normalX ; normalY)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TrajectoryDistance", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::MoveInDirection" + }, + "parameters": [ + "Object", + "Behavior", + "-(CenterY - Object.CenterY())", + "CenterX - Object.CenterX()", + "DecisionWeight", + "" + ] + } ] - } - ], - "actions": [ + }, { - "type": { - "value": "BoidsMovement::BoidsMovement::MoveInDirection" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "Object", - "Behavior", - "CenterY - Object.CenterY()", - "-(CenterX - Object.CenterX())", - "DecisionWeight", - "" + "comment": "(-normalX ; -normalY)" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TrajectoryDistance", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::MoveInDirection" + }, + "parameters": [ + "Object", + "Behavior", + "CenterY - Object.CenterY()", + "-(CenterX - Object.CenterX())", + "DecisionWeight", + "" + ] + } ] } ] } + ], + "variables": [ + { + "folded": true, + "name": "TrajectoryDistance", + "type": "number", + "value": 0 + } ] } ], @@ -14210,32 +16958,80 @@ "objectGroups": [] }, { - "description": "Return the current vertical speed.", - "fullName": "Velocity Y", - "functionType": "Expression", - "name": "VelocityY", - "sentence": "", + "description": "Return the current vertical speed.", + "fullName": "Velocity Y", + "functionType": "Expression", + "name": "VelocityY", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", + "const behavior = object.getBehavior(behaviorName);", + "const directionX = eventsFunctionContext.getArgument(\"DirectionX\");", + "const directionY = eventsFunctionContext.getArgument(\"DirectionY\");", + "const decisionWeight = eventsFunctionContext.getArgument(\"DecisionWeight\");", + "", + "eventsFunctionContext.returnValue = behavior.__boidsExtension.boid.velocity.y;" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "BoidsMovement::BoidsMovement", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is rotated while moving on its path.", + "fullName": "Object Rotated", + "functionType": "Condition", + "group": "Boids movement configuration", + "name": "ShouldRotate", + "sentence": "_PARAM0_ is rotated when moving", "events": [ { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const object = objects[0];", - "const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");", - "const behavior = object.getBehavior(behaviorName);", - "const directionX = eventsFunctionContext.getArgument(\"DirectionX\");", - "const directionY = eventsFunctionContext.getArgument(\"DirectionY\");", - "const decisionWeight = eventsFunctionContext.getArgument(\"DecisionWeight\");", - "", - "eventsFunctionContext.returnValue = behavior.__boidsExtension.boid.velocity.y;" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BoidsMovement::BoidsMovement::PropertyShouldRotate" + }, + "parameters": [ + "Object", + "Behavior" + ] + } ], - "parameterObjects": "Object", - "useStrict": true, - "eventsSheetExpanded": false + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -14252,12 +17048,12 @@ "objectGroups": [] }, { - "description": "Change the maximum speed of the object.", + "description": "Return the maximum speed.", "fullName": "Maximum speed", - "functionType": "Action", + "functionType": "Expression", "group": "Boids movement configuration", - "name": "SetMaxSpeed", - "sentence": "Change the maximum speed of _PARAM0_ to _PARAM2_", + "name": "MaxSpeed", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -14265,18 +17061,18 @@ "actions": [ { "type": { - "value": "BoidsMovement::BoidsMovement::SetPropertyMaxSpeed" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", "MaxSpeed" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -14288,22 +17084,17 @@ "name": "Behavior", "supplementaryInformation": "BoidsMovement::BoidsMovement", "type": "behavior" - }, - { - "description": "Max Speed", - "name": "MaxSpeed", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change the maximum acceleration of the object.", - "fullName": "Maximum acceleration", + "description": "Change the maximum speed of the object.", + "fullName": "Maximum speed", "functionType": "Action", "group": "Boids movement configuration", - "name": "SetMaxAcceleration", - "sentence": "Change the maximum acceleration of _PARAM0_ to _PARAM2_", + "name": "SetMaxSpeed", + "sentence": "Change the maximum speed of _PARAM0_ to _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -14311,13 +17102,13 @@ "actions": [ { "type": { - "value": "BoidsMovement::BoidsMovement::SetPropertyMaxAcceleration" + "value": "BoidsMovement::BoidsMovement::SetPropertyMaxSpeed" }, "parameters": [ "Object", "Behavior", "=", - "SteeringForce" + "Value" ] } ] @@ -14336,67 +17127,19 @@ "type": "behavior" }, { - "description": "Steering Force", - "name": "SteeringForce", + "description": "Max Speed", + "name": "Value", "type": "expression" } ], "objectGroups": [] }, { - "description": "Check if the object is rotated while moving on its path.", - "fullName": "Object Rotated", - "functionType": "Condition", - "group": "Boids movement configuration", - "name": "ShouldRotate", - "sentence": "_PARAM0_ is rotated when moving", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BoidsMovement::BoidsMovement::PropertyShouldRotate" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "BoidsMovement::BoidsMovement", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Return the maximum speed.", - "fullName": "Maximum speed", + "description": "Return the maximum acceleration.", + "fullName": "Maximum acceleration", "functionType": "Expression", "group": "Boids movement configuration", - "name": "MaxSpeed", + "name": "MaxAcceleration", "sentence": "", "events": [ { @@ -14408,7 +17151,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "MaxSpeed" + "MaxAcceleration" ] } ] @@ -14433,12 +17176,12 @@ "objectGroups": [] }, { - "description": "Return the maximum acceleration.", + "description": "Change the maximum acceleration of the object.", "fullName": "Maximum acceleration", - "functionType": "Expression", + "functionType": "Action", "group": "Boids movement configuration", - "name": "MaxAcceleration", - "sentence": "", + "name": "SetMaxAcceleration", + "sentence": "Change the maximum acceleration of _PARAM0_ to _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -14446,18 +17189,18 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "BoidsMovement::BoidsMovement::SetPropertyMaxAcceleration" }, "parameters": [ - "MaxAcceleration" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -14469,6 +17212,11 @@ "name": "Behavior", "supplementaryInformation": "BoidsMovement::BoidsMovement", "type": "behavior" + }, + { + "description": "Steering Force", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -15087,14 +17835,15 @@ "name": "SeparationWeight" }, { - "value": "", + "value": "0", "type": "Number", - "label": "", + "unit": "Dimensionless", + "label": "Collision layer", "description": "", "group": "", "extraInformation": [], - "hidden": true, - "name": "TrajectoryDistance" + "advanced": true, + "name": "CollisionLayer" } ], "sharedPropertyDescriptors": [] @@ -15112,7 +17861,7 @@ "name": "PanelSpriteButton", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg", "shortDescription": "A button that can be customized.", - "version": "1.4.4", + "version": "1.4.6", "description": [ "The button can be customized with a background for each state and a label. It handles user interactions and a simple condition can be used to check if it is clicked.", "", @@ -15318,8 +18067,8 @@ }, "parameters": [ "Object", - "TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)", - "TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)" + "TouchX(TouchId, Object.Layer(), 0)", + "TouchY(TouchId, Object.Layer(), 0)" ] } ], @@ -15389,8 +18138,8 @@ }, "parameters": [ "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)" + "TouchX(StartedTouchOrMouseId(Index), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Index), Object.Layer(), 0)" ] } ], @@ -15403,7 +18152,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { @@ -15676,7 +18425,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -16215,7 +18964,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -16313,9 +19062,16 @@ ], "eventsBasedObjects": [ { + "areaMaxX": 64, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, "defaultName": "Button", "description": "A button that can be customized.", "fullName": "Button (panel sprite)", + "isUsingLegacyInstancesRenderer": true, "name": "PanelSpriteButton", "eventsFunctions": [ { @@ -16944,66 +19700,83 @@ ] } ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Idle", - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Idle", - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "PanelSpriteButton::Scale" - }, - "parameters": [ - "Object", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Idle.Variable(Width)" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Idle.Variable(Height)" - ] - }, + "actions": [], + "events": [ { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" - }, - "parameters": [ - "Object", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Width", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Height", + "=", + "Object.Height()" + ] + }, + { + "type": { + "value": "PanelSpriteButton::Scale" + }, + "parameters": [ + "Object", + "=", + "1" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Background", + "=", + "Width" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Background", + "=", + "Height" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "variables": [ + { + "name": "Width", + "type": "number", + "value": 0 + }, + { + "name": "Height", + "type": "number", + "value": 0 + } ] } ] @@ -17270,7 +20043,7 @@ "parameters": [ "Label", "=", - "GetArgumentAsString(\"LabelText\")" + "LabelText" ] }, { @@ -17706,6 +20479,7 @@ "text": "Text", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 20, "color": "0;0;0" } @@ -17793,7 +20567,39 @@ "objectName": "Pressed" } ] - } + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [] } ] }, @@ -17807,7 +20613,7 @@ "name": "PanelSpriteContinuousBar", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Interface Elements/ea06363a57846caab544f536b78a952234b68d4941d41c1577852a1d61aefec3_Interface Elements_interface_ui_loading_progress_bar.svg", "shortDescription": "A bar that represents a resource in the game (health, mana, ammo, etc).", - "version": "1.1.1", + "version": "1.1.3", "description": [ "A bar that represents a resource in the game (health, mana, ammo, etc).", "", @@ -17874,7 +20680,7 @@ "Object", "\"__ResourceBar.LastValueChange\"", "<=", - "Object.Behavior::PropertyPreviousHighValueDuration()" + "PreviousHighValueDuration" ] } ], @@ -17923,7 +20729,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyValue()" + "Value" ] } ] @@ -17966,7 +20772,7 @@ "Object", "Behavior", "=", - "clamp(GetArgumentAsNumber(\"Value\"), 0, Object.Behavior::MaxValue())" + "clamp(Value, 0, Object.Behavior::MaxValue())" ] } ] @@ -18009,7 +20815,7 @@ "Object", "Behavior", ">=", - "Object.Behavior::PropertyPreviousHighValue()" + "PreviousHighValue" ] } ], @@ -18059,7 +20865,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxValue()" + "MaxValue" ] } ] @@ -18102,7 +20908,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -18190,7 +20996,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyMaxValue()" + "MaxValue" ] } ], @@ -18237,7 +21043,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPreviousHighValue()" + "PreviousHighValue" ] } ] @@ -18280,7 +21086,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyValue()" + "Value" ] } ] @@ -18318,7 +21124,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPreviousHighValueDuration()" + "PreviousHighValueDuration" ] } ] @@ -18361,7 +21167,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -18400,7 +21206,7 @@ "Object", "Behavior", "!=", - "Object.Behavior::PropertyValue()", + "Value", "" ] }, @@ -18412,7 +21218,7 @@ "Object", "\"__ResourceBar.LastValueChange\"", "<=", - "Object.Behavior::PropertyPreviousHighValueDuration()" + "PreviousHighValueDuration" ] } ], @@ -18488,9 +21294,16 @@ ], "eventsBasedObjects": [ { + "areaMaxX": 64, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, "defaultName": "ResourceBar", "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", "fullName": "Resource bar (continuous)", + "isUsingLegacyInstancesRenderer": true, "name": "PanelSpriteContinuousBar", "eventsFunctions": [ { @@ -18969,66 +21782,83 @@ ] } ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Background", - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Background", - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::Scale" - }, - "parameters": [ - "Object", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Background.Variable(Width)" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Background.Variable(Height)" - ] - }, + "actions": [], + "events": [ { - "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLayout" - }, - "parameters": [ - "Object", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Width", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Height", + "=", + "Object.Height()" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::Scale" + }, + "parameters": [ + "Object", + "=", + "1" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Background", + "=", + "Width" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Background", + "=", + "Height" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "variables": [ + { + "name": "Width", + "type": "number", + "value": 0 + }, + { + "name": "Height", + "type": "number", + "value": 0 + } ] } ] @@ -19333,7 +22163,7 @@ "FillBar", "ResourceBar", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -19511,7 +22341,7 @@ "FillBar", "ResourceBar", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -19695,7 +22525,7 @@ "FillBar", "ResourceBar", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -20237,6 +23067,7 @@ "text": "2 / 3", "font": "", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 20, "color": "0;0;0" } @@ -20323,7 +23154,39 @@ "objectName": "Background" } ] - } + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [] } ] }, @@ -20336,16 +23199,16 @@ "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLW1vdmllLWZpbHRlciIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xOCA0TDIwIDdIMTdMMTUgNEgxM0wxNSA3SDEyTDEwIDRIOEwxMCA3SDdMNSA0SDRDMi45IDQgMiA0LjkgMiA2TDIgMThDMiAxOS4xIDIuOSAyMCA0IDIwSDIwQzIxLjEgMjAgMjIgMTkuMSAyMiAxOFY0SDE4TTExLjI1IDE1LjI1TDEwIDE4TDguNzUgMTUuMjVMNiAxNEw4Ljc1IDEyLjc1TDEwIDEwTDExLjI1IDEyLjc1TDE0IDE0TDExLjI1IDE1LjI1TTE2Ljk0IDExLjk0TDE2IDE0TDE1LjA2IDExLjk0TDEzIDExTDE1LjA2IDEwLjA2TDE2IDhMMTYuOTQgMTAuMDZMMTkgMTFMMTYuOTQgMTEuOTRaIiAvPjwvc3ZnPg==", "name": "FlashTransitionPainter", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/movie-filter.svg", - "shortDescription": "Behavior for shape painter allows you to paint a color all over the screen for period of time with an effect (useful for simulate flash and transition effect).", - "version": "0.1.1", + "shortDescription": "Paint transition effects with a plain color.", + "version": "0.1.4", "description": [ - "* __Paint effect:__ Action to paint a color all over the screen for a period of time with specific effect.", - "effect type:", - " * __Flash:__ is a monochrome color appear with fade then disappear with fade out.", - " * __Vertical:__ is a monochrome color comes from right side then comes back.", - " * __Horizontal:__ is a monochrome color come from top side then comes back.", - " * __Circular:__ is a circle which increases from the center and narrows.", - "* __Paint effect ended:__ event when the paint effect ends." + "Paint transition effects", + "- Fade in, fade out", + "- Right to left", + "- Top to bottom", + "- Circular", + "", + "A blur effect can be added to the painter layer to smooth the transition." ], "origin": { "identifier": "FlashTransitionPainter", @@ -20387,28 +23250,6 @@ "Behavior", "" ] - }, - { - "type": { - "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyType" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"Flash\"" - ] - }, - { - "type": { - "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyMaxOpacity" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "255" - ] } ] } @@ -20623,7 +23464,18 @@ ] } ], - "actions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::FillOpacity" + }, + "parameters": [ + "Object", + "=", + "MaxOpacity" + ] + } + ], "events": [ { "colorB": 228, @@ -20716,78 +23568,14 @@ "actions": [ { "type": { - "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyValue" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "lerp(CameraBorderLeft(Object.Layer()), CameraBorderRight(Object.Layer()) + 10, Progress)" - ] - }, - { - "type": { - "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyIndex" + "value": "PrimitiveDrawing::Rectangle" }, "parameters": [ "Object", - "Behavior", - "=", - "0" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Smooth edges\n" - }, - { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "5", - "conditions": [], - "actions": [ - { - "type": { - "value": "PrimitiveDrawing::FillOpacity" - }, - "parameters": [ - "Object", - "=", - "51 * Index" - ] - }, - { - "type": { - "value": "PrimitiveDrawing::Rectangle" - }, - "parameters": [ - "Object", - "CameraBorderLeft(Object.Layer())", - "CameraBorderTop(Object.Layer())", - "Value - 2 * Index", - "CameraBorderBottom(Object.Layer())" - ] - }, - { - "type": { - "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyIndex" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "1" - ] - } + "CameraBorderLeft(Object.Layer())", + "CameraBorderTop(Object.Layer())", + "lerp(CameraBorderLeft(Object.Layer()), CameraBorderRight(Object.Layer()), Progress)", + "CameraBorderBottom(Object.Layer())" ] } ] @@ -20834,78 +23622,14 @@ "actions": [ { "type": { - "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyValue" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "lerp(CameraBorderTop(Object.Layer()), CameraBorderBottom(Object.Layer()) + 10, Progress)" - ] - }, - { - "type": { - "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyIndex" + "value": "PrimitiveDrawing::Rectangle" }, "parameters": [ "Object", - "Behavior", - "=", - "0" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Smooth edges\n" - }, - { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "5", - "conditions": [], - "actions": [ - { - "type": { - "value": "PrimitiveDrawing::FillOpacity" - }, - "parameters": [ - "Object", - "=", - "51 * Index" - ] - }, - { - "type": { - "value": "PrimitiveDrawing::Rectangle" - }, - "parameters": [ - "Object", - "CameraBorderLeft(Object.Layer())", - "CameraBorderTop(Object.Layer())", - "CameraBorderRight(Object.Layer())", - "Value - 2 * Index" - ] - }, - { - "type": { - "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyIndex" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "1" - ] - } + "CameraBorderLeft(Object.Layer())", + "CameraBorderTop(Object.Layer())", + "CameraBorderRight(Object.Layer())", + "lerp(CameraBorderTop(Object.Layer()), CameraBorderBottom(Object.Layer()), Progress)" ] } ] @@ -20952,77 +23676,13 @@ "actions": [ { "type": { - "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyValue" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "(DistanceBetweenPositions(0, 0, CameraWidth(), CameraHeight()) / 2 + 1) * Progress" - ] - }, - { - "type": { - "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyIndex" + "value": "PrimitiveDrawing::Circle" }, "parameters": [ "Object", - "Behavior", - "=", - "0" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Smooth edges\n" - }, - { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "5", - "conditions": [], - "actions": [ - { - "type": { - "value": "PrimitiveDrawing::FillOpacity" - }, - "parameters": [ - "Object", - "=", - "51 * Index" - ] - }, - { - "type": { - "value": "PrimitiveDrawing::Circle" - }, - "parameters": [ - "Object", - "CameraCenterX(Object.Layer())", - "CameraCenterY(Object.Layer())", - "Value - 0.2 * Index" - ] - }, - { - "type": { - "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyIndex" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "1" - ] - } + "CameraCenterX(Object.Layer())", + "CameraCenterY(Object.Layer())", + "(DistanceBetweenPositions(0, 0, CameraWidth(Object.Layer()), CameraHeight(Object.Layer())) / 2 + 1) * Progress" ] } ] @@ -21119,7 +23779,7 @@ "Object", "Behavior", "=", - "Duration" + "NewDuration" ] }, { @@ -21130,7 +23790,7 @@ "Object", "Behavior", "=", - "Direction" + "NewDirection" ] }, { @@ -21146,6 +23806,23 @@ } ], "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyType" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Flash\"" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -21154,7 +23831,7 @@ "value": "CompareArgumentAsString" }, "parameters": [ - "\"Type\"", + "\"NewType\"", "!=", "\"\"" ] @@ -21169,7 +23846,7 @@ "Object", "Behavior", "=", - "Type" + "NewType" ] } ] @@ -21200,6 +23877,23 @@ } ] }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyMaxOpacity" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "255" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -21208,7 +23902,7 @@ "value": "CompareArgumentAsNumber" }, "parameters": [ - "\"MaxOpacity\"", + "\"NewMaxOpacity\"", "!=", "0" ] @@ -21223,7 +23917,7 @@ "Object", "Behavior", "=", - "MaxOpacity" + "NewMaxOpacity" ] } ] @@ -21251,24 +23945,24 @@ }, { "description": "Duration", - "name": "Duration", + "name": "NewDuration", "type": "expression" }, { "description": "Type of effect ", - "name": "Type", + "name": "NewType", "supplementaryInformation": "[\"Flash\",\"Horizontal\",\"Vertical\",\"Circular\"]", "type": "stringWithSelector" }, { "description": "Direction transition", - "name": "Direction", + "name": "NewDirection", "supplementaryInformation": "[\"Both\",\"Forward\",\"Backward\"]", "type": "stringWithSelector" }, { - "description": "End opacity (only for flash)", - "name": "MaxOpacity", + "description": "End opacity", + "name": "NewMaxOpacity", "type": "expression" } ], @@ -21374,26 +24068,6 @@ "extraInformation": [], "hidden": true, "name": "MaxOpacity" - }, - { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "Index" - }, - { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "Value" } ], "sharedPropertyDescriptors": [] @@ -21411,7 +24085,7 @@ "name": "PanelSpriteSlider", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/UI Essentials/1678c39a3b2bd3df4f82a8a293770db4986a6bcfd3f78e738ddfc86e39176423_UI Essentials_sliders_options.svg", "shortDescription": "A draggable slider that users can move to select a numerical value.", - "version": "1.4.2", + "version": "1.4.4", "description": [ "A draggable slider that users can move to select a numerical value. The slider can be customized with sprites.", "", @@ -21459,7 +24133,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyValue()" + "Value" ] } ] @@ -21514,7 +24188,7 @@ "Object", "Behavior", "=", - "clamp(GetArgumentAsNumber(\"Value\"), Object.Behavior::PropertyMinValue(), Object.Behavior::PropertyMaxValue())" + "clamp(Value, MinValue, MaxValue)" ] } ] @@ -21543,7 +24217,7 @@ "Object", "Behavior", "=", - "clamp(round(GetArgumentAsNumber(\"Value\") / Object.Behavior::PropertyStepSize()) * Object.Behavior::PropertyStepSize(), Object.Behavior::PropertyMinValue(), Object.Behavior::PropertyMaxValue())" + "clamp(round(Value / StepSize) * StepSize, MinValue, MaxValue)" ] } ] @@ -21581,7 +24255,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMinValue()" + "MinValue" ] } ] @@ -21624,7 +24298,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -21674,7 +24348,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxValue()" + "MaxValue" ] } ] @@ -21717,7 +24391,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -21807,7 +24481,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyStepSize()" + "StepSize" ] } ] @@ -21850,7 +24524,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -22108,8 +24782,8 @@ }, "parameters": [ "Object", - "TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)", - "TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)" + "TouchX(TouchId, Object.Layer(), 0)", + "TouchY(TouchId, Object.Layer(), 0)" ] } ], @@ -22179,8 +24853,8 @@ }, "parameters": [ "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)" + "TouchX(StartedTouchOrMouseId(Index), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Index), Object.Layer(), 0)" ] } ], @@ -22193,7 +24867,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { @@ -22466,7 +25140,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -22965,7 +25639,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -23063,9 +25737,16 @@ ], "eventsBasedObjects": [ { + "areaMaxX": 64, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, "defaultName": "Slider", "description": "Let users select a numerical value by dragging a slider.", "fullName": "Slider", + "isUsingLegacyInstancesRenderer": true, "name": "PanelSpriteSlider", "eventsFunctions": [ { @@ -23749,66 +26430,83 @@ ] } ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Background", - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Background", - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "PanelSpriteSlider::PanelSpriteSlider::Scale" - }, - "parameters": [ - "Object", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Background.Variable(Width)" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Background.Variable(Height)" - ] - }, + "actions": [], + "events": [ { - "type": { - "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateLayout" - }, - "parameters": [ - "Object", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Width", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Height", + "=", + "Object.Height()" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::Scale" + }, + "parameters": [ + "Object", + "=", + "1" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Width" + }, + "parameters": [ + "Background", + "=", + "Width" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Background", + "=", + "Height" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "variables": [ + { + "name": "Width", + "type": "number", + "value": 0 + }, + { + "name": "Height", + "type": "number", + "value": 0 + } ] } ] @@ -23995,7 +26693,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -24082,7 +26780,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -24178,7 +26876,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -24274,7 +26972,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -25112,6 +27810,7 @@ "text": "It displays the value when it changes.", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 20, "color": "0;0;0" } @@ -25207,7 +27906,39 @@ "objectName": "Background" } ] - } + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [] } ] }, @@ -25221,7 +27952,7 @@ "name": "ButtonStates", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/753a9a794bd885058159b7509f06f5a8f67f72decfccb9a1b0efee26f41c3c4c_gesture-tap-button.svg", "shortDescription": "Use any object as a button and change appearance according to user interactions.", - "version": "1.1.0", + "version": "1.2.0", "description": [ "Use the \"Button states\" behavior to track user interactions with an object, including:", "", @@ -25263,7 +27994,7 @@ { "fullName": "", "functionType": "Action", - "name": "doStepPostEvents", + "name": "doStepPreEvents", "sentence": "", "events": [ { @@ -25437,8 +28168,8 @@ }, "parameters": [ "Object", - "TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)", - "TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)" + "TouchX(TouchId, Object.Layer(), 0)", + "TouchY(TouchId, Object.Layer(), 0)" ] } ], @@ -25508,8 +28239,8 @@ }, "parameters": [ "Object", - "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)", - "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)" + "TouchX(StartedTouchOrMouseId(Index), Object.Layer(), 0)", + "TouchY(StartedTouchOrMouseId(Index), Object.Layer(), 0)" ] } ], @@ -25522,7 +28253,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { @@ -25795,7 +28526,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -26334,7 +29065,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -26452,7 +29183,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyIdleEffect()", + "IdleEffect", "yes" ] }, @@ -26463,7 +29194,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyFocusedEffect()", + "FocusedEffect", "no" ] }, @@ -26474,7 +29205,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyPressedEffect()", + "PressedEffect", "no" ] } @@ -26522,7 +29253,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyIdleEffect()", + "IdleEffect", "no" ] }, @@ -26533,7 +29264,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyFocusedEffect()", + "FocusedEffect", "no" ] }, @@ -26544,7 +29275,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyPressedEffect()", + "PressedEffect", "no" ] } @@ -26583,7 +29314,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyIdleEffect()", + "IdleEffect", "yes" ] } @@ -26622,7 +29353,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyFocusedEffect()", + "FocusedEffect", "yes" ] } @@ -26661,7 +29392,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyPressedEffect()", + "PressedEffect", "yes" ] } @@ -26703,7 +29434,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyIdleEffect()" + "IdleEffect" ] } ] @@ -26746,7 +29477,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -26784,7 +29515,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFocusedEffect()" + "FocusedEffect" ] } ] @@ -26827,7 +29558,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -26865,7 +29596,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyPressedEffect()" + "PressedEffect" ] } ] @@ -26908,7 +29639,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -26987,7 +29718,7 @@ "description": "Change the animation of buttons according to their state.", "fullName": "Button animation", "name": "ButtonAnimationName", - "objectType": "Sprite", + "objectType": "", "eventsFunctions": [ { "fullName": "", @@ -27007,7 +29738,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyIdleAnimationName()" + "IdleAnimationName" ] } ] @@ -27017,7 +29748,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27067,7 +29797,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyIdleAnimationName()" + "IdleAnimationName" ] } ] @@ -27095,7 +29825,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyFocusedAnimationName()" + "FocusedAnimationName" ] } ] @@ -27123,7 +29853,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyPressedAnimationName()" + "PressedAnimationName" ] } ] @@ -27136,7 +29866,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27165,7 +29894,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyIdleAnimationName()" + "IdleAnimationName" ] } ] @@ -27178,7 +29907,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27209,7 +29937,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -27219,7 +29947,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27248,7 +29975,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFocusedAnimationName()" + "FocusedAnimationName" ] } ] @@ -27261,7 +29988,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27292,7 +30018,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -27302,7 +30028,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27331,7 +30056,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyPressedAnimationName()" + "PressedAnimationName" ] } ] @@ -27344,7 +30069,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27375,7 +30099,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -27385,7 +30109,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27399,6 +30122,17 @@ } ], "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Animatable capability", + "description": "", + "group": "", + "extraInformation": [ + "AnimatableCapability::AnimatableBehavior" + ], + "name": "Animation" + }, { "value": "", "type": "Behavior", @@ -27464,7 +30198,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyIdleValue()" + "IdleValue" ] } ] @@ -27544,7 +30278,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyIdleValue()", + "IdleValue", "" ] } @@ -27600,7 +30334,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedValue()", + "FocusedValue", "" ] } @@ -27640,7 +30374,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedValue()", + "FocusedValue", "" ] } @@ -27692,7 +30426,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyPressedValue()", + "PressedValue", "" ] } @@ -27733,8 +30467,8 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFadeInDuration()", - "Object.Behavior::PropertyFadeInEasing()", + "FadeInDuration", + "FadeInEasing", "" ] } @@ -27763,8 +30497,8 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFadeOutDuration()", - "Object.Behavior::PropertyFadeOutEasing()", + "FadeOutDuration", + "FadeOutEasing", "" ] } @@ -27870,7 +30604,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyEffectValue()" + "EffectValue" ] }, { @@ -27881,7 +30615,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -27948,7 +30682,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyEffectValue()" + "EffectValue" ] }, { @@ -27959,7 +30693,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28003,7 +30737,7 @@ "Object", "Behavior", "<", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] } ], @@ -28027,7 +30761,7 @@ "Object", "Behavior", "=", - "Tween::Ease(GetArgumentAsString(\"Easing\"), Object.Behavior::PropertyTweenInitialValue(), Object.Behavior::PropertyTweenTargetedValue(), Object.Behavior::PropertyTweenTime() / GetArgumentAsNumber(\"Duration\"))" + "Tween::Ease(Easing, TweenInitialValue, TweenTargetedValue, TweenTime / Duration)" ] } ] @@ -28043,7 +30777,7 @@ "Object", "Behavior", ">=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] } ], @@ -28067,7 +30801,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyTweenTargetedValue()" + "TweenTargetedValue" ] } ] @@ -28083,9 +30817,9 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyEffectName()", - "Object.Behavior::PropertyEffectProperty()", - "Object.Behavior::PropertyEffectValue()" + "EffectName", + "EffectProperty", + "EffectValue" ] } ] @@ -28134,7 +30868,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyEffectName()" + "EffectName" ] } ] @@ -28175,7 +30909,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyEffectProperty()" + "EffectProperty" ] } ] @@ -28220,7 +30954,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "NewEffectName" ] }, { @@ -28231,7 +30965,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "NewPropertyName" ] } ] @@ -28251,12 +30985,12 @@ }, { "description": "Effect name", - "name": "EffectName", + "name": "NewEffectName", "type": "string" }, { "description": "Parameter name", - "name": "PropertyName", + "name": "NewPropertyName", "type": "string" } ], @@ -28279,7 +31013,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyIdleValue()" + "IdleValue" ] } ] @@ -28322,7 +31056,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28360,7 +31094,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFocusedValue()" + "FocusedValue" ] } ] @@ -28403,7 +31137,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28441,7 +31175,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPressedValue()" + "PressedValue" ] } ] @@ -28484,7 +31218,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28522,7 +31256,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeInEasing()" + "FadeInEasing" ] } ] @@ -28566,7 +31300,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -28604,7 +31338,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeOutEasing()" + "FadeOutEasing" ] } ] @@ -28648,7 +31382,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -28686,7 +31420,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeInDuration()" + "FadeInDuration" ] } ] @@ -28729,7 +31463,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28767,7 +31501,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeOutDuration()" + "FadeOutDuration" ] } ] @@ -28810,7 +31544,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29081,7 +31815,7 @@ "description": "Smoothly resize buttons according to their state.", "fullName": "Button scale tween", "name": "ButtonScaleTween", - "objectType": "Sprite", + "objectType": "", "eventsFunctions": [ { "fullName": "", @@ -29101,7 +31835,7 @@ "Object", "Scale", "=", - "Object.Behavior::PropertyIdleScale()" + "IdleScale" ] } ] @@ -29111,7 +31845,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29182,7 +31915,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyIdleScale()", + "IdleScale", "" ] } @@ -29238,7 +31971,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedScale()", + "FocusedScale", "" ] } @@ -29278,7 +32011,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedScale()", + "FocusedScale", "" ] } @@ -29330,7 +32063,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyPressedScale()", + "PressedScale", "" ] } @@ -29344,7 +32077,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29375,10 +32107,10 @@ "Object", "Tween", "\"__ButtonScaleTween.Fade\"", - "GetArgumentAsNumber(\"Value\")", - "GetArgumentAsNumber(\"Value\")", - "Object.Behavior::PropertyFadeInEasing()", - "1000 * Object.Behavior::PropertyFadeInDuration()", + "Value", + "Value", + "FadeInEasing", + "1000 * FadeInDuration", "no", "yes" ] @@ -29390,7 +32122,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29426,10 +32157,10 @@ "Object", "Tween", "\"__ButtonScaleTween.Fade\"", - "GetArgumentAsNumber(\"Value\")", - "GetArgumentAsNumber(\"Value\")", - "Object.Behavior::PropertyFadeOutEasing()", - "1000 * Object.Behavior::PropertyFadeOutDuration()", + "Value", + "Value", + "FadeOutEasing", + "1000 * FadeOutDuration", "no", "yes" ] @@ -29441,7 +32172,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29475,7 +32205,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyIdleScale()" + "IdleScale" ] } ] @@ -29488,7 +32218,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29519,7 +32248,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29529,7 +32258,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29558,7 +32286,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFocusedScale()" + "FocusedScale" ] } ] @@ -29571,7 +32299,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29602,7 +32329,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29612,7 +32339,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29641,7 +32367,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPressedScale()" + "PressedScale" ] } ] @@ -29654,7 +32380,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29685,7 +32410,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29695,7 +32420,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29724,7 +32448,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeInDuration()" + "FadeInDuration" ] } ] @@ -29737,7 +32461,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29768,7 +32491,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29778,7 +32501,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29807,7 +32529,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeOutDuration()" + "FadeOutDuration" ] } ] @@ -29820,7 +32542,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29851,7 +32572,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29861,7 +32582,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29890,7 +32610,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeInEasing()" + "FadeInEasing" ] } ] @@ -29904,7 +32624,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29935,7 +32654,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -29945,7 +32664,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29974,7 +32692,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeOutEasing()" + "FadeOutEasing" ] } ] @@ -29988,7 +32706,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -30019,7 +32736,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -30029,7 +32746,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -30043,6 +32759,17 @@ } ], "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Scalable capability", + "description": "", + "group": "", + "extraInformation": [ + "ScalableCapability::ScalableBehavior" + ], + "name": "Scale" + }, { "value": "", "type": "Behavior", @@ -30240,7 +32967,7 @@ }, "parameters": [ "Object", - "Object.Behavior::PropertyIdleColorTint()" + "IdleColorTint" ] } ] @@ -30321,7 +33048,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyIdleColorTint()", + "IdleColorTint", "" ] } @@ -30377,7 +33104,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedColorTint()", + "FocusedColorTint", "" ] } @@ -30417,7 +33144,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedColorTint()", + "FocusedColorTint", "" ] } @@ -30469,7 +33196,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyPressedColorTint()", + "PressedColorTint", "" ] } @@ -30514,9 +33241,9 @@ "Object", "Tween", "\"__ButtonColorTintTween.Fade\"", - "GetArgumentAsString(\"Value\")", - "Object.Behavior::PropertyFadeInEasing()", - "1000 * Object.Behavior::PropertyFadeInDuration()", + "Value", + "FadeInEasing", + "1000 * FadeInDuration", "no", "yes" ] @@ -30564,9 +33291,9 @@ "Object", "Tween", "\"__ButtonColorTintTween.Fade\"", - "GetArgumentAsString(\"Value\")", - "Object.Behavior::PropertyFadeOutEasing()", - "1000 * Object.Behavior::PropertyFadeOutDuration()", + "Value", + "FadeOutEasing", + "1000 * FadeOutDuration", "no", "yes" ] @@ -30612,7 +33339,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyIdleColorTint()" + "IdleColorTint" ] } ] @@ -30656,7 +33383,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -30695,7 +33422,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFocusedColorTint()" + "FocusedColorTint" ] } ] @@ -30739,7 +33466,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -30778,7 +33505,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyPressedColorTint()" + "PressedColorTint" ] } ] @@ -30822,7 +33549,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -30861,7 +33588,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeInDuration()" + "FadeInDuration" ] } ] @@ -30905,7 +33632,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -30944,7 +33671,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeOutDuration()" + "FadeOutDuration" ] } ] @@ -30988,7 +33715,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -31027,7 +33754,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeInEasing()" + "FadeInEasing" ] } ] @@ -31072,7 +33799,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -31111,7 +33838,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeOutEasing()" + "FadeOutEasing" ] } ] @@ -31156,7 +33883,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -31360,12 +34087,12 @@ "category": "Visual effect", "extensionNamespace": "", "fullName": "Shake object", - "helpPath": "https://victrisgames.itch.io/gdevelop-camera-shake-example", + "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWFycm93LWFsbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xMywxMUgxOEwxNi41LDkuNUwxNy45Miw4LjA4TDIxLjg0LDEyTDE3LjkyLDE1LjkyTDE2LjUsMTQuNUwxOCwxM0gxM1YxOEwxNC41LDE2LjVMMTUuOTIsMTcuOTJMMTIsMjEuODRMOC4wOCwxNy45Mkw5LjUsMTYuNUwxMSwxOFYxM0g2TDcuNSwxNC41TDYuMDgsMTUuOTJMMi4xNiwxMkw2LjA4LDguMDhMNy41LDkuNUw2LDExSDExVjZMOS41LDcuNUw4LjA4LDYuMDhMMTIsMi4xNkwxNS45Miw2LjA4TDE0LjUsNy41TDEzLDZWMTFaIiAvPjwvc3ZnPg==", "name": "ShakeObject", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/arrow-all.svg", "shortDescription": "Shake an object.", - "version": "1.5.6", + "version": "1.5.7", "description": [ "Shake an object (position, angle or scale).", "", @@ -31399,7 +34126,7 @@ "eventsFunctions": [], "eventsBasedBehaviors": [ { - "description": "Shake an object, using one or more ways to shake (position, angle).\nThis behavior can be used on any type of object.", + "description": "Shake objects with translation and rotation.", "fullName": "Shake object (position, angle)", "name": "ShakeObject_PositionAngle", "objectType": "", @@ -31471,7 +34198,7 @@ "Object", "__ShakeObject_Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -31482,7 +34209,7 @@ "Object", "__ShakeObject_PowerX", "=", - "GetArgumentAsNumber(\"PowerX\")" + "PowerX" ] }, { @@ -31493,7 +34220,7 @@ "Object", "__ShakeObject_PowerY", "=", - "GetArgumentAsNumber(\"PowerY\")" + "PowerY" ] }, { @@ -31504,7 +34231,7 @@ "Object", "__ShakeObject_PowerAngle", "=", - "GetArgumentAsNumber(\"PowerAngle\")" + "PowerAngle" ] }, { @@ -31515,7 +34242,7 @@ "Object", "__ShakeObject_TimeBetweenShakes", "=", - "GetArgumentAsNumber(\"TimeBetweenShakes\")" + "TimeBetweenShakes" ] } ] @@ -33385,10 +36112,10 @@ "sharedPropertyDescriptors": [] }, { - "description": "Shake an object, using one or more ways to shake (position, angle, scale)\nThis behavior can only be used on sprite objects.", + "description": "Shake objects with translation, rotation and scale.", "fullName": "Shake object (position, angle, scale)", "name": "ShakeObject_PositionAngleScale", - "objectType": "Sprite", + "objectType": "", "eventsFunctions": [ { "description": "Shake an object, using one or more ways to shake (position, angle, scale). Make sure to \"Stop shaking\" before starting a new shake if it uses different parameters.", @@ -33457,7 +36184,7 @@ "Object", "__ShakeObject_Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -33468,7 +36195,7 @@ "Object", "__ShakeObject_PowerX", "=", - "GetArgumentAsNumber(\"PowerX\")" + "PowerX" ] }, { @@ -33479,7 +36206,7 @@ "Object", "__ShakeObject_PowerY", "=", - "GetArgumentAsNumber(\"PowerY\")" + "PowerY" ] }, { @@ -33490,7 +36217,7 @@ "Object", "__ShakeObject_PowerAngle", "=", - "GetArgumentAsNumber(\"PowerAngle\")" + "PowerAngle" ] }, { @@ -33501,7 +36228,7 @@ "Object", "__ShakeObject_PowerScale", "=", - "GetArgumentAsNumber(\"PowerScale\")" + "PowerScale" ] }, { @@ -33512,7 +36239,7 @@ "Object", "__ShakeObject_TimeBetweenShakes", "=", - "GetArgumentAsNumber(\"TimeBetweenShakes\")" + "TimeBetweenShakes" ] } ] @@ -33759,7 +36486,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -34101,10 +36827,11 @@ "actions": [ { "type": { - "value": "ChangeScale" + "value": "ScalableCapability::ScalableBehavior::SetValue" }, "parameters": [ "Object", + "Scale", "-", "Object.Variable(__ShakeObject_ScaleTravelled)" ] @@ -35009,10 +37736,11 @@ "actions": [ { "type": { - "value": "ChangeScale" + "value": "ScalableCapability::ScalableBehavior::SetValue" }, "parameters": [ "Object", + "Scale", "+", "round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" ] @@ -35290,10 +38018,11 @@ "actions": [ { "type": { - "value": "ChangeScale" + "value": "ScalableCapability::ScalableBehavior::SetValue" }, "parameters": [ "Object", + "Scale", "-", "round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" ] @@ -35550,10 +38279,11 @@ "actions": [ { "type": { - "value": "ChangeScale" + "value": "ScalableCapability::ScalableBehavior::SetValue" }, "parameters": [ "Object", + "Scale", "-", "Object.Variable(__ShakeObject_ScaleTravelled)" ] @@ -35638,7 +38368,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -35690,7 +38419,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -35740,7 +38468,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -35753,7 +38480,28 @@ "objectGroups": [] } ], - "propertyDescriptors": [], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Scalable capability", + "description": "", + "group": "", + "extraInformation": [ + "ScalableCapability::ScalableBehavior" + ], + "name": "Scale" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "name": "Property" + } + ], "sharedPropertyDescriptors": [] } ], @@ -35769,7 +38517,7 @@ "name": "CameraShake", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/vector-difference-ab.svg", "shortDescription": "Shake layer cameras.", - "version": "3.0.3", + "version": "3.1.2", "description": [ "Shake layer cameras with translation, rotation and zoom.", "", @@ -35802,7 +38550,128 @@ ], "dependencies": [], "globalVariables": [], - "sceneVariables": [], + "sceneVariables": [ + { + "folded": true, + "name": "DefaultFrequency", + "type": "number", + "value": 12 + }, + { + "folded": true, + "name": "DefaultAmplitudeX", + "type": "number", + "value": 4 + }, + { + "folded": true, + "name": "DefaultAmplitudeY", + "type": "number", + "value": 4 + }, + { + "folded": true, + "name": "DefaultAmplitudeAngle", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "DefaultAmplitudeZoom", + "type": "number", + "value": 1 + }, + { + "folded": true, + "name": "Duration", + "type": "number", + "value": 0 + }, + { + "name": "Layers", + "type": "structure", + "children": [] + }, + { + "name": "Layer", + "type": "structure", + "children": [ + { + "name": "AmplitudeAngle", + "type": "number", + "value": 0 + }, + { + "name": "AmplitudeX", + "type": "number", + "value": 0 + }, + { + "name": "AmplitudeY", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "AmplitudeZoom", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaAngle", + "type": "number", + "value": 0 + }, + { + "name": "CameraDeltaX", + "type": "number", + "value": 0 + }, + { + "name": "CameraDeltaY", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaZoom", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "Frequency", + "type": "number", + "value": 0 + } + ] + }, + { + "folded": true, + "name": "LayerName", + "type": "string", + "value": "" + }, + { + "folded": true, + "name": "Time", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "StartEaseDuration", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "StopEaseDuration", + "type": "number", + "value": 0 + } + ], "eventsFunctions": [ { "fullName": "", @@ -35824,47 +38693,6 @@ "\"\"", "" ] - }, - { - "type": { - "value": "CameraShake::SetDefaultShakingFrequency" - }, - "parameters": [ - "", - "12", - "" - ] - }, - { - "type": { - "value": "CameraShake::SetDefaultTranslationAmplitude" - }, - "parameters": [ - "", - "4", - "4", - "" - ] - }, - { - "type": { - "value": "CameraShake::SetDefaultRotationAmplitude" - }, - "parameters": [ - "", - "0", - "" - ] - }, - { - "type": { - "value": "CameraShake::SetDefaultZoomAmplitude" - }, - "parameters": [ - "", - "1", - "" - ] } ] } @@ -35896,10 +38724,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Time", + "Time", "+", "TimeDelta()" ] @@ -35910,298 +38738,56 @@ "type": "BuiltinCommonInstructions::Standard", "conditions": [ { - "type": { - "value": "CameraShake::IsShaking" - }, - "parameters": [ - "", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.EaseFactor", - "=", - "1" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__CameraShake.Time", - "<", - "Variable(__CameraShake.StartEaseDuration)" - ] - }, - { - "type": { - "inverted": true, - "value": "VarScene" - }, - "parameters": [ - "__CameraShake.Time", - ">", - "Variable(__CameraShake.Duration) - Variable(__CameraShake.StopEaseDuration)" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.EaseFactor", - "=", - "clamp(0, 1, Variable(__CameraShake.Time) / Variable(__CameraShake.StartEaseDuration))" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__CameraShake.Time", - ">", - "Variable(__CameraShake.Duration) - Variable(__CameraShake.StopEaseDuration)" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.EaseFactor", - "=", - "clamp(0, 1, (Variable(__CameraShake.Duration) - Variable(__CameraShake.Time)) / Variable(__CameraShake.StopEaseDuration))" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::ForEachChildVariable", - "iterableVariableName": "__CameraShake.Layers", - "valueIteratorVariableName": "__CameraShake.Layer", - "keyIteratorVariableName": "__CameraShake.LayerName", - "conditions": [ - { - "type": { - "value": "SceneVariableAsBoolean" - }, - "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].Shakable", - "True" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarSceneTxt" - }, - "parameters": [ - "__CameraShake.ActualLayerName", - "=", - "VariableString(__CameraShake.LayerName)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarSceneTxt" - }, - "parameters": [ - "__CameraShake.LayerName", - "=", - "\"__BaseLayer\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarSceneTxt" - }, - "parameters": [ - "__CameraShake.ActualLayerName", - "=", - "\"\"" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Use user defined default values when there is no layer specific value set." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "CameraShake::SetFrequency" - }, - "parameters": [ - "", - "Variable(__CameraShake.DefaultFrequency)", - "\"\"", - "" - ] - }, - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeX", - "=", - "Variable(__CameraShake.DefaultAmplitudeX)" - ] - }, - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeY", - "=", - "Variable(__CameraShake.DefaultAmplitudeY)" - ] - }, - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeAngle", - "=", - "Variable(__CameraShake.DefaultAmplitudeAngle)" - ] - }, - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeZoom", - "=", - "Variable(__CameraShake.DefaultAmplitudeZoom)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VariableChildExists" - }, - "parameters": [ - "__CameraShake.Layer", - "\"Frequency\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "CameraShake::SetFrequency" - }, - "parameters": [ - "", - "Variable(__CameraShake.Layer.Frequency)", - "\"\"", - "" - ] - } - ] - }, + "type": { + "value": "CameraShake::IsShaking" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "VariableChildExists" + "value": "NumberVariable" }, "parameters": [ - "__CameraShake.Layer", - "\"AmplitudeX\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeX", - "=", - "Variable(__CameraShake.Layer.AmplitudeX)" + "Time", + "<", + "StartEaseDuration" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "VariableChildExists" + "inverted": true, + "value": "NumberVariable" }, "parameters": [ - "__CameraShake.Layer", - "\"AmplitudeY\"" + "Time", + ">", + "Duration - StopEaseDuration" ] } ], "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.AmplitudeY", + "EaseFactor", "=", - "Variable(__CameraShake.Layer.AmplitudeY)" + "clamp(Time / StartEaseDuration, 0, 1)" ] } ] @@ -36211,219 +38797,538 @@ "conditions": [ { "type": { - "value": "VariableChildExists" + "value": "NumberVariable" }, "parameters": [ - "__CameraShake.Layer", - "\"AmplitudeAngle\"" + "Time", + ">", + "Duration - StopEaseDuration" ] } ], "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.AmplitudeAngle", + "EaseFactor", "=", - "Variable(__CameraShake.Layer.AmplitudeAngle)" + "clamp((Duration - Time) / StopEaseDuration, 0, 1)" ] } ] }, { - "type": "BuiltinCommonInstructions::Standard", + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "Layers", + "valueIteratorVariableName": "Layer", + "keyIteratorVariableName": "LayerName", "conditions": [ { "type": { - "value": "VariableChildExists" + "value": "BooleanVariable" }, "parameters": [ - "__CameraShake.Layer", - "\"AmplitudeZoom\"" + "Layer.Shakable", + "True", + "" ] } ], - "actions": [ + "actions": [], + "events": [ { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeZoom", - "=", - "Variable(__CameraShake.Layer.AmplitudeZoom)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ActualLayerName", + "=", + "LayerName" + ] + } ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Shake the layer camera.\nSave the camera displacement to revert it in onScenePostEvents." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeX", - "!=", - "0" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ActualLayerName", + "=", + "\"\"" + ] + } ] - } - ], - "actions": [ + }, { - "type": { - "value": "ModVarScene" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaX", - "=", - "CameraShake::Noise2d(\"\", TimeFromStart(), 1000) * Variable(__CameraShake.AmplitudeX) * Variable(__CameraShake.EaseFactor)" - ] + "comment": "Use user defined default values when there is no layer specific value set." }, { - "type": { - "value": "SetCameraCenterX" - }, - "parameters": [ - "", - "+", - "Variable(__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaX)", - "VariableString(__CameraShake.ActualLayerName)", - "0" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "CameraShake::SetFrequency" + }, + "parameters": [ + "", + "DefaultFrequency", + "\"\"", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeX", + "=", + "DefaultAmplitudeX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeY", + "=", + "DefaultAmplitudeY" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeAngle", + "=", + "DefaultAmplitudeAngle" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeZoom", + "=", + "DefaultAmplitudeZoom" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaX", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaY", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaAngle", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaZoom", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"Frequency\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "CameraShake::SetFrequency" + }, + "parameters": [ + "", + "Layer.Frequency", + "\"\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"AmplitudeX\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeX", + "=", + "Layer.AmplitudeX" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"AmplitudeY\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeY", + "=", + "Layer.AmplitudeY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"AmplitudeAngle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeAngle", + "=", + "Layer.AmplitudeAngle" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"AmplitudeZoom\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeZoom", + "=", + "Layer.AmplitudeZoom" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Shake the layer camera.\nSave the camera displacement to revert it in onScenePostEvents." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaX", + "=", + "CameraShake::Noise2d(\"\", TimeFromStart(), 1000) * AmplitudeX * EaseFactor" + ] + }, + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "+", + "Layers[LayerName].CameraDeltaX", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeY", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaY", + "=", + "CameraShake::Noise2d(\"\", TimeFromStart(), 2000) * AmplitudeY * EaseFactor" + ] + }, + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "+", + "Layers[LayerName].CameraDeltaY", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeAngle", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaAngle", + "=", + "CameraShake::Noise2d(\"\", TimeFromStart(), 3000) * AmplitudeAngle * EaseFactor" + ] + }, + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "+", + "Layers[LayerName].CameraDeltaAngle", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeZoom", + "!=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaZoom", + "=", + "pow(AmplitudeZoom, CameraShake::Noise2d(\"\", TimeFromStart(), 4000) * EaseFactor)" + ] + }, + { + "type": { + "value": "ZoomCamera" + }, + "parameters": [ + "", + "CameraZoom(ActualLayerName, 0) * Layers[LayerName].CameraDeltaZoom", + "ActualLayerName", + "0" + ] + } + ] + } ] } ] + } + ], + "variables": [ + { + "folded": true, + "name": "AmplitudeX", + "type": "number", + "value": 0 }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeY", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaY", - "=", - "CameraShake::Noise2d(\"\", TimeFromStart(), 2000) * Variable(__CameraShake.AmplitudeY) * Variable(__CameraShake.EaseFactor)" - ] - }, - { - "type": { - "value": "SetCameraCenterY" - }, - "parameters": [ - "", - "+", - "Variable(__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaY)", - "VariableString(__CameraShake.ActualLayerName)", - "0" - ] - } - ] + "folded": true, + "name": "AmplitudeY", + "type": "number", + "value": 0 }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeAngle", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaAngle", - "=", - "CameraShake::Noise2d(\"\", TimeFromStart(), 3000) * Variable(__CameraShake.AmplitudeAngle) * Variable(__CameraShake.EaseFactor)" - ] - }, - { - "type": { - "value": "SetCameraAngle" - }, - "parameters": [ - "", - "+", - "Variable(__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaAngle)", - "VariableString(__CameraShake.ActualLayerName)", - "0" - ] - } - ] + "folded": true, + "name": "AmplitudeAngle", + "type": "number", + "value": 0 }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeZoom", - "!=", - "1" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaZoom", - "=", - "pow(Variable(__CameraShake.AmplitudeZoom), CameraShake::Noise2d(\"\", TimeFromStart(), 4000) * Variable(__CameraShake.EaseFactor))" - ] - }, - { - "type": { - "value": "ZoomCamera" - }, - "parameters": [ - "", - "CameraZoom(VariableString(__CameraShake.ActualLayerName), 0) * Variable(__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaZoom)", - "VariableString(__CameraShake.ActualLayerName)", - "0" - ] - } - ] + "folded": true, + "name": "AmplitudeZoom", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "EaseFactor", + "type": "number", + "value": 1 + }, + { + "folded": true, + "name": "ActualLayerName", + "type": "string", + "value": "" } ] } @@ -36467,181 +39372,256 @@ "actions": [], "events": [ { - "type": "BuiltinCommonInstructions::ForEachChildVariable", - "iterableVariableName": "__CameraShake.Layers", - "valueIteratorVariableName": "__CameraShake.Layer", - "keyIteratorVariableName": "__CameraShake.LayerName", - "conditions": [ - { - "type": { - "value": "SceneVariableAsBoolean" - }, - "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].Shakable", - "True" - ] - } - ], + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], "actions": [], "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "Layers", + "valueIteratorVariableName": "Layer", + "keyIteratorVariableName": "LayerName", + "conditions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "BooleanVariable" }, "parameters": [ - "__CameraShake.ActualLayerName", - "=", - "VariableString(__CameraShake.LayerName)" + "Layer.Shakable", + "True", + "" ] } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + ], + "actions": [ { "type": { - "value": "VarSceneTxt" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.LayerName", + "CameraDeltaX", "=", - "\"__BaseLayer\"" + "Layer.CameraDeltaX" ] - } - ], - "actions": [ + }, { "type": { - "value": "ModVarSceneTxt" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.ActualLayerName", + "CameraDeltaY", "=", - "\"\"" + "Layer.CameraDeltaY" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "VarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.AmplitudeX", - "!=", - "0" + "CameraDeltaAngle", + "=", + "Layer.CameraDeltaAngle" ] - } - ], - "actions": [ + }, { "type": { - "value": "SetCameraCenterX" + "value": "SetNumberVariable" }, "parameters": [ - "", - "-", - "Variable(__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaX)", - "VariableString(__CameraShake.ActualLayerName)", - "0" + "CameraDeltaZoom", + "=", + "Layer.CameraDeltaZoom" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "VarScene" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.AmplitudeY", - "!=", - "0" + "ActualLayerName", + "=", + "LayerName" ] } ], - "actions": [ + "events": [ { - "type": { - "value": "SetCameraCenterY" - }, - "parameters": [ - "", - "-", - "Variable(__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaY)", - "VariableString(__CameraShake.ActualLayerName)", - "0" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ActualLayerName", + "=", + "\"\"" + ] + } ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeAngle", - "!=", - "0" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraDeltaX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "-", + "CameraDeltaX", + "ActualLayerName", + "0" + ] + } ] - } - ], - "actions": [ + }, { - "type": { - "value": "SetCameraAngle" - }, - "parameters": [ - "", - "-", - "Variable(__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaAngle)", - "VariableString(__CameraShake.ActualLayerName)", - "0" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraDeltaY", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "-", + "CameraDeltaY", + "ActualLayerName", + "0" + ] + } ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeZoom", - "!=", - "1" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraDeltaAngle", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "-", + "CameraDeltaAngle", + "ActualLayerName", + "0" + ] + } ] - } - ], - "actions": [ + }, { - "type": { - "value": "ZoomCamera" - }, - "parameters": [ - "", - "CameraZoom(VariableString(__CameraShake.ActualLayerName), 0) / Variable(__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaZoom)", - "VariableString(__CameraShake.ActualLayerName)", - "0" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraDeltaZoom", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ZoomCamera" + }, + "parameters": [ + "", + "CameraZoom(ActualLayerName) / CameraDeltaZoom", + "ActualLayerName", + "0" + ] + } ] } ] } + ], + "variables": [ + { + "folded": true, + "name": "ActualLayerName", + "type": "string", + "value": "" + }, + { + "folded": true, + "name": "CameraDeltaX", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaY", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaAngle", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaZoom", + "type": "number", + "value": 0 + } ] } ] @@ -36663,42 +39643,42 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Time", + "Time", "=", "0" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Duration", + "Duration", "=", - "Duration" + "NewDuration" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.StartEaseDuration", + "StartEaseDuration", "=", - "StartEaseDuration" + "NewStartEaseDuration" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.StopEaseDuration", + "StopEaseDuration", "=", - "StopEaseDuration" + "NewStopEaseDuration" ] } ] @@ -36708,34 +39688,34 @@ "conditions": [ { "type": { - "value": "VarScene" + "value": "NumberVariable" }, "parameters": [ - "__CameraShake.Duration", + "Duration", "<", - "Variable(__CameraShake.StartEaseDuration) + Variable(__CameraShake.StopEaseDuration)" + "StartEaseDuration + StopEaseDuration" ] } ], "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.StartEaseDuration", + "StartEaseDuration", "=", - "StartEaseDuration * Variable(__CameraShake.Duration) / (StartEaseDuration + StopEaseDuration)" + "StartEaseDuration * Duration / (StartEaseDuration + StopEaseDuration)" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.StopEaseDuration", + "StopEaseDuration", "=", - "StopEaseDuration * Variable(__CameraShake.Duration) / (StartEaseDuration + StopEaseDuration)" + "StopEaseDuration * Duration / (StartEaseDuration + StopEaseDuration)" ] } ] @@ -36744,17 +39724,17 @@ "parameters": [ { "description": "Duration (in seconds)", - "name": "Duration", + "name": "NewDuration", "type": "expression" }, { "description": "Ease duration to start (in seconds)", - "name": "StartEaseDuration", + "name": "NewStartEaseDuration", "type": "expression" }, { "description": "Ease duration to stop (in seconds)", - "name": "StopEaseDuration", + "name": "NewStopEaseDuration", "type": "expression" } ], @@ -36783,10 +39763,10 @@ "actions": [ { "type": { - "value": "VariableClearChildren" + "value": "ClearVariableChildren" }, "parameters": [ - "__CameraShake.Layers" + "Layers" ] }, { @@ -36796,7 +39776,7 @@ "parameters": [ "", "", - "GetArgumentAsString(\"Layer\")", + "Layer", "" ] } @@ -36808,92 +39788,92 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Time", + "Time", "=", "0" ] }, { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.Layer", + "Layer", "=", - "GetArgumentAsString(\"Layer\")" + "Layer" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Duration", + "Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.StartEaseDuration", + "StartEaseDuration", "=", "0" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.StopEaseDuration", + "StopEaseDuration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeX", + "DefaultAmplitudeX", "=", - "abs(GetArgumentAsNumber(\"AmplitudeX\"))" + "abs(AmplitudeX)" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeY", + "DefaultAmplitudeY", "=", - "abs(GetArgumentAsNumber(\"AmplitudeY\"))" + "abs(AmplitudeY)" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeAngle", + "DefaultAmplitudeAngle", "=", - "GetArgumentAsNumber(\"AmplitudeAngle\")" + "AmplitudeAngle" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeZoom", + "DefaultAmplitudeZoom", "=", - "1 + GetArgumentAsNumber(\"AmplitudeZoom\") / 100" + "1 + AmplitudeZoom / 100" ] } ], @@ -36906,7 +39886,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "GetArgumentAsNumber(\"ShakePeriod\")", + "ShakePeriod", "!=", "0" ] @@ -36915,12 +39895,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultFrequency", + "DefaultFrequency", "=", - "1 / GetArgumentAsNumber(\"ShakePeriod\")" + "1 / ShakePeriod" ] } ] @@ -36933,7 +39913,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "GetArgumentAsNumber(\"ShakePeriod\")", + "ShakePeriod", "=", "0" ] @@ -36942,10 +39922,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultFrequency", + "DefaultFrequency", "=", "1 / 0.08" ] @@ -36981,10 +39961,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Duration", + "Duration", "=", "1234567890" ] @@ -37008,10 +39988,10 @@ "conditions": [ { "type": { - "value": "VarScene" + "value": "NumberVariable" }, "parameters": [ - "__CameraShake.Duration", + "Duration", "=", "0" ] @@ -37020,10 +40000,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Duration", + "Duration", "=", "0.5" ] @@ -37097,30 +40077,30 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Time", + "Time", "=", "0" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Duration", + "Duration", "=", "1234567890" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.StartEaseDuration", + "StartEaseDuration", "=", "EaseDuration" ] @@ -37150,30 +40130,30 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Time", + "Time", "=", "0" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Duration", + "Duration", "=", "EaseDuration" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.StopEaseDuration", + "StopEaseDuration", "=", "EaseDuration" ] @@ -37204,12 +40184,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", - "Layer" + "NewLayerName" ] } ] @@ -37222,7 +40202,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "Layer", + "NewLayerName", "=", "\"\"" ] @@ -37231,10 +40211,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", "\"__BaseLayer\"" ] @@ -37257,11 +40237,12 @@ "actions": [ { "type": { - "value": "SetSceneVariableAsBoolean" + "value": "SetBooleanVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].Shakable", - "=" + "Layers[LayerName].Shakable", + "False", + "" ] } ] @@ -37281,11 +40262,12 @@ "actions": [ { "type": { - "value": "SetSceneVariableAsBoolean" + "value": "SetBooleanVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].Shakable", - "True" + "Layers[LayerName].Shakable", + "True", + "" ] } ] @@ -37301,7 +40283,7 @@ }, { "description": "Layer", - "name": "Layer", + "name": "NewLayerName", "type": "layer" } ], @@ -37319,12 +40301,12 @@ "conditions": [ { "type": { - "value": "VarScene" + "value": "NumberVariable" }, "parameters": [ - "__CameraShake.Time", + "Time", "<", - "Variable(__CameraShake.Duration)" + "Duration" ] } ], @@ -37357,12 +40339,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", - "Layer" + "NewLayerName" ] } ] @@ -37375,7 +40357,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "Layer", + "NewLayerName", "=", "\"\"" ] @@ -37384,10 +40366,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", "\"__BaseLayer\"" ] @@ -37400,20 +40382,20 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].AmplitudeX", + "Layers[LayerName].AmplitudeX", "=", "AmplitudeX" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].AmplitudeY", + "Layers[LayerName].AmplitudeY", "=", "AmplitudeY" ] @@ -37434,7 +40416,7 @@ }, { "description": "Layer", - "name": "Layer", + "name": "NewLayerName", "type": "layer" } ], @@ -37454,12 +40436,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", - "Layer" + "NewLayerName" ] } ] @@ -37472,7 +40454,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "Layer", + "NewLayerName", "=", "\"\"" ] @@ -37481,10 +40463,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", "\"__BaseLayer\"" ] @@ -37497,10 +40479,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].AmplitudeAngle", + "Layers[LayerName].AmplitudeAngle", "=", "AmplitudeAngle" ] @@ -37515,8 +40497,8 @@ "type": "expression" }, { - "description": "Layer", - "name": "Layer", + "description": "NewLayerName", + "name": "NewLayerName", "type": "layer" } ], @@ -37536,12 +40518,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", - "GetArgumentAsString(\"Layer\")" + "NewLayerName" ] } ] @@ -37554,7 +40536,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "Layer", + "NewLayerName", "=", "\"\"" ] @@ -37563,10 +40545,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", "\"__BaseLayer\"" ] @@ -37579,12 +40561,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].AmplitudeZoom", + "Layers[LayerName].AmplitudeZoom", "=", - "GetArgumentAsNumber(\"AmplitudeZoom\")" + "AmplitudeZoom" ] } ] @@ -37597,8 +40579,8 @@ "type": "expression" }, { - "description": "Layer", - "name": "Layer", + "description": "NewLayerName", + "name": "NewLayerName", "type": "layer" } ], @@ -37618,12 +40600,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", - "GetArgumentAsString(\"Layer\")" + "NewLayerName" ] } ] @@ -37636,7 +40618,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "Layer", + "NewLayerName", "=", "\"\"" ] @@ -37645,10 +40627,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", "\"__BaseLayer\"" ] @@ -37661,12 +40643,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].Frequency", + "Layers[LayerName].Frequency", "=", - "GetArgumentAsNumber(\"Frequency\")" + "Frequency" ] } ] @@ -37679,8 +40661,8 @@ "type": "expression" }, { - "description": "Layer", - "name": "Layer", + "description": "NewLayerName", + "name": "NewLayerName", "type": "layer" } ], @@ -37700,20 +40682,20 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeX", + "DefaultAmplitudeX", "=", "AmplitudeX" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeY", + "DefaultAmplitudeY", "=", "AmplitudeY" ] @@ -37749,10 +40731,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeAngle", + "DefaultAmplitudeAngle", "=", "AmplitudeAngle" ] @@ -37783,10 +40765,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeZoom", + "DefaultAmplitudeZoom", "=", "AmplitudeZoom" ] @@ -37817,10 +40799,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultFrequency", + "DefaultFrequency", "=", "Frequency" ] @@ -39109,7 +42091,7 @@ "name": "Health", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/heart-half-full.svg", "shortDescription": "Manage health (life) points, shield and armor.", - "version": "0.3.1", + "version": "0.3.2", "description": [ "Manage health (life) points, shield and armor. ", "", @@ -39182,7 +42164,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyHealth()", + "Health", "" ] } @@ -39273,7 +42255,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", ">", - "Object.Behavior::PropertyHealthRegenDelay()" + "HealthRegenDelay" ] } ], @@ -39286,7 +42268,7 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyHealthRegenRate() * TimeDelta()" + "HealthRegenRate * TimeDelta()" ] } ], @@ -39327,7 +42309,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyMaxHealth()" + "MaxHealth" ] } ] @@ -39440,7 +42422,7 @@ "Object", "Behavior", "<", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] }, { @@ -39451,7 +42433,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", ">", - "Object.Behavior::PropertyShieldRegenDelay()" + "ShieldRegenDelay" ] } ], @@ -39497,7 +42479,7 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyShieldRegenRate() * TimeDelta()" + "ShieldRegenRate * TimeDelta()" ] } ] @@ -39525,7 +42507,7 @@ "Object", "Behavior", ">", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ], @@ -39538,7 +42520,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ] @@ -39695,7 +42677,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"DamageValue\")" + "DamageValue" ] } ], @@ -39731,7 +42713,7 @@ "parameters": [ "RandomFloatInRange(0,1)", "<", - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ], @@ -39817,7 +42799,7 @@ "Object", "Behavior", "=", - "max(0,Object.Behavior::PropertyDamageToBeApplied() - Object.Behavior::PropertyFlatDamageReduction())" + "max(0,DamageToBeApplied - FlatDamageReduction)" ] } ] @@ -39869,7 +42851,7 @@ "Object", "Behavior", "*", - "1 - min(1, Object.Behavior::PropertyPercentDamageReduction())" + "1 - min(1, PercentDamageReduction)" ] } ] @@ -39982,7 +42964,7 @@ "Object", "Behavior", "<=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -39995,7 +42977,7 @@ "Object", "Behavior", "-", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { @@ -40006,7 +42988,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { @@ -40045,7 +43027,7 @@ "Object", "Behavior", ">", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -40058,7 +43040,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -40136,7 +43118,7 @@ "Object", "Behavior", "-", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] }, { @@ -40218,7 +43200,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyCurrentHealth() - Object.Behavior::PropertyDamageToBeApplied()", + "CurrentHealth - DamageToBeApplied", "" ] } @@ -40286,7 +43268,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCurrentHealth()" + "CurrentHealth" ] } ] @@ -40330,7 +43312,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -40371,7 +43353,7 @@ "Object", "Behavior", "=", - "min(Object.Behavior::PropertyCurrentHealth(), Object.Behavior::PropertyMaxHealth())" + "min(CurrentHealth, MaxHealth)" ] } ] @@ -40417,7 +43399,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -40497,7 +43479,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"HealValue\")" + "HealValue" ] } ] @@ -40548,7 +43530,7 @@ "Object", "Behavior", "=", - "min(GetArgumentAsNumber(\"HealValue\"),Object.Behavior::PropertyMaxHealth() - Object.Behavior::PropertyCurrentHealth())" + "min(HealValue,MaxHealth - CurrentHealth)" ] } ] @@ -40577,7 +43559,7 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyHealToBeApplied()" + "HealToBeApplied" ] } ] @@ -40651,7 +43633,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxHealth()" + "MaxHealth" ] } ] @@ -40694,7 +43676,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -40782,7 +43764,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -40826,7 +43808,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenRate()" + "HealthRegenRate" ] } ] @@ -40869,7 +43851,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -40916,7 +43898,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -40960,7 +43942,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDamageCooldown()" + "DamageCooldown" ] } ] @@ -41003,7 +43985,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -41050,7 +44032,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -41094,7 +44076,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenDelay()" + "HealthRegenDelay" ] } ] @@ -41137,7 +44119,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -41184,7 +44166,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -41228,7 +44210,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ] @@ -41271,7 +44253,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -41318,7 +44300,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -41362,7 +44344,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFlatDamageReduction()" + "FlatDamageReduction" ] } ] @@ -41405,7 +44387,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -41452,7 +44434,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -41496,7 +44478,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPercentDamageReduction()" + "PercentDamageReduction" ] } ] @@ -41539,7 +44521,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -41586,7 +44568,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -42157,7 +45139,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", "<", - "Object.Behavior::PropertyDamageCooldown()" + "DamageCooldown" ] } ], @@ -42230,7 +45212,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::PropertyDamageCooldown() - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" + "max(0,DamageCooldown - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" ] } ] @@ -42376,7 +45358,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] } ] @@ -42417,7 +45399,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ] @@ -42460,7 +45442,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -42507,7 +45489,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -42555,7 +45537,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -42599,7 +45581,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ] @@ -42642,7 +45624,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -42689,7 +45671,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -42733,7 +45715,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenRate()" + "ShieldRegenRate" ] } ] @@ -42776,7 +45758,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -42823,7 +45805,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -42867,7 +45849,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenDelay()" + "ShieldRegenDelay" ] } ] @@ -42910,7 +45892,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -42957,7 +45939,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -43001,7 +45983,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDuration()" + "ShieldDuration" ] } ] @@ -43044,7 +46026,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -43091,7 +46073,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -43177,7 +46159,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"ShieldPoints\")" + "ShieldPoints" ] } ] @@ -43206,7 +46188,7 @@ "Object", "Behavior", "=", - "min(GetArgumentAsNumber(\"ShieldPoints\"),Object.Behavior::MaxShield())" + "min(ShieldPoints,Object.Behavior::MaxShield())" ] } ] @@ -43569,7 +46551,7 @@ "Object", "\"__Health.ShieldDuration\"", "<", - "Object.Behavior::PropertyShieldDuration()" + "ShieldDuration" ] } ], @@ -43645,7 +46627,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::PropertyShieldDuration() - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" + "max(0,ShieldDuration - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" ] } ] @@ -43686,7 +46668,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDamageTaken()" + "ShieldDamageTaken" ] } ] @@ -43727,7 +46709,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealToBeApplied()" + "HealToBeApplied" ] } ] @@ -44010,7 +46992,7 @@ "name": "FireBullet", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/bullet.svg", "shortDescription": "Fire bullets, manage ammo, reloading and overheating.", - "version": "0.7.0", + "version": "0.8.1", "description": [ "This extension allows objects to fire bullets.", "", @@ -44085,7 +47067,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyStartingAmmo()" + "StartingAmmo" ] }, { @@ -44096,7 +47078,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -44157,56 +47139,48 @@ ] } ], - "actions": [], - "events": [ + "actions": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Reset firing cooldown", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ResetObjectTimer" - }, - "parameters": [ - "Object", - "\"__FireBullet.FiringCooldown\"" - ] - } - ] - } - ], - "parameters": [] + "type": { + "value": "FireBullet::FireBullet::SetPropertyHasJustFired" + }, + "parameters": [ + "Object", + "Behavior", + "=" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"__FireBullet.FiringCooldown\"" + ] }, + { + "type": { + "value": "FireBullet::FireBullet::SetPropertyTotalShotsFired" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "1" + ] + } + ], + "events": [ { "colorB": 228, "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Update ammo", + "name": "Ammo", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Subtract 1 from ammo (if not unlimited ammo)" - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -44230,23 +47204,11 @@ "Object", "Behavior", "=", - "max(0,Object.Behavior::AmmoQuantity() - 1)" + "max(0, AmmoQuantity - 1)" ] } ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Update reloading counter", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -44275,19 +47237,7 @@ ] } ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Automatically reload gun when needed", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -44343,22 +47293,10 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Update Overheat", + "name": "Overheat", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Increase heat (if needed)" - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -44383,23 +47321,11 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyHeatIncreasePerShot()" + "HeatIncreasePerShot" ] } ], "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Check if this caused overheat" - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -44441,63 +47367,6 @@ } ], "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Update statistics", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "FireBullet::FireBullet::SetPropertyTotalShotsFired" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "1" - ] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Reset firing detection", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "FireBullet::FireBullet::SetPropertyHasJustFired" - }, - "parameters": [ - "Object", - "Behavior", - "=" - ] - } - ] - } - ], - "parameters": [] } ] } @@ -44509,7 +47378,7 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Reload gun when needed", + "name": "Reload", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ @@ -44546,7 +47415,7 @@ "Object", "\"__FireBullet.ReloadingTimer\"", ">=", - "Object.Behavior::PropertyReloadDuration()" + "ReloadDuration" ] } ], @@ -44597,7 +47466,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -44638,7 +47507,7 @@ "Object", "Behavior", "=", - "min(Object.Behavior::PropertyShotsPerReload(), Object.Behavior::PropertyAmmoQuantity())" + "min(ShotsPerReload, AmmoQuantity)" ] } ] @@ -44653,7 +47522,7 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Reduce heat level (based on cooling rate)", + "name": "Cooling", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ @@ -44665,7 +47534,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "Object.Behavior::HeatLevel()", + "HeatLevel", ">", "0" ] @@ -44697,7 +47566,7 @@ "Object", "Behavior", "=", - "max(0, Object.Behavior::PropertyHeatLevel() - TimeDelta() * Object.Behavior::PropertyExponentialCoolingRate() * Object.Behavior::PropertyHeatLevel())" + "max(0, HeatLevel - TimeDelta() * ExponentialCoolingRate * HeatLevel)" ] } ] @@ -44726,7 +47595,7 @@ "Object", "Behavior", "=", - "max(0, Object.Behavior::PropertyHeatLevel() - TimeDelta() * Object.Behavior::PropertyLinearCoolingRate())" + "max(0, HeatLevel - TimeDelta() * LinearCoolingRate)" ] } ] @@ -44760,37 +47629,25 @@ "sentence": "Fire _PARAM4_ from _PARAM0_, at position _PARAM2_; _PARAM3_, toward _PARAM5_ with speed _PARAM6_ px/s", "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Calculate the trajectory angle and use the \"Fire bullets\" action", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "FireBullet::FireBullet::Fire" - }, - "parameters": [ - "Object", - "Behavior", - "GetArgumentAsNumber(\"XPosition\")", - "GetArgumentAsNumber(\"YPosition\")", - "Bullet", - "Object.AngleToObject(TargetObject)", - "GetArgumentAsNumber(\"Speed\")", - "" - ] - } + "type": { + "value": "FireBullet::FireBullet::Fire" + }, + "parameters": [ + "Object", + "Behavior", + "XPosition", + "YPosition", + "Bullet", + "Object.AngleToObject(TargetObject)", + "Speed", + "" ] } - ], - "parameters": [] + ] } ], "parameters": [ @@ -44841,37 +47698,25 @@ "sentence": "Fire _PARAM4_ from _PARAM0_, at position _PARAM2_; _PARAM3_, toward position _PARAM5_;_PARAM6_ with speed _PARAM7_ px/s", "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Calculate the trajectory angle and use the \"Fire bullets\" action", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "FireBullet::FireBullet::Fire" - }, - "parameters": [ - "Object", - "Behavior", - "GetArgumentAsNumber(\"XPosition\")", - "GetArgumentAsNumber(\"YPosition\")", - "Bullet", - "Object.AngleToPosition(GetArgumentAsNumber(\"TargetXPosition\"), GetArgumentAsNumber(\"TargetYPosition\"))", - "GetArgumentAsNumber(\"Speed\")", - "" - ] - } + "type": { + "value": "FireBullet::FireBullet::Fire" + }, + "parameters": [ + "Object", + "Behavior", + "XPosition", + "YPosition", + "Bullet", + "Object.AngleToPosition(TargetXPosition, TargetYPosition)", + "Speed", + "" ] } - ], - "parameters": [] + ] } ], "parameters": [ @@ -44927,242 +47772,188 @@ "sentence": "Fire _PARAM4_ from _PARAM0_, at position _PARAM2_; _PARAM3_, toward angle _PARAM5_ and speed _PARAM6_ px/s", "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Check if ready to shoot", - "source": "", - "type": "BuiltinCommonInstructions::Group", + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "FireBullet::FireBullet::IsReadyToShoot" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "FireBullet::FireBullet::SetPropertyHasJustFired" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ], "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "FireBullet::FireBullet::IsReadyToShoot" + "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "Object", - "Behavior", - "" + "BulletQuantity", + "=", + "1" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyHasJustFired" + "value": "FireBullet::FireBullet::FireSingleBullet" }, "parameters": [ "Object", "Behavior", - "yes" + "XPosition", + "YPosition", + "Bullet", + "Angle", + "Speed", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "BulletQuantity", + ">", + "1" ] } ], + "actions": [], "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Single bullet", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Behavior::PropertyBulletQuantity()", - "=", - "1" - ] - } - ], - "actions": [ - { - "type": { - "value": "FireBullet::FireBullet::FireSingleBullet" - }, - "parameters": [ - "Object", - "Behavior", - "GetArgumentAsNumber(\"XPosition\")", - "GetArgumentAsNumber(\"YPosition\")", - "Bullet", - "GetArgumentAsNumber(\"Angle\")", - "GetArgumentAsNumber(\"Speed\")", - "" - ] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Multiple bullets", - "source": "", - "type": "BuiltinCommonInstructions::Group", + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Behavior::PropertyBulletQuantity()", - ">", - "1" - ] - } - ], - "actions": [ + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "BulletQuantity", + "conditions": [], + "actions": [], + "events": [ { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__FireBullet.BatchOrderID", - "=", - "0" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "FireBullet::FireBullet::FiringArc" + }, + "parameters": [ + "Object", + "Behavior", + "!=", + "360", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MultiShotAngle", + "=", + "Angle + lerp(-FiringArc / 2, FiringArc / 2, BulletIndex / (BulletQuantity - 1)) " + ] + } ] }, { - "type": { - "value": "ModVarObjet" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "Object", - "__FireBullet.CurrentBulletAngle", - "=", - "GetArgumentAsNumber(\"Angle\") - Object.Behavior::PropertyFiringArc()/2" - ] - } - ], - "events": [ + "comment": "When firing in a full circle, prevent first and last bullet from using the same angle" + }, { - "type": "BuiltinCommonInstructions::Repeat", - "repeatExpression": "Object.Behavior::PropertyBulletQuantity()", - "conditions": [], - "actions": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "FireBullet::FireBullet::FireSingleBullet" + "value": "FireBullet::FireBullet::FiringArc" }, "parameters": [ "Object", "Behavior", - "GetArgumentAsNumber(\"XPosition\")", - "GetArgumentAsNumber(\"YPosition\")", - "Bullet", - "Object.Variable(__FireBullet.CurrentBulletAngle) + RandomInRange(-Object.Behavior::PropertyAngleVariance(),Object.Behavior::PropertyAngleVariance())", - "GetArgumentAsNumber(\"Speed\")", + "=", + "360", "" ] } ], - "events": [ + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "SetNumberVariable" }, - "comment": "When firing in a full circle, prevent first and last bullet from using the same angle" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "FireBullet::FireBullet::FiringArc" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "360", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__FireBullet.CurrentBulletAngle", - "+", - "Object.Behavior::PropertyFiringArc() / (Object.Behavior::PropertyBulletQuantity())" - ] - } + "parameters": [ + "MultiShotAngle", + "=", + "Angle + lerp(-FiringArc / 2, FiringArc / 2, BulletIndex / BulletQuantity) " ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "FireBullet::FireBullet::FiringArc" - }, - "parameters": [ - "Object", - "Behavior", - "!=", - "360", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__FireBullet.CurrentBulletAngle", - "+", - "Object.Behavior::PropertyFiringArc() / (Object.Behavior::PropertyBulletQuantity() - 1)" - ] - } + "type": { + "value": "FireBullet::FireBullet::FireSingleBullet" + }, + "parameters": [ + "Object", + "Behavior", + "XPosition", + "YPosition", + "Bullet", + "MultiShotAngle", + "Speed", + "" ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__FireBullet.BatchOrderID", - "+", - "1" - ] - } + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BulletIndex", + "+", + "1" ] } ] @@ -45170,12 +47961,23 @@ ] } ], - "parameters": [] + "variables": [ + { + "folded": true, + "name": "MultiShotAngle", + "type": "number", + "value": 0 + }, + { + "name": "BulletIndex", + "type": "number", + "value": 0 + } + ] } ] } - ], - "parameters": [] + ] } ], "parameters": [ @@ -45259,9 +48061,9 @@ "parameters": [ "", "Bullet", - "GetArgumentAsNumber(\"XPosition\")", - "GetArgumentAsNumber(\"YPosition\")", - "Object.Behavior::PropertyBulletLayer()" + "XPosition", + "YPosition", + "BulletLayer" ] } ], @@ -45290,7 +48092,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Angle\") + RandomInRange(-Object.Behavior::PropertyAngleVariance(), Object.Behavior::PropertyAngleVariance())" + "Angle + RandomInRange(-AngleVariance, AngleVariance)" ] }, { @@ -45299,64 +48101,13 @@ }, "parameters": [ "Bullet", - "Object.Behavior::PropertyRandomizedAngle()", - "GetArgumentAsNumber(\"Speed\") + RandomInRange(-Object.Behavior::PropertyBulletSpeedVariance(), Object.Behavior::PropertyBulletSpeedVariance())", + "RandomizedAngle", + "Speed + RandomInRange(-BulletSpeedVariance, BulletSpeedVariance)", "1" ] } ] }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Add identifier variables (to enable advanced picking by users)" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Bullet", - "__FireBullet.BulletID", - "=", - "Object.Behavior::PropertyTotalBulletsCreated()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Bullet", - "__FireBullet.BatchID", - "=", - "Object.Behavior::PropertyTotalShotsFired()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Bullet", - "__FireBullet.BatchOrderID", - "=", - "0" - ] - } - ] - }, { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -45390,7 +48141,7 @@ "parameters": [ "Bullet", "=", - "Object.Behavior::PropertyRandomizedAngle()" + "RandomizedAngle" ] } ] @@ -45538,20 +48289,6 @@ "name": "HasJustFired", "sentence": "_PARAM0_ has just fired", "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "False" - ] - } - ] - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -45657,7 +48394,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFiringArc()" + "FiringArc" ] } ] @@ -45700,7 +48437,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -45747,7 +48484,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -45791,7 +48528,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAngleVariance()" + "AngleVariance" ] } ] @@ -45834,7 +48571,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -45881,7 +48618,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -45925,7 +48662,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBulletSpeedVariance()" + "BulletSpeedVariance" ] } ] @@ -45968,7 +48705,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -46015,7 +48752,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -46059,7 +48796,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBulletQuantity()" + "BulletQuantity" ] } ] @@ -46102,7 +48839,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -46149,7 +48886,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -46196,7 +48933,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -46239,7 +48976,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"RotateBullet\"" + "\"Value\"" ] } ], @@ -46264,7 +49001,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"RotateBullet\"" + "\"Value\"" ] } ], @@ -46297,7 +49034,7 @@ { "defaultValue": "yes", "description": "Rotate bullet to match trajetory", - "name": "RotateBullet", + "name": "Value", "optional": true, "type": "yesorno" } @@ -46321,7 +49058,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"UnlimitedAmmo\"" + "\"Value\"" ] } ], @@ -46346,7 +49083,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"UnlimitedAmmo\"" + "\"Value\"" ] } ], @@ -46379,7 +49116,7 @@ { "defaultValue": "yes", "description": "Unlimited ammo", - "name": "UnlimitedAmmo", + "name": "Value", "optional": true, "type": "yesorno" } @@ -46403,7 +49140,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFireCooldown()" + "FireCooldown" ] } ] @@ -46446,7 +49183,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -46493,7 +49230,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"NewCooldown\")", + "Value", "" ] } @@ -46514,7 +49251,7 @@ }, { "description": "Cooldown in seconds", - "name": "NewCooldown", + "name": "Value", "type": "expression" } ], @@ -46537,7 +49274,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyReloadDuration()" + "ReloadDuration" ] } ] @@ -46580,7 +49317,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -46627,7 +49364,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -46671,7 +49408,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyOverheatDuration()" + "OverheatDuration" ] } ] @@ -46714,7 +49451,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -46761,7 +49498,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -46805,7 +49542,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAmmoQuantity()" + "AmmoQuantity" ] } ] @@ -46848,7 +49585,7 @@ "Object", "Behavior", "=", - "max(0,Value)" + "max(0, Value)" ] } ] @@ -46895,7 +49632,7 @@ "Object", "Behavior", "=", - "max(0,Value)", + "max(0, Value)", "" ] } @@ -46939,7 +49676,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHeatIncreasePerShot()" + "HeatIncreasePerShot" ] } ] @@ -46982,7 +49719,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -47029,7 +49766,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -47073,7 +49810,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxAmmo()" + "MaxAmmo" ] } ] @@ -47116,7 +49853,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -47145,7 +49882,7 @@ "Object", "Behavior", "=", - "min(Object.Behavior::MaxAmmo(),Object.Behavior::AmmoQuantity())" + "min(MaxAmmo, AmmoQuantity)" ] } ] @@ -47192,7 +49929,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -47359,7 +50096,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -47402,7 +50139,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -47418,7 +50155,7 @@ "Object", "Behavior", ">", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ], @@ -47431,7 +50168,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -47478,7 +50215,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -47544,17 +50281,498 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAutomaticReloading" + "value": "FireBullet::FireBullet::SetPropertyAutomaticReloading" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FireBullet::FireBullet", + "type": "behavior" + }, + { + "defaultValue": "yes", + "description": "Enable automatic reloading", + "name": "Value", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "the linear cooling rate (per second).", + "fullName": "Linear cooling rate", + "functionType": "ExpressionAndCondition", + "group": "Overheat", + "name": "LinearCoolingRate", + "sentence": "the linear cooling rate", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "LinearCoolingRate" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FireBullet::FireBullet", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "LinearCoolingRate", + "name": "SetLinearCoolingRateOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FireBullet::FireBullet::SetPropertyLinearCoolingRate" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FireBullet::FireBullet", + "type": "behavior" + }, + { + "description": "Heat cooling rate (per second)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the linear rate of cooling.", + "fullName": "Set linear cooling rate (deprecated)", + "functionType": "Action", + "group": "Overheat", + "name": "SetLinearCoolingRate", + "private": true, + "sentence": "Set the linear cooling rate of _PARAM0_ to _PARAM2_ per second", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FireBullet::FireBullet::SetLinearCoolingRateOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FireBullet::FireBullet", + "type": "behavior" + }, + { + "description": "Heat cooling rate (per second)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the exponential cooling rate, per second.", + "fullName": "Exponential cooling rate", + "functionType": "ExpressionAndCondition", + "group": "Overheat", + "name": "ExponentialCoolingRate", + "sentence": "the exponential cooling rate", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ExponentialCoolingRate" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FireBullet::FireBullet", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ExponentialCoolingRate", + "name": "SetExponentialCoolingRateOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FireBullet::FireBullet::SetPropertyExponentialCoolingRate" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FireBullet::FireBullet", + "type": "behavior" + }, + { + "description": "Exponential cooling rate", + "name": "Value", + "supplementaryInformation": "[\"Exponential\",\"Linear\"]", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the exponential rate of cooling.", + "fullName": "Set exponential cooling rate (deprecated)", + "functionType": "Action", + "group": "Overheat", + "name": "SetExponentialCoolingRate", + "private": true, + "sentence": "Set the exponential cooling rate of _PARAM0_ to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FireBullet::FireBullet::SetExponentialCoolingRateOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FireBullet::FireBullet", + "type": "behavior" + }, + { + "description": "Exponential cooling rate", + "name": "Value", + "supplementaryInformation": "[\"Exponential\",\"Linear\"]", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Increase ammo quantity.", + "fullName": "Increase ammo", + "functionType": "Action", + "name": "IncreaseAmmo", + "sentence": "Increase ammo of _PARAM0_ by _PARAM2_ shots", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "AmmoGained" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If Max Ammo is set, do not exceed the value" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "FireBullet::FireBullet::PropertyMaxAmmo" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(MaxAmmo, AmmoQuantity)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "FireBullet::FireBullet::IsReloadNeeded" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "FireBullet::FireBullet::PropertyAutomaticReloading" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "FireBullet::FireBullet::ReloadAmmo" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FireBullet::FireBullet", + "type": "behavior" + }, + { + "description": "Ammo gained", + "name": "AmmoGained", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Layer that bullets are created on.", + "fullName": "Bullet layer", + "functionType": "StringExpression", + "group": "Multi-Fire", + "name": "BulletLayer", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "BulletLayer" + ] + } + ] + } + ], + "expressionType": { + "type": "layer" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FireBullet::FireBullet", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the heat level (range: 0 to 1).", + "fullName": "Heat level", + "functionType": "ExpressionAndCondition", + "group": "Overheat", + "name": "HeatLevel", + "sentence": "the heat level", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "yes" + "min(1, HeatLevel)" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -47566,24 +50784,17 @@ "name": "Behavior", "supplementaryInformation": "FireBullet::FireBullet", "type": "behavior" - }, - { - "defaultValue": "yes", - "description": "Enable automatic reloading", - "name": "Value", - "optional": true, - "type": "yesorno" } ], "objectGroups": [] }, { - "description": "the linear cooling rate (per second).", - "fullName": "Linear cooling rate", - "functionType": "ExpressionAndCondition", - "group": "Overheat", - "name": "LinearCoolingRate", - "sentence": "the linear cooling rate", + "description": "Total shots fired (multi-bullet shots are considered one shot).", + "fullName": "Shots fired", + "functionType": "Expression", + "group": "Stats", + "name": "TotalShotsFired", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -47594,7 +50805,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyLinearCoolingRate()" + "TotalShotsFired" ] } ] @@ -47619,10 +50830,11 @@ "objectGroups": [] }, { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "LinearCoolingRate", - "name": "SetLinearCoolingRateOp", + "description": "Total bullets created.", + "fullName": "Bullets created", + "functionType": "Expression", + "group": "Stats", + "name": "TotalBulletsCreated", "sentence": "", "events": [ { @@ -47631,18 +50843,18 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyLinearCoolingRate" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "TotalBulletsCreated" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -47654,23 +50866,17 @@ "name": "Behavior", "supplementaryInformation": "FireBullet::FireBullet", "type": "behavior" - }, - { - "description": "Heat cooling rate (per second)", - "name": "Value", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change the linear rate of cooling.", - "fullName": "Set linear cooling rate (deprecated)", - "functionType": "Action", - "group": "Overheat", - "name": "SetLinearCoolingRate", - "private": true, - "sentence": "Set the linear cooling rate of _PARAM0_ to _PARAM2_ per second", + "description": "Reloads completed.", + "fullName": "Reloads completed", + "functionType": "Expression", + "group": "Stats", + "name": "TotalReloadsCompleted", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -47678,19 +50884,18 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetLinearCoolingRateOp" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")", - "" + "TotalReloadsCompleted" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -47702,22 +50907,17 @@ "name": "Behavior", "supplementaryInformation": "FireBullet::FireBullet", "type": "behavior" - }, - { - "description": "Heat cooling rate (per second)", - "name": "Value", - "type": "expression" } ], "objectGroups": [] }, { - "description": "the exponential cooling rate, per second.", - "fullName": "Exponential cooling rate", + "description": "the remaining shots before the next reload is required.", + "fullName": "Shots before next reload", "functionType": "ExpressionAndCondition", - "group": "Overheat", - "name": "ExponentialCoolingRate", - "sentence": "the exponential cooling rate", + "group": "Reload", + "name": "ShotsBeforeNextReload", + "sentence": "the remaining shots (before the next reload)", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -47728,7 +50928,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyExponentialCoolingRate()" + "ShotsBeforeNextReload" ] } ] @@ -47753,11 +50953,12 @@ "objectGroups": [] }, { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "ExponentialCoolingRate", - "name": "SetExponentialCoolingRateOp", - "sentence": "", + "description": "the remaining duration before the cooldown will permit a bullet to be fired, in seconds.", + "fullName": "Duration before cooldown end", + "functionType": "ExpressionAndCondition", + "group": "Firing", + "name": "CooldownTimeLeft", + "sentence": "the remaining duration before the cooldown end", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -47765,18 +50966,18 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyExponentialCoolingRate" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "max(0, FireCooldown - Object.ObjectTimerElapsedTime(\"__FireBullet.FiringCooldown\"))" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -47788,44 +50989,48 @@ "name": "Behavior", "supplementaryInformation": "FireBullet::FireBullet", "type": "behavior" - }, - { - "description": "Exponential cooling rate", - "name": "Value", - "supplementaryInformation": "[\"Exponential\",\"Linear\"]", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change the exponential rate of cooling.", - "fullName": "Set exponential cooling rate (deprecated)", - "functionType": "Action", + "description": "the remaining duration before the overheat penalty ends, in seconds.", + "fullName": "Duration before overheat end", + "functionType": "ExpressionAndCondition", "group": "Overheat", - "name": "SetExponentialCoolingRate", - "private": true, - "sentence": "Set the exponential cooling rate of _PARAM0_ to _PARAM2_", + "name": "OverheatTimeLeft", + "sentence": "the remaining duration before the overheat end", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "FireBullet::FireBullet::SetExponentialCoolingRateOp" + "value": "CompareObjectTimer" }, "parameters": [ "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")", - "" + "\"__FireBullet.OverheatDuration\"", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "max(0, OverheatDuration - Object.ObjectTimerElapsedTime(\"__FireBullet.OverheatDuration\"))" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -47837,62 +51042,28 @@ "name": "Behavior", "supplementaryInformation": "FireBullet::FireBullet", "type": "behavior" - }, - { - "description": "Exponential cooling rate", - "name": "Value", - "supplementaryInformation": "[\"Exponential\",\"Linear\"]", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Increase ammo quantity.", - "fullName": "Increase ammo", - "functionType": "Action", - "name": "IncreaseAmmo", - "sentence": "Increase ammo of _PARAM0_ by _PARAM2_ shots", + "description": "the remaining duration before the reload finishes, in seconds.", + "fullName": "Duration before the reload finishes", + "functionType": "ExpressionAndCondition", + "group": "Reload", + "name": "ReloadTimeLeft", + "sentence": "the remaining duration before the reload finishes", "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "GetArgumentAsNumber(\"AmmoGained\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "If Max Ammo is set, do not exceed the value" - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyMaxAmmo" + "value": "CompareObjectTimer" }, "parameters": [ "Object", - "Behavior", + "\"__FireBullet.ReloadingTimer\"", ">", "0" ] @@ -47901,33 +51072,61 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "min(Object.Behavior::MaxAmmo(),Object.Behavior::AmmoQuantity())" + "max(0, ReloadDuration - Object.ObjectTimerElapsedTime(\"__FireBullet.ReloadingTimer\"))" ] } ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FireBullet::FireBullet", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if object is currently performing an ammo reload.", + "fullName": "Is ammo reloading in progress", + "functionType": "Condition", + "group": "Reload", + "name": "IsReloadInProgress", + "sentence": "_PARAM0_ is reloading ammo", + "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "FireBullet::FireBullet::IsReloadNeeded" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "Behavior", - "" + "False" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyAutomaticReloading" + "value": "FireBullet::FireBullet::PropertyReloadInProgress" }, "parameters": [ "Object", @@ -47938,12 +51137,10 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::ReloadAmmo" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "Behavior", - "" + "True" ] } ] @@ -47960,22 +51157,17 @@ "name": "Behavior", "supplementaryInformation": "FireBullet::FireBullet", "type": "behavior" - }, - { - "description": "Ammo gained", - "name": "AmmoGained", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Layer that bullets are created on.", - "fullName": "Bullet layer", - "functionType": "StringExpression", - "group": "Multi-Fire", - "name": "BulletLayer", - "sentence": "", + "description": "Check if object is ready to shoot.", + "fullName": "Is ready to shoot", + "functionType": "Condition", + "group": "Firing", + "name": "IsReadyToShoot", + "sentence": "_PARAM0_ is ready to shoot", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -47983,59 +51175,119 @@ "actions": [ { "type": { - "value": "SetReturnString" + "value": "SetReturnBoolean" }, "parameters": [ - "Object.Behavior::PropertyBulletLayer()" + "False" ] } ] - } - ], - "expressionType": { - "type": "layer" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "FireBullet::FireBullet", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the heat level (range: 0 to 1).", - "fullName": "Heat level", - "functionType": "ExpressionAndCondition", - "group": "Overheat", - "name": "HeatLevel", - "sentence": "the heat level", - "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "FireBullet::FireBullet::PropertyHasJustFired" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::And" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BehaviorActivated" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "inverted": true, + "value": "FireBullet::FireBullet::IsOutOfAmmo" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "FireBullet::FireBullet::IsReloadNeeded" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "FireBullet::FireBullet::IsReloadInProgress" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "FireBullet::FireBullet::IsFiringCooldownActive" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "FireBullet::FireBullet::IsOverheated" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ] + } + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" }, "parameters": [ - "min(1,Object.Behavior::PropertyHeatLevel())" + "True" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -48052,12 +51304,12 @@ "objectGroups": [] }, { - "description": "Total shots fired (multi-bullet shots are considered one shot).", - "fullName": "Shots fired", - "functionType": "Expression", - "group": "Stats", - "name": "TotalShotsFired", - "sentence": "", + "description": "Check if automatic reloading is enabled.", + "fullName": "Is automatic reloading enabled", + "functionType": "Condition", + "group": "Reload", + "name": "IsAutomaticReloadingEnabled", + "sentence": "Automatic reloading is enabled on_PARAM0_", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -48065,18 +51317,39 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "FireBullet::FireBullet::PropertyAutomaticReloading" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" }, "parameters": [ - "Object.Behavior::PropertyTotalShotsFired()" + "True" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -48093,12 +51366,12 @@ "objectGroups": [] }, { - "description": "Total bullets created.", - "fullName": "Bullets created", - "functionType": "Expression", - "group": "Stats", - "name": "TotalBulletsCreated", - "sentence": "", + "description": "Check if ammo is unlimited.", + "fullName": "Is ammo unlimited", + "functionType": "Condition", + "group": "Ammo", + "name": "IsUnlimitedAmmo", + "sentence": "_PARAM0_ has unlimited ammo", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -48106,18 +51379,39 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "FireBullet::FireBullet::PropertyUnlimitedAmmo" }, "parameters": [ - "Object.Behavior::PropertyTotalBulletsCreated()" + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -48134,12 +51428,12 @@ "objectGroups": [] }, { - "description": "Reloads completed.", - "fullName": "Reloads completed", - "functionType": "Expression", - "group": "Stats", - "name": "TotalReloadsCompleted", - "sentence": "", + "description": "Check if object has no ammo available.", + "fullName": "Is out of ammo", + "functionType": "Condition", + "group": "Ammo", + "name": "IsOutOfAmmo", + "sentence": "_PARAM0_ is out of ammo", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -48147,18 +51441,52 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "FireBullet::FireBullet::IsUnlimitedAmmo" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "FireBullet::FireBullet::PropertyAmmoQuantity" + }, + "parameters": [ + "Object", + "Behavior", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" }, "parameters": [ - "Object.Behavior::PropertyTotalReloadsCompleted()" + "True" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -48175,12 +51503,12 @@ "objectGroups": [] }, { - "description": "the remaining shots before the next reload is required.", - "fullName": "Shots before next reload", - "functionType": "ExpressionAndCondition", + "description": "Check if object needs to reload ammo.", + "fullName": "Is a reload needed", + "functionType": "Condition", "group": "Reload", - "name": "ShotsBeforeNextReload", - "sentence": "the remaining shots (before the next reload)", + "name": "IsReloadNeeded", + "sentence": "_PARAM0_ needs to reload ammo", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -48188,59 +51516,64 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" }, "parameters": [ - "Object.Behavior::PropertyShotsBeforeNextReload()" + "False" ] } ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "FireBullet::FireBullet", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the remaining duration before the cooldown will permit a bullet to be fired, in seconds.", - "fullName": "Duration before cooldown end", - "functionType": "ExpressionAndCondition", - "group": "Firing", - "name": "CooldownTimeLeft", - "sentence": "the remaining duration before the cooldown end", - "events": [ + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Shots per reload must not be \"0\"" + }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "FireBullet::FireBullet::PropertyShotsPerReload" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "FireBullet::FireBullet::PropertyShotsBeforeNextReload" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" }, "parameters": [ - "max(0,Object.Behavior::Cooldown() - Object.ObjectTimerElapsedTime(\"__FireBullet.FiringCooldown\"))" + "True" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -48257,43 +51590,72 @@ "objectGroups": [] }, { - "description": "the remaining duration before the overheat penalty ends, in seconds.", - "fullName": "Duration before overheat end", - "functionType": "ExpressionAndCondition", + "description": "Check if object is overheated.", + "fullName": "Is overheated", + "functionType": "Condition", "group": "Overheat", - "name": "OverheatTimeLeft", - "sentence": "the remaining duration before the overheat end", + "name": "IsOverheated", + "sentence": "_PARAM0_ is overheated", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "CompareObjectTimer" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "\"__FireBullet.OverheatDuration\"", - ">", - "0" + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "FireBullet::FireBullet::PropertyHeatLevel" + }, + "parameters": [ + "Object", + "Behavior", + ">=", + "1" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Object.Behavior::OverheatTimeLeft()", + ">", + "0" + ] + } ] } ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" }, "parameters": [ - "max(0, Object.Behavior::PropertyOverheatDuration() - Object.ObjectTimerElapsedTime(\"__FireBullet.OverheatDuration\"))" + "True" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -48310,23 +51672,36 @@ "objectGroups": [] }, { - "description": "the remaining duration before the reload finishes, in seconds.", - "fullName": "Duration before the reload finishes", - "functionType": "ExpressionAndCondition", - "group": "Reload", - "name": "ReloadTimeLeft", - "sentence": "the remaining duration before the reload finishes", + "description": "Check if firing cooldown is active.", + "fullName": "Is firing cooldown active", + "functionType": "Condition", + "group": "Firing", + "name": "IsFiringCooldownActive", + "sentence": "Firing cooldown is active on _PARAM0_", "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "CompareObjectTimer" + "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "Object", - "\"__FireBullet.ReloadingTimer\"", + "Object.Behavior::CooldownTimeLeft()", ">", "0" ] @@ -48335,18 +51710,15 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" }, "parameters": [ - "max(0, Object.Behavior::PropertyReloadDuration() - Object.ObjectTimerElapsedTime(\"__FireBullet.ReloadingTimer\"))" + "True" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -48354,298 +51726,626 @@ "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "FireBullet::FireBullet", - "type": "behavior" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "FireBullet::FireBullet", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Firing cooldown", + "description": "Objects cannot shoot while firing cooldown is active.", + "group": "", + "extraInformation": [], + "name": "FireCooldown" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HasJustFired" + }, + { + "value": "true", + "type": "Boolean", + "label": "Rotate bullets to match their trajectory", + "description": "", + "group": "", + "extraInformation": [], + "name": "RotateBullet" + }, + { + "value": "45", + "type": "Number", + "unit": "DegreeAngle", + "label": "Firing arc", + "description": "Multi-Fire bullets will be evenly spaced inside the firing arc", + "group": "Multi-Fire", + "extraInformation": [], + "name": "FiringArc" + }, + { + "value": "1", + "type": "Number", + "label": "Number of bullets created at once", + "description": "Multi-Fire bullets will be evenly spaced inside the firing arc", + "group": "Multi-Fire", + "extraInformation": [], + "name": "BulletQuantity" + }, + { + "value": "0", + "type": "Number", + "unit": "DegreeAngle", + "label": "Angle variance", + "description": "Make imperfect aim (between 0 and 180 degrees).", + "group": "Firing variance", + "extraInformation": [], + "advanced": true, + "name": "AngleVariance" + }, + { + "value": "0", + "type": "Number", + "unit": "PixelSpeed", + "label": "Bullet speed variance", + "description": "Bullet speed will be adjusted by a random value within this range.", + "group": "Firing variance", + "extraInformation": [], + "advanced": true, + "name": "BulletSpeedVariance" + }, + { + "value": "0", + "type": "Number", + "label": "Ammo quantity (current)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "AmmoQuantity" + }, + { + "value": "0", + "type": "Number", + "label": "Shots per reload ", + "description": "Use 0 to disable reloading.", + "group": "Reload", + "extraInformation": [], + "advanced": true, + "name": "ShotsPerReload" + }, + { + "value": "1", + "type": "Number", + "unit": "Second", + "label": "Reloading duration", + "description": "Objects cannot shoot while reloading is in progress.", + "group": "Reload", + "extraInformation": [], + "advanced": true, + "name": "ReloadDuration" + }, + { + "value": "0", + "type": "Number", + "label": "Max ammo ", + "description": "", + "group": "Ammo", + "extraInformation": [], + "advanced": true, + "name": "MaxAmmo" + }, + { + "value": "0", + "type": "Number", + "label": "Shots before next reload", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShotsBeforeNextReload" + }, + { + "value": "0", + "type": "Number", + "label": "Total shots fired", + "description": "Regardless of how many bullets are created, only 1 shot will be counted per frame", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TotalShotsFired" + }, + { + "value": "0", + "type": "Number", + "label": "Total bullets created", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TotalBulletsCreated" + }, + { + "value": "0", + "type": "Number", + "label": "Starting ammo", + "description": "", + "group": "Ammo", + "extraInformation": [], + "advanced": true, + "name": "StartingAmmo" + }, + { + "value": "0", + "type": "Number", + "label": "Total reloads completed", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TotalReloadsCompleted" + }, + { + "value": "true", + "type": "Boolean", + "label": "Unlimited ammo", + "description": "", + "group": "Ammo", + "extraInformation": [], + "advanced": true, + "name": "UnlimitedAmmo" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ReloadInProgress" + }, + { + "value": "0", + "type": "Number", + "label": "Heat increase per shot (between 0 and 1)", + "description": " Object is overheated when Heat reaches 1.", + "group": "Overheat", + "extraInformation": [], + "advanced": true, + "name": "HeatIncreasePerShot" + }, + { + "value": "0", + "type": "Number", + "label": "Heat level (Range: 0 to 1)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "HeatLevel" + }, + { + "value": "true", + "type": "Boolean", + "label": "Reload automatically", + "description": "", + "group": "Reload", + "extraInformation": [], + "advanced": true, + "name": "AutomaticReloading" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Overheat duration", + "description": "Object cannot shoot while overheat duration is active.", + "group": "Overheat", + "extraInformation": [], + "advanced": true, + "name": "OverheatDuration" + }, + { + "value": "0.1", + "type": "Number", + "label": "Linear cooling rate (per second)", + "description": "", + "group": "Overheat", + "extraInformation": [], + "advanced": true, + "name": "LinearCoolingRate" + }, + { + "value": "0.3", + "type": "Number", + "label": "Exponential cooling rate (per second)", + "description": "Happens faster when heat is high and slower when heat is low.", + "group": "Overheat", + "extraInformation": [ + "Linear", + "Exponential" + ], + "advanced": true, + "name": "ExponentialCoolingRate" + }, + { + "value": "", + "type": "String", + "label": "Layer the bullets are created on", + "description": "Base layer by default.", + "group": "Shooting configuration", + "extraInformation": [], + "hidden": true, + "name": "BulletLayer" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "RandomizedAngle" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "Input", + "extensionNamespace": "", + "fullName": "Screen Orientation Checker", + "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.0.2", + "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": [ + { + "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()" + ] } - ], - "objectGroups": [] - }, + ] + } + ], + "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", + "eventsFunctions": [ { - "description": "Check if object is currently performing an ammo reload.", - "fullName": "Is ammo reloading in progress", - "functionType": "Condition", - "group": "Reload", - "name": "IsReloadInProgress", - "sentence": "_PARAM0_ is reloading ammo", + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "False" - ] - } - ] + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Check if the screen must be shown" }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyReloadInProgress" + "value": "SystemInfo::IsMobile" }, - "parameters": [ - "Object", - "Behavior" - ] + "parameters": [] } ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "FireBullet::FireBullet", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if object is ready to shoot.", - "fullName": "Is ready to shoot", - "functionType": "Condition", - "group": "Firing", - "name": "IsReadyToShoot", - "sentence": "_PARAM0_ is ready to shoot", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "False" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "actions": [], + "events": [ { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyHasJustFired" + "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "Object", - "Behavior" + "SceneWindowWidth()", + ">", + "SceneWindowHeight()" ] - }, + } + ], + "actions": [], + "events": [ { - "type": { - "value": "BuiltinCommonInstructions::And" - }, - "parameters": [], - "subInstructions": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "BehaviorActivated" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior" + "TargetOrientation", + "=", + "\"portrait\"" ] - }, + } + ], + "actions": [ { "type": { - "inverted": true, - "value": "FireBullet::FireBullet::IsOutOfAmmo" + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" }, "parameters": [ "Object", - "Behavior", - "" + "yes" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "inverted": true, - "value": "FireBullet::FireBullet::IsReloadNeeded" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", - "" + "TargetOrientation", + "!=", + "\"portrait\"" ] - }, + } + ], + "actions": [ { "type": { - "inverted": true, - "value": "FireBullet::FireBullet::IsReloadInProgress" + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" }, "parameters": [ "Object", - "Behavior", - "" + "no" ] - }, + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "SceneWindowWidth()", + "<=", + "SceneWindowHeight()" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "inverted": true, - "value": "FireBullet::FireBullet::IsFiringCooldownActive" + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "\"landscape\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" }, "parameters": [ "Object", - "Behavior", - "" + "yes" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "inverted": true, - "value": "FireBullet::FireBullet::IsOverheated" + "value": "StringVariable" + }, + "parameters": [ + "TargetOrientation", + "=", + "\"portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsShown" }, "parameters": [ "Object", - "Behavior", - "" + "no" ] } ] } ] } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "FireBullet::FireBullet", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if automatic reloading is enabled.", - "fullName": "Is automatic reloading enabled", - "functionType": "Condition", - "group": "Reload", - "name": "IsAutomaticReloadingEnabled", - "sentence": "Automatic reloading is enabled on_PARAM0_", - "events": [ + "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": [], - "actions": [ + "conditions": [ { "type": { - "value": "SetReturnBoolean" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "False" + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsShown" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" + ] + } ] } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + ], + "actions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyAutomaticReloading" + "value": "PrimitiveDrawing::FillColor" }, "parameters": [ - "Object", - "Behavior" + "BackgroundPainter", + "BackgroundColor" ] - } - ], - "actions": [ + }, { "type": { - "value": "SetReturnBoolean" + "value": "PrimitiveDrawing::RoundedRectangle" }, "parameters": [ - "True" + "BackgroundPainter", + "Padding", + "Padding", + "Object.Width()-Padding", + "Object.Height()-Padding", + "CornerRadius" ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "FireBullet::FireBullet", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if ammo is unlimited.", - "fullName": "Is ammo unlimited", - "functionType": "Condition", - "group": "Ammo", - "name": "IsUnlimitedAmmo", - "sentence": "_PARAM0_ has unlimited ammo", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + }, { "type": { - "value": "SetReturnBoolean" + "value": "Montre" }, "parameters": [ - "False" + "Object", + "" ] } ] @@ -48655,183 +52355,183 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyUnlimitedAmmo" + "inverted": true, + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsShown" }, "parameters": [ - "Object", - "Behavior" + "Object" + ] + }, + { + "type": { + "inverted": true, + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" + }, + "parameters": [ + "Object" ] } ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "Cache" }, "parameters": [ - "True" + "Object" ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "FireBullet::FireBullet", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if object has no ammo available.", - "fullName": "Is out of ammo", - "functionType": "Condition", - "group": "Ammo", - "name": "IsOutOfAmmo", - "sentence": "_PARAM0_ is out of ammo", - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "MettreY" }, "parameters": [ - "False" + "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": "FireBullet::FireBullet::IsUnlimitedAmmo" + "value": "Tween::Exists" }, "parameters": [ - "Object", - "Behavior", - "" + "Icon", + "Tween", + "\"Rotate\"" ] }, { "type": { - "value": "FireBullet::FireBullet::PropertyAmmoQuantity" + "inverted": true, + "value": "Tween::Exists" }, "parameters": [ - "Object", - "Behavior", - "<=", - "0" + "Icon", + "Tween", + "\"RotateBack\"" ] } ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "Tween::TweenBehavior::AddObjectAngleTween2" }, "parameters": [ - "True" + "Icon", + "Tween", + "\"Rotate\"", + "8", + "\"easeInOutQuad\"", + "2", + "" ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "FireBullet::FireBullet", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if object needs to reload ammo.", - "fullName": "Is a reload needed", - "functionType": "Condition", - "group": "Reload", - "name": "IsReloadNeeded", - "sentence": "_PARAM0_ needs to reload ammo", - "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "Tween::HasFinished" + }, + "parameters": [ + "Icon", + "Tween", + "\"RotateBack\"" + ] + } + ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "Tween::TweenBehavior::AddObjectAngleTween2" }, "parameters": [ - "False" + "Icon", + "Tween", + "\"Rotate\"", + "8", + "\"easeInOutQuad\"", + "2", + "" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Icon", + "Tween", + "\"RotateBack\"" ] } ] }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Shots per reload must not be \"0\"" - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyShotsPerReload" + "value": "Tween::HasFinished" }, "parameters": [ - "Object", - "Behavior", - ">", - "0" + "Icon", + "Tween", + "\"Rotate\"" ] - }, + } + ], + "actions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyShotsBeforeNextReload" + "value": "Tween::TweenBehavior::AddObjectAngleTween2" }, "parameters": [ - "Object", - "Behavior", - "=", - "0" + "Icon", + "Tween", + "\"RotateBack\"", + "-8", + "\"easeInOutQuad\"", + "2", + "" ] - } - ], - "actions": [ + }, { "type": { - "value": "SetReturnBoolean" + "value": "Tween::RemoveTween" }, "parameters": [ - "True" + "Icon", + "Tween", + "\"Rotate\"" ] } ] @@ -48841,69 +52541,29 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "FireBullet::FireBullet", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if object is overheated.", - "fullName": "Is overheated", + "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", - "group": "Overheat", - "name": "IsOverheated", - "sentence": "_PARAM0_ is overheated", + "group": "Screen Orientation Checker configuration", + "name": "IsForceShown", + "sentence": "_PARAM0_ is forced to be shown", "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "False" - ] - } - ] - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BuiltinCommonInstructions::Or" + "value": "ScreenOrientationChecker::ScreenOrientationChecker::PropertyIsForceShown" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "FireBullet::FireBullet::PropertyHeatLevel" - }, - "parameters": [ - "Object", - "Behavior", - ">=", - "1" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Behavior::OverheatTimeLeft()", - ">", - "0" - ] - } + "parameters": [ + "Object" ] } ], @@ -48923,35 +52583,41 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "FireBullet::FireBullet", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if firing cooldown is active.", - "fullName": "Is firing cooldown active", - "functionType": "Condition", - "group": "Firing", - "name": "IsFiringCooldownActive", - "sentence": "Firing cooldown is active on _PARAM0_", + "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", + "group": "Screen Orientation Checker configuration", + "name": "SetIsForceShown", + "sentence": "Force _PARAM0_ to be shown: _PARAM1_", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsForceShown" }, "parameters": [ - "False" + "Object", + "no" ] } ] @@ -48961,22 +52627,21 @@ "conditions": [ { "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" + "value": "GetArgumentAsBoolean" }, "parameters": [ - "Object.Behavior::CooldownTimeLeft()", - ">", - "0" + "\"Value\"" ] } ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "ScreenOrientationChecker::ScreenOrientationChecker::SetPropertyIsForceShown" }, "parameters": [ - "True" + "Object", + "yes" ] } ] @@ -48986,29 +52651,21 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "ScreenOrientationChecker::ScreenOrientationChecker", "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "FireBullet::FireBullet", - "type": "behavior" + "defaultValue": "yes", + "description": "Force show the screen?", + "name": "Value", + "optional": true, + "type": "yesorno" } ], "objectGroups": [] } ], "propertyDescriptors": [ - { - "value": "0.1", - "type": "Number", - "unit": "Second", - "label": "Firing cooldown", - "description": "Objects cannot shoot while firing cooldown is active.", - "group": "", - "extraInformation": [], - "name": "FireCooldown" - }, { "value": "", "type": "Boolean", @@ -49017,260 +52674,372 @@ "group": "", "extraInformation": [], "hidden": true, - "name": "HasJustFired" - }, - { - "value": "true", - "type": "Boolean", - "label": "Rotate bullets to match their trajectory", - "description": "", - "group": "", - "extraInformation": [], - "name": "RotateBullet" - }, - { - "value": "45", - "type": "Number", - "unit": "DegreeAngle", - "label": "Firing arc", - "description": "Multi-Fire bullets will be evenly spaced inside the firing arc", - "group": "Multi-Fire", - "extraInformation": [], - "name": "FiringArc" - }, - { - "value": "1", - "type": "Number", - "label": "Number of bullets created at once", - "description": "Multi-Fire bullets will be evenly spaced inside the firing arc", - "group": "Multi-Fire", - "extraInformation": [], - "name": "BulletQuantity" - }, - { - "value": "0", - "type": "Number", - "unit": "DegreeAngle", - "label": "Angle variance", - "description": "Make imperfect aim (between 0 and 180 degrees).", - "group": "Firing variance", - "extraInformation": [], - "advanced": true, - "name": "AngleVariance" - }, - { - "value": "0", - "type": "Number", - "unit": "PixelSpeed", - "label": "Bullet speed variance", - "description": "Bullet speed will be adjusted by a random value within this range.", - "group": "Firing variance", - "extraInformation": [], - "advanced": true, - "name": "BulletSpeedVariance" - }, - { - "value": "0", - "type": "Number", - "label": "Ammo quantity (current)", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "AmmoQuantity" - }, - { - "value": "0", - "type": "Number", - "label": "Shots per reload ", - "description": "Use 0 to disable reloading.", - "group": "Reload", - "extraInformation": [], - "advanced": true, - "name": "ShotsPerReload" - }, - { - "value": "1", - "type": "Number", - "unit": "Second", - "label": "Reloading duration", - "description": "Objects cannot shoot while reloading is in progress.", - "group": "Reload", - "extraInformation": [], - "advanced": true, - "name": "ReloadDuration" - }, - { - "value": "0", - "type": "Number", - "label": "Max ammo ", - "description": "", - "group": "Ammo", - "extraInformation": [], - "advanced": true, - "name": "MaxAmmo" - }, - { - "value": "0", - "type": "Number", - "label": "Shots before next reload", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ShotsBeforeNextReload" - }, - { - "value": "0", - "type": "Number", - "label": "Total shots fired", - "description": "Regardless of how many bullets are created, only 1 shot will be counted per frame", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "TotalShotsFired" - }, - { - "value": "0", - "type": "Number", - "label": "Total bullets created", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "TotalBulletsCreated" - }, - { - "value": "0", - "type": "Number", - "label": "Starting ammo", - "description": "", - "group": "Ammo", - "extraInformation": [], - "advanced": true, - "name": "StartingAmmo" - }, - { - "value": "0", - "type": "Number", - "label": "Total reloads completed", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "TotalReloadsCompleted" - }, - { - "value": "true", - "type": "Boolean", - "label": "Unlimited ammo", - "description": "", - "group": "Ammo", - "extraInformation": [], - "advanced": true, - "name": "UnlimitedAmmo" + "name": "IsShown" }, { "value": "", "type": "Boolean", - "label": "", - "description": "", + "label": "Force show the screen", + "description": "Use this to test the screen in your game", "group": "", "extraInformation": [], - "hidden": true, - "name": "ReloadInProgress" - }, - { - "value": "0", - "type": "Number", - "label": "Heat increase per shot (between 0 and 1)", - "description": " Object is overheated when Heat reaches 1.", - "group": "Overheat", - "extraInformation": [], - "advanced": true, - "name": "HeatIncreasePerShot" + "name": "IsForceShown" }, { - "value": "0", + "value": "5", "type": "Number", - "label": "Heat level (Range: 0 to 1)", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "HeatLevel" - }, - { - "value": "true", - "type": "Boolean", - "label": "Reload automatically", + "unit": "Pixel", + "label": "Padding", "description": "", - "group": "Reload", + "group": "Appearance", "extraInformation": [], - "advanced": true, - "name": "AutomaticReloading" + "name": "Padding" }, { - "value": "0", + "value": "10", "type": "Number", - "unit": "Second", - "label": "Overheat duration", - "description": "Object cannot shoot while overheat duration is active.", - "group": "Overheat", + "unit": "Pixel", + "label": "Corner radius", + "description": "Corner radius for the background", + "group": "Appearance", "extraInformation": [], - "advanced": true, - "name": "OverheatDuration" + "name": "CornerRadius" }, { - "value": "0.1", - "type": "Number", - "label": "Linear cooling rate (per second)", + "value": "0;0;0", + "type": "Color", + "label": "Background color", "description": "", - "group": "Overheat", + "group": "Appearance", "extraInformation": [], - "advanced": true, - "name": "LinearCoolingRate" - }, + "name": "BackgroundColor" + } + ], + "objects": [ { - "value": "0.3", - "type": "Number", - "label": "Exponential cooling rate (per second)", - "description": "Happens faster when heat is high and slower when heat is low.", - "group": "Overheat", - "extraInformation": [ - "Linear", - "Exponential" + "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" + } ], - "advanced": true, - "name": "ExponentialCoolingRate" + "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, + "color": "255;255;255" + } }, { - "value": "", - "type": "String", - "label": "Layer the bullets are created on", - "description": "Base layer by default.", - "group": "Shooting configuration", - "extraInformation": [], - "hidden": true, - "name": "BulletLayer" + "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 + } }, { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "RandomizedAngle" + "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 + } + ] + ] + } + ] + } + ] + } + ] } ], - "sharedPropertyDescriptors": [] + "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": [] + } + ] } - ], - "eventsBasedObjects": [] + ] } ], - "externalLayouts": [], - "externalSourceFiles": [] + "externalLayouts": [ + { + "associatedLayout": "Game", + "name": "Touch controls", + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 32, + "height": 96, + "layer": "MobileControls", + "name": "Movement", + "persistentUuid": "3ae363a4-e615-459d-9083-427d51bd3c88", + "width": 96, + "x": 80, + "y": 336, + "zOrder": 34, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 32, + "height": 96, + "layer": "MobileControls", + "name": "Aiming", + "persistentUuid": "afa4be28-e0ea-490c-9fbf-89616608ebb0", + "width": 96, + "x": 688, + "y": 336, + "zOrder": 35, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 432, + "layer": "MobileControls", + "name": "ScreenOrientationChecker", + "persistentUuid": "f460d99f-c53e-4f3e-ade2-0e43ae14bdc6", + "width": 768, + "x": 0, + "y": 0, + "zOrder": 36, + "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.9114583333333334, + "windowMask": false + } + } + ] } \ No newline at end of file diff --git a/scripts/generate-database.js b/scripts/generate-database.js index 2356f7217..7dfb09418 100644 --- a/scripts/generate-database.js +++ b/scripts/generate-database.js @@ -318,29 +318,29 @@ const extractExamples = async ( ? 'big' : 'huge'; /** @type {ExampleUsedExtension[]} */ - const usedExtensions = gd.UsedExtensionsFinder.scanProject(project) - .getUsedExtensions() - .toNewVectorString() - .toJSArray() - .map( - /** @param {string} name */ - (name) => { - const platformExtension = platformExtensionsMap[name]; - if (!platformExtension) { - return { name, fullName: '', helpPath: '', iconUrl: '' }; + const usedExtensions = + gd.ExampleExtensionUsagesFinder.getUsedExtensions(project) + .toNewVectorString() + .toJSArray() + .map( + /** @param {string} name */ + (name) => { + const platformExtension = platformExtensionsMap[name]; + if (!platformExtension) { + return { name, fullName: '', helpPath: '', iconUrl: '' }; + } + + /** @type {ExampleUsedExtension} */ + const usedExtension = { + name, + fullName: platformExtension.getFullName(), + helpPath: platformExtension.getHelpPath(), + iconUrl: platformExtension.getIconUrl(), + category: platformExtension.getCategory(), + }; + return usedExtension; } - - /** @type {ExampleUsedExtension} */ - const usedExtension = { - name, - fullName: platformExtension.getFullName(), - helpPath: platformExtension.getHelpPath(), - iconUrl: platformExtension.getIconUrl(), - category: platformExtension.getCategory(), - }; - return usedExtension; - } - ); + ); /** @type {ExampleEventsBasedExtension[]} */ const eventsBasedExtensions = []; for (let i = 0; i < project.getEventsFunctionsExtensionsCount(); ++i) {