From 31b5c1dfb29f54c2d6199572449f112ca0490f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Mon, 20 Jan 2025 12:31:51 +0100 Subject: [PATCH 01/15] [3D shark frenzy] Update extensions --- examples/3d-shark-frenzy/3d-shark-frenzy.json | 4930 ++++++++++++----- 1 file changed, 3606 insertions(+), 1324 deletions(-) diff --git a/examples/3d-shark-frenzy/3d-shark-frenzy.json b/examples/3d-shark-frenzy/3d-shark-frenzy.json index f14c89834..997ddbdc3 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, @@ -8569,7 +8544,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 +9290,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 +9449,7 @@ "Object", "Object3D", "=", - "pow(Variable(_Tween3D.Volume) * GetArgumentAsNumber(\"Value\") * GetArgumentAsNumber(\"Value\"), 1/3)" + "pow(Variable(_Tween3D.Volume) * Value * Value, 1/3)" ] }, { @@ -9619,7 +9594,7 @@ "Object", "Scale", "=", - "pow(Variable(_Tween3D.Volume) * GetArgumentAsNumber(\"Value\") * GetArgumentAsNumber(\"Value\"), 1/3)" + "pow(Variable(_Tween3D.Volume) * Value * Value, 1/3)" ] }, { @@ -9753,7 +9728,7 @@ "parameters": [ "_Tween3D.Ratio", "=", - "pow(GetArgumentAsNumber(\"Value\") / Object.Behavior::ScaleVolume(), 1 / 3)" + "pow(Value / Object.Behavior::ScaleVolume(), 1 / 3)" ] }, { @@ -9893,10 +9868,10 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", - "GetArgumentAsNumber(\"TargetedValue\")", - "GetArgumentAsNumber(\"Duration\")", - "GetArgumentAsString(\"Easing\")", + "TweenIdentifier", + "TargetedValue", + "Duration", + "Easing", "\"StretchZ\"", "" ] @@ -9960,10 +9935,10 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", - "GetArgumentAsNumber(\"TargetedValue\")", - "GetArgumentAsNumber(\"Duration\")", - "GetArgumentAsString(\"Easing\")", + "TweenIdentifier", + "TargetedValue", + "Duration", + "Easing", "\"StretchY\"", "" ] @@ -10027,10 +10002,10 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", - "GetArgumentAsNumber(\"TargetedValue\")", - "GetArgumentAsNumber(\"Duration\")", - "GetArgumentAsString(\"Easing\")", + "TweenIdentifier", + "TargetedValue", + "Duration", + "Easing", "\"ScaleVolume\"", "" ] @@ -10163,10 +10138,10 @@ "Object", "Tween", "Object3D", - "GetArgumentAsString(\"TweenIdentifier\")", - "GetArgumentAsNumber(\"TargetedValue\")", - "GetArgumentAsString(\"Easing\")", - "GetArgumentAsNumber(\"Duration\")", + "TweenIdentifier", + "TargetedValue", + "Easing", + "Duration", "" ] } @@ -10231,10 +10206,10 @@ "Object", "Tween", "Object3D", - "GetArgumentAsString(\"TweenIdentifier\")", - "GetArgumentAsNumber(\"TargetedValue\")", - "GetArgumentAsString(\"Easing\")", - "GetArgumentAsNumber(\"Duration\")", + "TweenIdentifier", + "TargetedValue", + "Easing", + "Duration", "" ] } @@ -10299,10 +10274,10 @@ "Object", "Tween", "Object3D", - "GetArgumentAsString(\"TweenIdentifier\")", - "GetArgumentAsNumber(\"TargetedValue\")", - "GetArgumentAsString(\"Easing\")", - "GetArgumentAsNumber(\"Duration\")", + "TweenIdentifier", + "TargetedValue", + "Easing", + "Duration", "" ] } @@ -10367,10 +10342,10 @@ "Object", "Tween", "Object3D", - "GetArgumentAsString(\"TweenIdentifier\")", - "GetArgumentAsNumber(\"TargetedValue\")", - "GetArgumentAsString(\"Easing\")", - "GetArgumentAsNumber(\"Duration\")", + "TweenIdentifier", + "TargetedValue", + "Easing", + "Duration", "" ] } @@ -11076,7 +11051,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.VariableString(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Type)" + "Object.VariableString(_Tween3D.Tweens[TweenIdentifier].Type)" ] } ] @@ -11124,9 +11099,9 @@ }, "parameters": [ "Object", - "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Type", + "_Tween3D.Tweens[TweenIdentifier].Type", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -11170,7 +11145,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Variable(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Time)" + "Object.Variable(_Tween3D.Tweens[TweenIdentifier].Time)" ] } ] @@ -11218,9 +11193,9 @@ }, "parameters": [ "Object", - "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Time", + "_Tween3D.Tweens[TweenIdentifier].Time", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -11264,7 +11239,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Variable(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Duration)" + "Object.Variable(_Tween3D.Tweens[TweenIdentifier].Duration)" ] } ] @@ -11312,9 +11287,9 @@ }, "parameters": [ "Object", - "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Duration", + "_Tween3D.Tweens[TweenIdentifier].Duration", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -11358,7 +11333,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.VariableString(_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Easing)" + "Object.VariableString(_Tween3D.Tweens[TweenIdentifier].Easing)" ] } ] @@ -11406,9 +11381,9 @@ }, "parameters": [ "Object", - "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].Easing", + "_Tween3D.Tweens[TweenIdentifier].Easing", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -11640,7 +11615,7 @@ }, "parameters": [ "Object", - "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].IsPaused", + "_Tween3D.Tweens[TweenIdentifier].IsPaused", "True" ] } @@ -11705,7 +11680,7 @@ }, "parameters": [ "Object", - "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].IsPaused", + "_Tween3D.Tweens[TweenIdentifier].IsPaused", "True" ] } @@ -11731,7 +11706,7 @@ }, "parameters": [ "Object", - "_Tween3D.Tweens[GetArgumentAsString(\"TweenIdentifier\")].IsPaused", + "_Tween3D.Tweens[TweenIdentifier].IsPaused", "False" ] } @@ -11781,7 +11756,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] } @@ -11795,8 +11770,8 @@ "Object", "Behavior", "=", - "Object.Behavior::Duration(GetArgumentAsString(\"TweenIdentifier\"))", - "GetArgumentAsString(\"TweenIdentifier\")", + "Object.Behavior::Duration(TweenIdentifier)", + "TweenIdentifier", "" ] } @@ -11862,7 +11837,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] } @@ -11875,7 +11850,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "yes", "" ] @@ -11921,7 +11896,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] } @@ -11934,7 +11909,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "no", "" ] @@ -11980,7 +11955,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] } @@ -11993,7 +11968,7 @@ "parameters": [ "Object", "_Tween3D.Tweens", - "GetArgumentAsString(\"TweenIdentifier\")" + "TweenIdentifier" ] }, { @@ -12047,7 +12022,7 @@ "parameters": [ "Object", "_Tween3D.Tweens", - "GetArgumentAsString(\"TweenIdentifier\")" + "TweenIdentifier" ] } ], @@ -12101,7 +12076,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] }, @@ -12113,7 +12088,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] }, @@ -12125,7 +12100,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] } @@ -12182,7 +12157,7 @@ "Behavior", ">=", "1", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] } @@ -12237,7 +12212,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsString(\"TweenIdentifier\")", + "TweenIdentifier", "" ] } @@ -12248,7 +12223,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::Time(GetArgumentAsString(\"TweenIdentifier\")) / Object.Behavior::Duration(GetArgumentAsString(\"TweenIdentifier\"))" + "Object.Behavior::Time(TweenIdentifier) / Object.Behavior::Duration(TweenIdentifier)" ] } ] @@ -12484,7 +12459,7 @@ "Object", "Behavior", "<", - "Object.Behavior::PropertyScaleMinTweenDuration()" + "ScaleMinTweenDuration" ] } ], @@ -12508,7 +12483,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 +12499,7 @@ "Object", "Behavior", ">=", - "Object.Behavior::PropertyScaleMinTweenDuration()" + "ScaleMinTweenDuration" ] } ], @@ -12537,7 +12512,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyScaleMinTweenTarget()" + "ScaleMinTweenTarget" ] } ] @@ -12555,7 +12530,7 @@ "Object", "Behavior", "<", - "Object.Behavior::PropertyScaleMaxTweenDuration()" + "ScaleMaxTweenDuration" ] } ], @@ -12579,7 +12554,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 +12570,7 @@ "Object", "Behavior", ">=", - "Object.Behavior::PropertyScaleMaxTweenDuration()" + "ScaleMaxTweenDuration" ] } ], @@ -12608,7 +12583,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyScaleMinTweenTarget()" + "ScaleMinTweenTarget" ] } ] @@ -12665,7 +12640,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 +12681,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyScaleMin()" + "ScaleMin" ] } ] @@ -12749,7 +12724,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -12787,7 +12762,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyScaleMax()" + "ScaleMax" ] } ] @@ -12830,7 +12805,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -12893,7 +12868,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"TargetedValue\")" + "TargetedValue" ] }, { @@ -12904,7 +12879,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -12915,7 +12890,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Easing\")" + "Easing" ] } ] @@ -12994,7 +12969,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"TargetedValue\")" + "TargetedValue" ] }, { @@ -13005,7 +12980,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -13016,7 +12991,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Easing\")" + "Easing" ] } ] @@ -13112,7 +13087,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 +13140,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 +13170,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 +13209,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPeriodDuration()" + "PeriodDuration" ] } ] @@ -13277,7 +13252,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -13315,7 +13290,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyScalePeriodOffset()" + "ScalePeriodOffset" ] } ] @@ -13358,7 +13333,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -13396,7 +13371,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyStretchMin()" + "StretchMin" ] } ] @@ -13439,7 +13414,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -13477,7 +13452,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyStretchMax()" + "StretchMax" ] } ] @@ -13520,7 +13495,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -13558,7 +13533,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyStretchPeriodOffset()" + "StretchPeriodOffset" ] } ] @@ -13601,7 +13576,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -17338,7 +17313,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 +18572,7 @@ "parameters": [ "", "", - "GetArgumentAsString(\"Layer\")", + "Layer", "" ] } @@ -18624,7 +18599,7 @@ "parameters": [ "Layer", "=", - "GetArgumentAsString(\"Layer\")" + "Layer" ] }, { @@ -18634,7 +18609,7 @@ "parameters": [ "Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -18654,7 +18629,7 @@ "parameters": [ "StopEaseDuration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -18664,7 +18639,7 @@ "parameters": [ "DefaultAmplitudeX", "=", - "abs(GetArgumentAsNumber(\"AmplitudeX\"))" + "abs(AmplitudeX)" ] }, { @@ -18674,7 +18649,7 @@ "parameters": [ "DefaultAmplitudeY", "=", - "abs(GetArgumentAsNumber(\"AmplitudeY\"))" + "abs(AmplitudeY)" ] }, { @@ -18684,7 +18659,7 @@ "parameters": [ "DefaultAmplitudeAngle", "=", - "GetArgumentAsNumber(\"AmplitudeAngle\")" + "AmplitudeAngle" ] }, { @@ -18694,7 +18669,7 @@ "parameters": [ "DefaultAmplitudeZoom", "=", - "1 + GetArgumentAsNumber(\"AmplitudeZoom\") / 100" + "1 + AmplitudeZoom / 100" ] } ], @@ -18707,7 +18682,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "GetArgumentAsNumber(\"ShakePeriod\")", + "ShakePeriod", "!=", "0" ] @@ -18721,7 +18696,7 @@ "parameters": [ "DefaultFrequency", "=", - "1 / GetArgumentAsNumber(\"ShakePeriod\")" + "1 / ShakePeriod" ] } ] @@ -18734,7 +18709,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "GetArgumentAsNumber(\"ShakePeriod\")", + "ShakePeriod", "=", "0" ] @@ -21043,7 +21018,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 +21066,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyValue()" + "Value" ] } ] @@ -21146,7 +21121,7 @@ "Object", "Behavior", "=", - "clamp(GetArgumentAsNumber(\"Value\"), Object.Behavior::PropertyMinValue(), Object.Behavior::PropertyMaxValue())" + "clamp(Value, MinValue, MaxValue)" ] } ] @@ -21175,7 +21150,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 +21188,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMinValue()" + "MinValue" ] } ] @@ -21256,7 +21231,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -21306,7 +21281,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxValue()" + "MaxValue" ] } ] @@ -21349,7 +21324,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -21439,7 +21414,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyStepSize()" + "StepSize" ] } ] @@ -21482,7 +21457,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -21740,8 +21715,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 +21786,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 +21800,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { @@ -22098,7 +22073,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -22597,7 +22572,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -23388,66 +23363,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 +23626,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -23721,7 +23713,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -23817,7 +23809,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -23913,7 +23905,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -24893,7 +24885,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 +25091,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 +25162,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 +25176,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { @@ -25457,7 +25449,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -25996,7 +25988,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -26732,66 +26724,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 +27067,7 @@ "parameters": [ "Label", "=", - "GetArgumentAsString(\"LabelText\")" + "LabelText" ] }, { @@ -27628,7 +27637,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 +27710,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyHealth()", + "Health", "" ] } @@ -27792,7 +27801,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", ">", - "Object.Behavior::PropertyHealthRegenDelay()" + "HealthRegenDelay" ] } ], @@ -27805,7 +27814,7 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyHealthRegenRate() * TimeDelta()" + "HealthRegenRate * TimeDelta()" ] } ], @@ -27846,7 +27855,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyMaxHealth()" + "MaxHealth" ] } ] @@ -27959,7 +27968,7 @@ "Object", "Behavior", "<", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] }, { @@ -27970,7 +27979,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", ">", - "Object.Behavior::PropertyShieldRegenDelay()" + "ShieldRegenDelay" ] } ], @@ -28016,7 +28025,7 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyShieldRegenRate() * TimeDelta()" + "ShieldRegenRate * TimeDelta()" ] } ] @@ -28044,7 +28053,7 @@ "Object", "Behavior", ">", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ], @@ -28057,7 +28066,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ] @@ -28214,7 +28223,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"DamageValue\")" + "DamageValue" ] } ], @@ -28250,7 +28259,7 @@ "parameters": [ "RandomFloatInRange(0,1)", "<", - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ], @@ -28336,7 +28345,7 @@ "Object", "Behavior", "=", - "max(0,Object.Behavior::PropertyDamageToBeApplied() - Object.Behavior::PropertyFlatDamageReduction())" + "max(0,DamageToBeApplied - FlatDamageReduction)" ] } ] @@ -28388,7 +28397,7 @@ "Object", "Behavior", "*", - "1 - min(1, Object.Behavior::PropertyPercentDamageReduction())" + "1 - min(1, PercentDamageReduction)" ] } ] @@ -28501,7 +28510,7 @@ "Object", "Behavior", "<=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -28514,7 +28523,7 @@ "Object", "Behavior", "-", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { @@ -28525,7 +28534,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { @@ -28564,7 +28573,7 @@ "Object", "Behavior", ">", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -28577,7 +28586,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -28655,7 +28664,7 @@ "Object", "Behavior", "-", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] }, { @@ -28737,7 +28746,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyCurrentHealth() - Object.Behavior::PropertyDamageToBeApplied()", + "CurrentHealth - DamageToBeApplied", "" ] } @@ -28805,7 +28814,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCurrentHealth()" + "CurrentHealth" ] } ] @@ -28849,7 +28858,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28890,7 +28899,7 @@ "Object", "Behavior", "=", - "min(Object.Behavior::PropertyCurrentHealth(), Object.Behavior::PropertyMaxHealth())" + "min(CurrentHealth, MaxHealth)" ] } ] @@ -28936,7 +28945,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -29016,7 +29025,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"HealValue\")" + "HealValue" ] } ] @@ -29067,7 +29076,7 @@ "Object", "Behavior", "=", - "min(GetArgumentAsNumber(\"HealValue\"),Object.Behavior::PropertyMaxHealth() - Object.Behavior::PropertyCurrentHealth())" + "min(HealValue,MaxHealth - CurrentHealth)" ] } ] @@ -29096,7 +29105,7 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyHealToBeApplied()" + "HealToBeApplied" ] } ] @@ -29170,7 +29179,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxHealth()" + "MaxHealth" ] } ] @@ -29213,7 +29222,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29301,7 +29310,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -29345,7 +29354,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenRate()" + "HealthRegenRate" ] } ] @@ -29388,7 +29397,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29435,7 +29444,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -29479,7 +29488,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDamageCooldown()" + "DamageCooldown" ] } ] @@ -29522,7 +29531,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29569,7 +29578,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -29613,7 +29622,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenDelay()" + "HealthRegenDelay" ] } ] @@ -29656,7 +29665,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29703,7 +29712,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -29747,7 +29756,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ] @@ -29790,7 +29799,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29837,7 +29846,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -29881,7 +29890,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFlatDamageReduction()" + "FlatDamageReduction" ] } ] @@ -29924,7 +29933,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29971,7 +29980,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -30015,7 +30024,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPercentDamageReduction()" + "PercentDamageReduction" ] } ] @@ -30058,7 +30067,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -30105,7 +30114,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -30676,7 +30685,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", "<", - "Object.Behavior::PropertyDamageCooldown()" + "DamageCooldown" ] } ], @@ -30749,7 +30758,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::PropertyDamageCooldown() - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" + "max(0,DamageCooldown - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" ] } ] @@ -30895,7 +30904,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] } ] @@ -30936,7 +30945,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ] @@ -30979,7 +30988,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -31026,7 +31035,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -31074,7 +31083,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -31118,7 +31127,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ] @@ -31161,7 +31170,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -31208,7 +31217,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -31252,7 +31261,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenRate()" + "ShieldRegenRate" ] } ] @@ -31295,7 +31304,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -31342,7 +31351,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -31386,7 +31395,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenDelay()" + "ShieldRegenDelay" ] } ] @@ -31429,7 +31438,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -31476,7 +31485,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -31520,7 +31529,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDuration()" + "ShieldDuration" ] } ] @@ -31563,7 +31572,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -31610,7 +31619,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -31696,7 +31705,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"ShieldPoints\")" + "ShieldPoints" ] } ] @@ -31725,7 +31734,7 @@ "Object", "Behavior", "=", - "min(GetArgumentAsNumber(\"ShieldPoints\"),Object.Behavior::MaxShield())" + "min(ShieldPoints,Object.Behavior::MaxShield())" ] } ] @@ -32088,7 +32097,7 @@ "Object", "\"__Health.ShieldDuration\"", "<", - "Object.Behavior::PropertyShieldDuration()" + "ShieldDuration" ] } ], @@ -32164,7 +32173,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::PropertyShieldDuration() - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" + "max(0,ShieldDuration - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" ] } ] @@ -32205,7 +32214,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDamageTaken()" + "ShieldDamageTaken" ] } ] @@ -32246,7 +32255,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealToBeApplied()" + "HealToBeApplied" ] } ] @@ -32529,7 +32538,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 +32605,7 @@ "Object", "\"__ResourceBar.LastValueChange\"", "<=", - "Object.Behavior::PropertyPreviousHighValueDuration()" + "PreviousHighValueDuration" ] } ], @@ -32645,7 +32654,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyValue()" + "Value" ] } ] @@ -32688,7 +32697,7 @@ "Object", "Behavior", "=", - "clamp(GetArgumentAsNumber(\"Value\"), 0, Object.Behavior::MaxValue())" + "clamp(Value, 0, Object.Behavior::MaxValue())" ] } ] @@ -32731,7 +32740,7 @@ "Object", "Behavior", ">=", - "Object.Behavior::PropertyPreviousHighValue()" + "PreviousHighValue" ] } ], @@ -32781,7 +32790,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxValue()" + "MaxValue" ] } ] @@ -32824,7 +32833,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -32912,7 +32921,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyMaxValue()" + "MaxValue" ] } ], @@ -32959,7 +32968,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPreviousHighValue()" + "PreviousHighValue" ] } ] @@ -33002,7 +33011,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyValue()" + "Value" ] } ] @@ -33040,7 +33049,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPreviousHighValueDuration()" + "PreviousHighValueDuration" ] } ] @@ -33083,7 +33092,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -33122,7 +33131,7 @@ "Object", "Behavior", "!=", - "Object.Behavior::PropertyValue()", + "Value", "" ] }, @@ -33134,7 +33143,7 @@ "Object", "\"__ResourceBar.LastValueChange\"", "<=", - "Object.Behavior::PropertyPreviousHighValueDuration()" + "PreviousHighValueDuration" ] } ], @@ -33698,66 +33707,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 +34088,7 @@ "FillBar", "ResourceBar", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -34240,7 +34266,7 @@ "FillBar", "ResourceBar", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -34424,7 +34450,7 @@ "FillBar", "ResourceBar", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -36045,7 +36071,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 +36106,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 +36570,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Pressed\"" ] @@ -36142,10 +36618,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Released\"" ] @@ -36192,10 +36668,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Buttons[Button].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "ButtonState" ] @@ -36237,10 +36713,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", "=", "DeadZoneRadius" ] @@ -36285,7 +36761,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone" ] } ] @@ -36325,7 +36801,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 4 / 360), 4)" + "mod(round(Angle * 4 / 360), 4)" ] } ] @@ -36360,7 +36836,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 8 / 360), 8)" + "mod(round(Angle * 8 / 360), 8)" ] } ] @@ -36394,7 +36870,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -36407,7 +36883,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36431,7 +36907,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -36444,7 +36920,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36468,7 +36944,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -36481,7 +36957,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36505,7 +36981,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -36518,7 +36994,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36566,7 +37042,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -36579,7 +37055,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36603,7 +37079,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownRight\"" ] @@ -36616,7 +37092,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36640,7 +37116,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -36653,7 +37129,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36677,7 +37153,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownLeft\"" ] @@ -36690,7 +37166,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36714,7 +37190,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -36727,7 +37203,7 @@ "", "=", "4", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36751,7 +37227,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpLeft\"" ] @@ -36764,7 +37240,7 @@ "", "=", "5", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36788,7 +37264,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -36801,7 +37277,7 @@ "", "=", "6", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -36825,7 +37301,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpRight\"" ] @@ -36838,7 +37314,7 @@ "", "=", "7", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -37067,6 +37543,11 @@ "name": "JoystickIdentifier", "supplementaryInformation": "[\"Primary\",\"Secondary\"]", "type": "stringWithSelector" + }, + { + "description": "", + "name": "Coucou", + "type": "expression" } ], "objectGroups": [] @@ -37087,7 +37568,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 +37606,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", "=", "Value" ] @@ -37172,7 +37653,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -37212,7 +37693,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle" ] } ] @@ -37250,12 +37731,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 +37777,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 +37817,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 +37840,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 +37979,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 +38019,8 @@ }, { "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "JoystickForce", - "name": "SetJoystickForce", - "private": true, + "functionType": "Action", + "name": "onDeActivate", "sentence": "", "events": [ { @@ -37753,24 +38029,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 +38055,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 +38455,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -37861,9 +38464,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickAngle()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickAngle", "" ] } @@ -38223,7 +38826,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyControllerIdentifier()" + "ControllerIdentifier" ] } ] @@ -38266,7 +38869,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -38304,7 +38907,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyJoystickIdentifier()" + "JoystickIdentifier" ] } ] @@ -38347,7 +38950,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -38430,6 +39033,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 +39100,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "Touch identifier", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -38619,12 +39279,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 +39316,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] }, { @@ -38693,7 +39372,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -38721,18 +39400,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 +40609,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 +40690,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 +40730,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 +40750,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 +40771,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 +41054,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::PlatformerMultitouchMapper", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], @@ -39125,13 +41065,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 +41083,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 +41240,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 +41269,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 +41317,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -39306,8 +41345,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -39334,8 +41373,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -39362,8 +41401,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -39407,8 +41446,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -39435,8 +41474,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -39463,8 +41502,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -39491,8 +41530,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -39519,8 +41558,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"UpLeft\"", "" ] @@ -39556,8 +41595,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"UpRight\"", "" ] @@ -39593,8 +41632,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"DownLeft\"", "" ] @@ -39630,8 +41669,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"DownRight\"", "" ] @@ -39874,6 +41913,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 +42020,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyControllerIdentifier()", + "ControllerIdentifier", "" ] }, @@ -39950,7 +42032,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyJoystickIdentifier()", + "JoystickIdentifier", "" ] }, @@ -39962,7 +42044,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyDeadZoneRadius()", + "DeadZoneRadius", "" ] } @@ -39979,6 +42061,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 +42715,7 @@ "Border", "MultitouchJoystick", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -40535,7 +42787,7 @@ "Border", "MultitouchJoystick", "=", - "GetArgumentAsString(\"Value\")", + "Value", "" ] } @@ -40607,7 +42859,7 @@ "Border", "MultitouchJoystick", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -40699,6 +42951,16 @@ "extraInformation": [], "hidden": true, "name": "ParentOrigin" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShouldBeHiddenWhenReleased" } ], "objects": [ @@ -40818,7 +43080,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 +43365,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 +47986,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 +48356,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 +50736,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -48528,7 +50808,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -48611,7 +50891,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -48692,7 +50972,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -48774,7 +51054,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -48856,7 +51136,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -48938,7 +51218,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49020,7 +51300,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49103,7 +51383,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49185,7 +51465,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49268,7 +51548,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49351,7 +51631,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49433,7 +51713,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49515,7 +51795,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49598,7 +51878,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49681,7 +51961,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49894,7 +52174,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -49979,7 +52259,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -50063,7 +52343,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -50146,7 +52426,7 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -50608,7 +52888,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 +52955,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyLeftwardSpeed()", + "LeftwardSpeed", "log(1 - )" ] }, @@ -50686,7 +52966,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyRightwardSpeed()", + "RightwardSpeed", "log(1 - )" ] }, @@ -50697,7 +52977,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyUpwardSpeed()", + "UpwardSpeed", "log(1 - )" ] }, @@ -50708,7 +52988,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyDownwardSpeed()", + "DownwardSpeed", "log(1 - )" ] }, @@ -50719,7 +52999,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyLeftwardSpeedMax()", + "LeftwardSpeedMax", "log(1 - )" ] }, @@ -50730,7 +53010,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyRightwardSpeedMax()", + "RightwardSpeedMax", "log(1 - )" ] }, @@ -50741,7 +53021,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyUpwardSpeedMax()", + "UpwardSpeedMax", "log(1 - )" ] }, @@ -50752,7 +53032,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyDownwardSpeedMax()", + "DownwardSpeedMax", "log(1 - )" ] }, @@ -50763,7 +53043,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaLeft()", + "FollowFreeAreaLeft", "log(1 - )" ] }, @@ -50774,7 +53054,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaRight()", + "FollowFreeAreaRight", "log(1 - )" ] }, @@ -50785,7 +53065,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaTop()", + "FollowFreeAreaTop", "log(1 - )" ] }, @@ -50796,7 +53076,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaBottom()", + "FollowFreeAreaBottom", "log(1 - )" ] }, @@ -50808,7 +53088,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyCameraDelay()" + "CameraDelay" ] } ] @@ -51048,7 +53328,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 +53345,7 @@ "parameters": [ "", "<", - "Object.Behavior::PropertyOldX() - Object.Behavior::PropertyLeftwardSpeedMax() * TimeDelta()", + "OldX - LeftwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51079,7 +53359,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldX() - Object.Behavior::PropertyLeftwardSpeedMax() * TimeDelta()", + "OldX - LeftwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51112,7 +53392,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 +53409,7 @@ "parameters": [ "", ">", - "Object.Behavior::PropertyOldX() + Object.Behavior::PropertyRightwardSpeedMax() * TimeDelta()", + "OldX + RightwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51143,7 +53423,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldX() + Object.Behavior::PropertyRightwardSpeedMax() * TimeDelta()", + "OldX + RightwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51205,7 +53485,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 +53502,7 @@ "parameters": [ "", "<", - "Object.Behavior::PropertyOldY() - Object.Behavior::PropertyUpwardSpeedMax() * TimeDelta()", + "OldY - UpwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51236,7 +53516,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldY() - Object.Behavior::PropertyUpwardSpeedMax() * TimeDelta()", + "OldY - UpwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51269,7 +53549,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 +53566,7 @@ "parameters": [ "", ">", - "Object.Behavior::PropertyOldY() + Object.Behavior::PropertyDownwardSpeedMax() * TimeDelta()", + "OldY + DownwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51300,7 +53580,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldY() + Object.Behavior::PropertyDownwardSpeedMax() * TimeDelta()", + "OldY + DownwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -51358,7 +53638,7 @@ "Object", "Behavior", "=", - "TimeFromStart() + GetArgumentAsNumber(\"WaitingDuration\")" + "TimeFromStart() + NewWaitingDuration" ] }, { @@ -51369,7 +53649,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"WaitingSpeedXMax\")" + "NewWaitingSpeedXMax" ] }, { @@ -51380,7 +53660,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"WaitingSpeedYMax\")" + "NewWaitingSpeedYMax" ] }, { @@ -51391,7 +53671,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"CatchUpDuration\")" + "NewCatchUpDuration" ] } ] @@ -51428,22 +53708,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 +53819,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 +53975,10 @@ }, "parameters": [ "ShapePainter", - "Object.Behavior::PropertyProjectedOldestX()", - "Object.Behavior::PropertyProjectedOldestY()", - "Object.Behavior::PropertyProjectedNewestX()", - "Object.Behavior::PropertyProjectedNewestY()", + "ProjectedOldestX", + "ProjectedOldestY", + "ProjectedNewestX", + "ProjectedNewestY", "1" ] } @@ -51726,8 +54006,8 @@ }, "parameters": [ "ShapePainter", - "Object.Behavior::PropertyForecastedX()", - "Object.Behavior::PropertyForecastedY()", + "ForecastedX", + "ForecastedY", "3" ] }, @@ -51816,7 +54096,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"FollowOnX\"" + "\"Value\"" ] } ], @@ -51848,7 +54128,7 @@ }, { "description": "Follow on X axis", - "name": "FollowOnX", + "name": "Value", "type": "yesorno" } ], @@ -51886,7 +54166,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"FollowOnY\"" + "\"Value\"" ] } ], @@ -51918,7 +54198,7 @@ }, { "description": "Follow on Y axis", - "name": "FollowOnY", + "name": "Value", "type": "yesorno" } ], @@ -51944,7 +54224,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaRight\"))" + "max(0, Value)" ] } ] @@ -51964,7 +54244,7 @@ }, { "description": "Follow free area right border", - "name": "SetFollowFreeAreaRight", + "name": "Value", "type": "expression" } ], @@ -51990,7 +54270,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaLeft\"))" + "max(0, Value)" ] } ] @@ -52010,7 +54290,7 @@ }, { "description": "Follow free area left border", - "name": "SetFollowFreeAreaLeft", + "name": "Value", "type": "expression" } ], @@ -52036,7 +54316,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"FollowFreeAreaTop\"))" + "max(0, Value)" ] } ] @@ -52056,7 +54336,7 @@ }, { "description": "Follow free area top border", - "name": "FollowFreeAreaTop", + "name": "Value", "type": "expression" } ], @@ -52082,7 +54362,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaBottom\"))" + "max(0, Value)" ] } ] @@ -52102,7 +54382,7 @@ }, { "description": "Follow free area bottom border", - "name": "SetFollowFreeAreaBottom", + "name": "Value", "type": "expression" } ], @@ -52128,7 +54408,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -52148,7 +54428,7 @@ }, { "description": "Leftward maximum speed (in ratio per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -52174,7 +54454,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -52194,7 +54474,7 @@ }, { "description": "Rightward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -52220,7 +54500,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -52240,7 +54520,7 @@ }, { "description": "Upward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -52266,7 +54546,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -52286,7 +54566,7 @@ }, { "description": "Downward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -52312,7 +54592,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"LeftwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -52323,7 +54603,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyLeftwardSpeed())" + "log(1 - Value)" ] } ] @@ -52343,7 +54623,7 @@ }, { "description": "Leftward catch-up speed (in ratio per second)", - "name": "LeftwardSpeed", + "name": "Value", "type": "expression" } ], @@ -52369,7 +54649,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"RightwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -52380,7 +54660,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyRightwardSpeed())" + "log(1 - Value)" ] } ] @@ -52400,7 +54680,7 @@ }, { "description": "Rightward catch-up speed (in ratio per second)", - "name": "RightwardSpeed", + "name": "Value", "type": "expression" } ], @@ -52426,7 +54706,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"DownwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -52437,7 +54717,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyDownwardSpeed())" + "log(1 - Value)" ] } ] @@ -52457,7 +54737,7 @@ }, { "description": "Downward catch-up speed (in ratio per second)", - "name": "DownwardSpeed", + "name": "Value", "type": "expression" } ], @@ -52483,7 +54763,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"UpwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -52494,7 +54774,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyUpwardSpeed())" + "log(1 - Value)" ] } ] @@ -52514,7 +54794,7 @@ }, { "description": "Upward catch-up speed (in ratio per second)", - "name": "UpwardSpeed", + "name": "Value", "type": "expression" } ], @@ -52537,7 +54817,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCameraOffsetX()" + "CameraOffsetX" ] } ] @@ -52580,7 +54860,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -52634,7 +54914,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"CameraOffsetX\")", + "Value", "" ] } @@ -52655,7 +54935,7 @@ }, { "description": "Camera offset X", - "name": "CameraOffsetX", + "name": "Value", "type": "expression" } ], @@ -52678,7 +54958,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCameraOffsetY()" + "CameraOffsetY" ] } ] @@ -52733,7 +55013,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -52775,7 +55055,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"CameraOffsetY\")", + "CameraOffsetY", "" ] } @@ -52822,7 +55102,7 @@ "Object", "Behavior", "=", - "min(0, GetArgumentAsNumber(\"ForecastTime\"))" + "min(0, Value)" ] } ] @@ -52842,7 +55122,7 @@ }, { "description": "Forecast time", - "name": "ForecastTime", + "name": "Value", "type": "expression" } ], @@ -52868,7 +55148,7 @@ "Object", "Behavior", "=", - "min(0, GetArgumentAsNumber(\"CameraDelay\"))" + "min(0, Value)" ] } ] @@ -52888,7 +55168,7 @@ }, { "description": "Camera delay", - "name": "CameraDelay", + "name": "Value", "type": "expression" } ], @@ -52912,7 +55192,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedX() + Object.Behavior::PropertyCameraOffsetX() - Object.Behavior::PropertyFollowFreeAreaLeft()" + "ForecastedX + CameraOffsetX - FollowFreeAreaLeft" ] } ] @@ -52954,7 +55234,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedX() + Object.Behavior::PropertyCameraOffsetX() + Object.Behavior::PropertyFollowFreeAreaRight()" + "ForecastedX + CameraOffsetX + FollowFreeAreaRight" ] } ] @@ -52996,7 +55276,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedY() + Object.Behavior::PropertyCameraOffsetY() + Object.Behavior::PropertyFollowFreeAreaBottom()" + "ForecastedY + CameraOffsetY + FollowFreeAreaBottom" ] } ] @@ -53038,7 +55318,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedY() + Object.Behavior::PropertyCameraOffsetY() - Object.Behavior::PropertyFollowFreeAreaTop()" + "ForecastedY + CameraOffsetY - FollowFreeAreaTop" ] } ] @@ -53125,7 +55405,7 @@ "parameters": [ "Object", "__SmoothCamera.ObjectX", - "Object.Behavior::PropertyDelayedCenterX()" + "DelayedCenterX" ] }, { @@ -53135,7 +55415,7 @@ "parameters": [ "Object", "__SmoothCamera.ObjectY", - "Object.Behavior::PropertyDelayedCenterY()" + "DelayedCenterY" ] } ] @@ -53463,7 +55743,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 +55758,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Extra delay: \" + ToString(Object.Behavior::PropertyCameraExtraDelay())", + "\"Extra delay: \" + ToString(CameraExtraDelay)", "\"info\"", "\"SmoothCamera\"" ] @@ -53617,7 +55897,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyCameraExtraDelay() / Object.Behavior::PropertyCameraDelayCatchUpDuration()" + "CameraExtraDelay / CameraDelayCatchUpDuration" ] } ], @@ -53676,7 +55956,7 @@ "Object", "Behavior", "=", - "max(0, Object.Behavior::PropertyCameraExtraDelay() -Object.Behavior::PropertyCameraDelayCatchUpSpeed() * TimeDelta())" + "max(0, CameraExtraDelay -CameraDelayCatchUpSpeed * TimeDelta())" ] } ], @@ -53691,7 +55971,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Catching up delay: \" + ToString(Object.Behavior::PropertyCameraExtraDelay())", + "\"Catching up delay: \" + ToString(CameraExtraDelay)", "\"info\"", "\"SmoothCamera\"" ] @@ -53782,7 +56062,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCameraDelay() + Object.Behavior::PropertyCameraExtraDelay()" + "CameraDelay + CameraExtraDelay" ] } ] @@ -53907,7 +56187,7 @@ "parameters": [ "Object", "__SmoothCamera.ForecastHistoryTime", - "GetArgumentAsNumber(\"Time\")" + "Time" ] }, { @@ -53917,7 +56197,7 @@ "parameters": [ "Object", "__SmoothCamera.ForecastHistoryX", - "GetArgumentAsNumber(\"ObjectX\")" + "ObjectX" ] }, { @@ -53927,7 +56207,7 @@ "parameters": [ "Object", "__SmoothCamera.ForecastHistoryY", - "GetArgumentAsNumber(\"ObjectY\")" + "ObjectY" ] } ], @@ -53966,7 +56246,7 @@ "Object", "__SmoothCamera.ForecastHistoryTime[0]", "<", - "TimeFromStart() - Object.Behavior::PropertyCameraDelay() - Object.Behavior::PropertyCameraExtraDelay() - Object.Behavior::PropertyForecastHistoryDuration()" + "TimeFromStart() - CameraDelay - CameraExtraDelay - ForecastHistoryDuration" ] } ], @@ -54058,7 +56338,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterX()" + "DelayedCenterX" ] }, { @@ -54069,7 +56349,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterY()" + "DelayedCenterY" ] } ] @@ -54182,7 +56462,7 @@ "Object", "Behavior", "+", - "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()])" + "Object.Variable(__SmoothCamera.ForecastHistoryX[Index])" ] }, { @@ -54268,7 +56548,7 @@ "Object", "Behavior", "+", - "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()])" + "Object.Variable(__SmoothCamera.ForecastHistoryY[Index])" ] }, { @@ -54311,7 +56591,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Mean: \" + ToString(Object.Behavior::PropertyForecastHistoryMeanX()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryMeanY())", + "\"Mean: \" + ToString(ForecastHistoryMeanX) + \" \" + ToString(ForecastHistoryMeanY)", "", "" ] @@ -54405,7 +56685,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 +56696,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 +56707,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 +56733,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 +56748,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", "<", "1" ] @@ -54478,7 +56758,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())", + "abs(ForecastHistoryVarianceY)", "<", "1" ] @@ -54493,7 +56773,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterX()" + "DelayedCenterX" ] }, { @@ -54504,7 +56784,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterY()" + "DelayedCenterY" ] } ] @@ -54523,7 +56803,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", ">=", "1" ] @@ -54533,7 +56813,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())", + "abs(ForecastHistoryVarianceY)", ">=", "1" ] @@ -54572,9 +56852,9 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", ">=", - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())" + "abs(ForecastHistoryVarianceY)" ] } ], @@ -54587,7 +56867,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryCovariance() / Object.Behavior::PropertyForecastHistoryVarianceX()" + "ForecastHistoryCovariance / ForecastHistoryVarianceX" ] }, { @@ -54598,7 +56878,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryMeanY() - Object.Behavior::PropertyForecastHistoryLinearA() * Object.Behavior::PropertyForecastHistoryMeanX()" + "ForecastHistoryMeanY - ForecastHistoryLinearA * ForecastHistoryMeanX" ] } ], @@ -54613,7 +56893,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Linear: \" + ToString(Object.Behavior::PropertyForecastHistoryLinearA()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryLinearB())", + "\"Linear: \" + ToString(ForecastHistoryLinearA) + \" \" + ToString(ForecastHistoryLinearB)", "\"info\"", "\"SmoothCamera\"" ] @@ -54674,9 +56954,9 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", "<", - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())" + "abs(ForecastHistoryVarianceY)" ] } ], @@ -54689,7 +56969,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryCovariance() / Object.Behavior::PropertyForecastHistoryVarianceY()" + "ForecastHistoryCovariance / ForecastHistoryVarianceY" ] }, { @@ -54700,7 +56980,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryMeanX() - Object.Behavior::PropertyForecastHistoryLinearA() * Object.Behavior::PropertyForecastHistoryMeanY()" + "ForecastHistoryMeanX - ForecastHistoryLinearA * ForecastHistoryMeanY" ] } ], @@ -54715,7 +56995,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Linear: \" + ToString(Object.Behavior::PropertyForecastHistoryLinearA()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryLinearB())", + "\"Linear: \" + ToString(ForecastHistoryLinearA) + \" \" + ToString(ForecastHistoryLinearB)", "\"info\"", "\"SmoothCamera\"" ] @@ -54775,7 +57055,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedOldestX()" + "ProjectedOldestX" ] }, { @@ -54786,7 +57066,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedOldestY()" + "ProjectedOldestY" ] }, { @@ -54797,7 +57077,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyIndex()" + "Index" ] } ] @@ -54814,7 +57094,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestX()" + "ProjectedNewestX" ] }, { @@ -54825,7 +57105,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestY()" + "ProjectedNewestY" ] }, { @@ -54836,7 +57116,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyIndex()" + "Index" ] } ] @@ -54854,7 +57134,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Oldest: \" + ToString(Object.Behavior::PropertyProjectedOldestX()) + \" \" + ToString(Object.Behavior::PropertyProjectedOldestY())", + "\"Oldest: \" + ToString(ProjectedOldestX) + \" \" + ToString(ProjectedOldestY)", "\"info\"", "\"SmoothCamera\"" ] @@ -54871,7 +57151,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Newest: \" + ToString(Object.Behavior::PropertyProjectedNewestX()) + \" \" + ToString(Object.Behavior::PropertyProjectedNewestY())", + "\"Newest: \" + ToString(ProjectedNewestX) + \" \" + ToString(ProjectedNewestY)", "\"info\"", "\"SmoothCamera\"" ] @@ -54901,7 +57181,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestX() + ( Object.Behavior::PropertyProjectedNewestX() - Object.Behavior::PropertyProjectedOldestX()) * Object.Behavior::ForecastTimeRatio()" + "ProjectedNewestX + ( ProjectedNewestX - ProjectedOldestX) * Object.Behavior::ForecastTimeRatio()" ] }, { @@ -54912,7 +57192,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestY() + ( Object.Behavior::PropertyProjectedNewestY() - Object.Behavior::PropertyProjectedOldestY()) * Object.Behavior::ForecastTimeRatio()" + "ProjectedNewestY + ( ProjectedNewestY - ProjectedOldestY) * Object.Behavior::ForecastTimeRatio()" ] } ] @@ -54927,7 +57207,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Forecasted: \" + ToString(Object.Behavior::PropertyForecastedX()) + \" \" + ToString(Object.Behavior::PropertyForecastedY())", + "\"Forecasted: \" + ToString(ForecastedX) + \" \" + ToString(ForecastedY)", "\"info\"", "\"SmoothCamera\"" ] @@ -54996,7 +57276,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 +57287,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 +57304,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 +57315,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 +57374,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 +57934,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorFollowFreeAreaTop()", + "FloorFollowFreeAreaTop", "" ] }, @@ -55665,7 +57945,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorFollowFreeAreaBottom()", + "FloorFollowFreeAreaBottom", "" ] }, @@ -55676,7 +57956,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorUpwardSpeed()", + "FloorUpwardSpeed", "" ] }, @@ -55687,7 +57967,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorDownwardSpeed()", + "FloorDownwardSpeed", "" ] }, @@ -55698,7 +57978,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorUpwardSpeedMax()", + "FloorUpwardSpeedMax", "" ] }, @@ -55709,7 +57989,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorDownwardSpeedMax()", + "FloorDownwardSpeedMax", "" ] } @@ -55753,7 +58033,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirFollowFreeAreaTop()", + "AirFollowFreeAreaTop", "" ] }, @@ -55764,7 +58044,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirFollowFreeAreaBottom()", + "AirFollowFreeAreaBottom", "" ] }, @@ -55775,7 +58055,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirUpwardSpeed()", + "AirUpwardSpeed", "" ] }, @@ -55786,7 +58066,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirDownwardSpeed()", + "AirDownwardSpeed", "" ] }, @@ -55797,7 +58077,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirUpwardSpeedMax()", + "AirUpwardSpeedMax", "" ] }, @@ -55808,7 +58088,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirDownwardSpeedMax()", + "AirDownwardSpeedMax", "" ] } @@ -55996,7 +58276,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 +59225,7 @@ "Behavior", "TargetedObject.CenterX()", "TargetedObject.CenterY()", - "DecisionWeight", - "GetArgumentAsNumber(\"DecisionWeight\")" + "DecisionWeight" ] } ] @@ -57368,26 +59647,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 +59690,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 +59708,18 @@ "actions": [ { "type": { - "value": "BoidsMovement::BoidsMovement::SetPropertyMaxAcceleration" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "SteeringForce" + "MaxSpeed" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -57450,43 +59731,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 +59772,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 +59798,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "MaxSpeed" + "MaxAcceleration" ] } ] @@ -57549,12 +59823,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 +59836,18 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "BoidsMovement::BoidsMovement::SetPropertyMaxAcceleration" }, "parameters": [ - "MaxAcceleration" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -57585,6 +59859,11 @@ "name": "Behavior", "supplementaryInformation": "BoidsMovement::BoidsMovement", "type": "behavior" + }, + { + "description": "Steering Force", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -58231,6 +60510,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 +66818,5 @@ "windowMask": false } } - ], - "externalSourceFiles": [] + ] } \ No newline at end of file From b2116161be70c7cce3109bfea993d2ddd7dfe84c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Mon, 20 Jan 2025 12:48:32 +0100 Subject: [PATCH 02/15] [3D shark frenzy] Floating joystick --- examples/3d-shark-frenzy/3d-shark-frenzy.json | 58 ++++++++++++++++++- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/examples/3d-shark-frenzy/3d-shark-frenzy.json b/examples/3d-shark-frenzy/3d-shark-frenzy.json index 997ddbdc3..dc1bbce6c 100644 --- a/examples/3d-shark-frenzy/3d-shark-frenzy.json +++ b/examples/3d-shark-frenzy/3d-shark-frenzy.json @@ -2182,7 +2182,7 @@ "persistentUuid": "0323ca9b-ab3a-4734-ad65-15d1ee47cbb4", "width": 0, "x": 200, - "y": 600, + "y": 548, "zOrder": 16, "numberProperties": [], "stringProperties": [], @@ -2232,7 +2232,7 @@ "persistentUuid": "0afe5fb3-ccde-43a8-a3ff-4cc30a042321", "width": 107, "x": 1064, - "y": 565, + "y": 513, "zOrder": 19, "numberProperties": [], "stringProperties": [], @@ -3406,7 +3406,8 @@ "ButtonIdentifier": "FastSwim", "TouchId": 0, "TouchIndex": 2.0247e-320, - "IsReleased": false + "IsReleased": false, + "Radius": 200 } ], "animations": [ @@ -5187,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\")" + ] } ] }, From 036ad849c8ba434a6479dc063c376312eb0cc38c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Mon, 20 Jan 2025 13:01:20 +0100 Subject: [PATCH 03/15] [3D shooting gallery] Update extensions --- .../3d-shooting-gallery.json | 1481 +++++++++++++++-- 1 file changed, 1364 insertions(+), 117 deletions(-) diff --git a/examples/3d-shooting-gallery/3d-shooting-gallery.json b/examples/3d-shooting-gallery/3d-shooting-gallery.json index 2ba06efef..b184bc7a7 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 @@ -18,7 +18,6 @@ "scaleMode": "linear", "sizeOnStartupMode": "", "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.", @@ -11594,7 +11593,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 +11617,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 +11654,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 +11729,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 +11833,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 +11911,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, @@ -11733,10 +11950,87 @@ "functionType": "Condition", "name": "isPointerLocked", "sentence": "The mouse pointer is locked", + "events": [ + { + "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": "eventsFunctionContext.returnValue = document.pointerLockElement ? true : false;", + "inlineCode": [ + "\r", + "const { handler } = gdjs._MousePointerLockExtension;\r", + "\r", + "eventsFunctionContext.returnValue = handler.isPointerLocked();\r", + "" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": false @@ -11745,6 +12039,53 @@ "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", @@ -11804,14 +12145,120 @@ { "description": "the movement of the locked pointer on the X axis.", "fullName": "Pointer X movement", - "functionType": "ExpressionAndCondition", - "name": "MovementX", + "functionType": "ExpressionAndCondition", + "name": "MovementX", + "private": true, + "sentence": "the movement of the locked pointer on the X axis", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "eventsFunctionContext.returnValue = gdjs._MousePointerLockExtension.handler.movementX || 0;\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "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", + "functionType": "ExpressionAndCondition", + "name": "MovementY", + "private": true, + "sentence": "the movement of the pointer on the Y axis", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "\r", + "eventsFunctionContext.returnValue = gdjs._MousePointerLockExtension.handler.movementY || 0;\r", + "" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "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": [ { "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "eventsFunctionContext.returnValue = gdjs._MousePointerLockExtension.movementX || 0;", + "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 @@ -11820,20 +12267,30 @@ "expressionType": { "type": "expression" }, - "parameters": [], + "parameters": [ + { + "description": "Touch identifier", + "name": "NewTouchId", + "type": "expression" + } + ], "objectGroups": [] }, { - "description": "the movement of the pointer on the Y axis.", - "fullName": "Pointer Y movement", - "functionType": "ExpressionAndCondition", - "name": "MovementY", + "description": "Return the Y position of a specific touch", + "fullName": "Touch Y position", + "functionType": "Expression", + "name": "TouchY", "private": true, - "sentence": "the movement of the pointer on the Y axis", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": "eventsFunctionContext.returnValue = gdjs._MousePointerLockExtension.movementY || 0;", + "inlineCode": [ + "const touchId = eventsFunctionContext.getArgument(\"NewTouchId\");", + "eventsFunctionContext.returnValue = runtimeScene.getGame().getInputManager().getTouchY(touchId);", + "" + ], "parameterObjects": "", "useStrict": true, "eventsSheetExpanded": false @@ -11842,6 +12299,67 @@ "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": { + "value": "SetReturnNumber" + }, + "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": [] } @@ -12573,7 +13091,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 +14563,11 @@ "name": "JoystickIdentifier", "supplementaryInformation": "[\"Primary\",\"Secondary\"]", "type": "stringWithSelector" + }, + { + "description": "", + "name": "Coucou", + "type": "expression" } ], "objectGroups": [] @@ -14337,6 +14860,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 +15406,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "", + "name": "Parameter", + "type": "objectList" } ], "objectGroups": [] @@ -15360,18 +16005,70 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnNumber" + }, + "parameters": [ + "DeadZoneRadius" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DeadZoneRadius", + "name": "SetDeadZoneRadius", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyDeadZoneRadius" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SetDeadZone" }, "parameters": [ - "DeadZoneRadius" + "", + "ControllerIdentifier", + "JoystickIdentifier", + "Value", + "" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -15388,11 +16085,11 @@ "objectGroups": [] }, { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "DeadZoneRadius", - "name": "SetDeadZoneRadius", - "sentence": "", + "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", @@ -15400,7 +16097,7 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyDeadZoneRadius" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" }, "parameters": [ "Object", @@ -15408,18 +16105,6 @@ "=", "Value" ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SetDeadZone" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "Value", - "" - ] } ] } @@ -15435,6 +16120,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "Touch identifier", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -15609,12 +16299,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 +16639,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,6 +18933,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": [ @@ -18259,62 +19021,232 @@ "objectGroups": [] }, { - "description": "Pass the object property values to the behavior.", - "fullName": "Update configuration", - "functionType": "Action", - "name": "UpdateConfiguration", + "description": "Pass the object property values to the behavior.", + "fullName": "Update configuration", + "functionType": "Action", + "name": "UpdateConfiguration", + "private": true, + "sentence": "Update the configuration of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "ControllerIdentifier", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "JoystickIdentifier", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "DeadZoneRadius", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Show the joystick until it is released.", + "fullName": "Show and start pressing", + "functionType": "Action", + "name": "TeleportAndPress", + "sentence": "Show _PARAM0_ at the cursor position and start pressing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Object", + "=", + "Object.ParentTouchX(StartedTouchOrMouseId(0))", + "=", + "Object.ParentTouchY(StartedTouchOrMouseId(0))" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Object", + "yes", + "" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "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": "Update the configuration of _PARAM0_", + "sentence": "", "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", - "" - ] - } - ] + "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": [] @@ -19039,6 +19971,16 @@ "extraInformation": [], "hidden": true, "name": "ParentOrigin" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShouldBeHiddenWhenReleased" } ], "objects": [ @@ -29941,6 +30883,312 @@ ], "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": "mouseButton" + } + ], + "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": "mouseButton" + } + ], + "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": "mouseButton" + }, + { + "description": "Click count", + "name": "ClickCount", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] } ], "externalLayouts": [ @@ -30059,6 +31307,5 @@ "windowMask": false } } - ], - "externalSourceFiles": [] + ] } \ No newline at end of file From acfa1f3248d73aea5f1c3a7d798693669472b3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Mon, 20 Jan 2025 14:37:56 +0100 Subject: [PATCH 04/15] [3D shooting gallery] Floating joystick --- .../3d-shooting-gallery.json | 340 +++++++----------- .../assets/Line light joystick border.png | Bin 0 -> 2283 bytes .../assets/Line light joystick thumb.png | Bin 0 -> 1600 bytes .../assets/Shaded dark joystick border.png | Bin 3030 -> 0 bytes .../assets/Shaded dark joystick thumb.png | Bin 2989 -> 0 bytes 5 files changed, 136 insertions(+), 204 deletions(-) create mode 100644 examples/3d-shooting-gallery/assets/Line light joystick border.png create mode 100644 examples/3d-shooting-gallery/assets/Line light joystick thumb.png delete mode 100644 examples/3d-shooting-gallery/assets/Shaded dark joystick border.png delete mode 100644 examples/3d-shooting-gallery/assets/Shaded dark joystick thumb.png diff --git a/examples/3d-shooting-gallery/3d-shooting-gallery.json b/examples/3d-shooting-gallery/3d-shooting-gallery.json index b184bc7a7..10741c68b 100644 --- a/examples/3d-shooting-gallery/3d-shooting-gallery.json +++ b/examples/3d-shooting-gallery/3d-shooting-gallery.json @@ -476,18 +476,18 @@ "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 } @@ -541,17 +541,6 @@ "name": "Target3" } ] - }, - { - "name": "UI", - "objects": [ - { - "name": "LookJoystick" - }, - { - "name": "WalkJoystick" - } - ] } ], "variables": [ @@ -1522,24 +1511,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", @@ -1587,7 +1558,9 @@ "sidewaysDeceleration": 800, "sidewaysSpeedMax": 400, "slopeMaxAngle": 50, - "shouldBindObjectAndForwardAngle": true + "shouldBindObjectAndForwardAngle": true, + "stairHeightMax": 20, + "canBePushed": true }, { "name": "Shooter3DGamepadMapper", @@ -1722,7 +1695,8 @@ "behaviors": [ { "name": "ShakeObject_PositionAngleScale", - "type": "ShakeObject::ShakeObject_PositionAngleScale" + "type": "ShakeObject::ShakeObject_PositionAngleScale", + "Scale": "Scale" } ], "animations": [ @@ -1870,102 +1844,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", @@ -1989,7 +1867,7 @@ "sprites": [ { "hasCustomCollisionMask": false, - "image": "Shaded dark joystick border.png", + "image": "assets\\Line light joystick border.png", "points": [], "originPoint": { "name": "origine", @@ -2024,7 +1902,7 @@ "sprites": [ { "hasCustomCollisionMask": false, - "image": "Shaded dark joystick thumb.png", + "image": "assets\\Line light joystick thumb.png", "points": [], "originPoint": { "name": "origine", @@ -2126,9 +2004,6 @@ { "objectName": "Restart" }, - { - "objectName": "LookJoystick" - }, { "objectName": "WalkJoystick" } @@ -2298,6 +2173,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\")" ] } ] @@ -2376,28 +2304,12 @@ "subInstructions": [ { "type": { - "value": "BuiltinCommonInstructions::And" + "value": "DoubleClick::HasSimpleClicked" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "MouseButtonReleased" - }, - "parameters": [ - "", - "Left" - ] - }, - { - "type": { - "value": "MousePointerLock::isPointerLocked" - }, - "parameters": [ - "", - "" - ] - } + "parameters": [ + "", + "Left", + "" ] }, { @@ -3128,12 +3040,12 @@ }, { "type": { - "value": "MettreX" + "value": "SetCenterX" }, "parameters": [ "Restart", "=", - "(ScreenWidth()/2)-(Restart.Width()/2)" + "ScreenWidth() / 2" ] }, { @@ -3173,21 +3085,6 @@ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ - { - "type": { - "value": "MouseButtonPressed" - }, - "parameters": [ - "", - "Left" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - }, { "type": { "inverted": true, @@ -3197,35 +3094,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": [ + "", + "" + ] + } ] } ] @@ -3247,11 +3187,11 @@ "conditions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "r" + "\"r\"" ] } ], @@ -3357,10 +3297,6 @@ } ], "behaviorsSharedData": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior" - }, { "name": "Animation", "type": "AnimatableCapability::AnimatableBehavior" @@ -3373,10 +3309,6 @@ "name": "FirstPersonGamepadMapper", "type": "Gamepads::FirstPersonGamepadMapper" }, - { - "name": "FirstPersonMultitouchMapper", - "type": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper" - }, { "name": "FirstPersonPointerMapper", "type": "MousePointerLock::FirstPersonPointerMapper" @@ -31099,7 +31031,7 @@ "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": "mouseButton" + "type": "mouse" } ], "objectGroups": [] @@ -31143,7 +31075,7 @@ "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": "mouseButton" + "type": "mouse" } ], "objectGroups": [] @@ -31176,7 +31108,7 @@ "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": "mouseButton" + "type": "string" }, { "description": "Click count", 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 0000000000000000000000000000000000000000..a795a9e845c988a6241f7c22123ecfbaa2a4ccf3 GIT binary patch literal 2283 zcmV005u}1^@s6i_d2*00009a7bBm000XT z000XT0n*)m`~Uz5ok>JNRCwC$ozZP0HxPyeq<{cvz(5)>kOl%=1IATgqyi%q2&us7 z!0sUFz|_QMb~ zf3MHdXX>;25VCsytLksg^;?+Hi409x7b_<>C{l1FX@Lww>b+uT+|x*V-s05Y!ItRh5=M7*{MP@q3WOE)Bb zl$-V~z=nv3mcXM{vkyLNr?{ykYu6R}&9d}97p?zC(mRZzJ!>J}O2nHR>Dq``ix(de z*NBw?LzMwvDy6Y_5YG?28{dMJYQ`=1$m6*$QU8{^fn?nv!Gc>JVD)?|PXYHFW4sWq z`T6|E02Ue zu|awzpGF5&mWmZ8BA-WWTr>H3L384YlOoBdEIkuGjS9--N$A#d5gXGGCq=kpS8zbS z>5_1A!o(#XZg=|bcrqk(^Lz-7a)e3t^<%9P$X7NAvu$wI>aY*0at{+&25jk0iR083kL#te2M)))L0PZ3z8{fTlK*Dfe==(SEGV$x1!+yglJUge9nwgFSf47 z9uF`S;*RyCy~PKe&LD8-^kFe#ce!yn3^*3zQ0FEEwb5AjOVa@e(WGEGwRc0iZl&aC z4GnZv4j!17n~y4z$e&?05q)cFw)qv}8M;?jYYzRmW5X8&{?g&T@5G2h7LO=ik0R)7A00IIC2mk~G5D)+e2p}K;5D=70 zK$;N%-7o+GLO_s;fR`M}3u3_@*}FTWh?abix+VXDJ3&CiU2*pAkPEhDg0$N*?aBD{ zWg@&NFdCfur%!gLBan;+Ns`db;B-_FI|cLZa3Xs=8>tu&DFyTW@9Z`sM!ygtlRW zMcgn5>3(-D_=kqmpo$s>!PIZ{-{%Jjh#CfCsb6tx(PdaQOi~&INIhf60t!7Mf4_ACcrwrKF@zSg2+jqDPs~l(v?17U((k^}a1#!i=UdsiA zX^R-cX)?qW<9f$+y@y;es(9YLeo?C9`ihAV^r1Kr*m4XfcE`)#C zHZ0IJQ*M__)O_Cn5?(>V;>mZu$a&a$F(fRDd{L9lM=ImBjTgB3VS3Phn;2%h-F|>{`-w-a z7p{V`eDjRC6S0kWTC~}=%}+UHX610R6CG+TQmlB0 zj1DPRa@!3tk0obAvW95-Y<LBSrI{B&+1YdoyeKGvEvrkzGvtx3<|lqS+$5a*;I%<5IR;hoTwqtlYh z%ggr#(Wh;QUi{yt=xg+XP`|qL{c{+j<$F$UZ*M=2n(&ag!W3M&h=AVh=+_(r2`yA4|gfvt5HWwpcmN2KB zBAcy?@Y;y(>n=u=TB}WMoHB7i7=roq-|44 zzEApTll&HOP2e1tCO&#oWmEclI1@mlC?P7+aXQfy#7B1}M>PCR@lBuw4^e|MfoHfk zH#gr?g@Rn-QfnlQj##pG8Z6wT18b=1AlgCrNhEHqA@SpRLXeU+wfmUpSd*+6CUUS- zh8oeq##CO2tesox4}zGUF%;Gk`h(d})3Y?fc3)GV)}vEY1m{5?&as}a%@lQ7N1zYp zw34N*BV4C~+zM?0dqoReM##aXlXWL8pwf@Rmk}|XLvHj1)b^Y72i1a2tK^KX>zeJ4 zQ$jBV+YO?kv8zQsVLPo~IkRKxd{b2w$J~Lwt1Z+~J7vx{Zpr$M8RF*0YCiE-^D1VD z#r{_DjK_ebvp$6FI~M)OX2ys(oynI~J>%AgXi|1SI;33GK4w3#s}0e*zuAA;6*KG{ zsw}u$-CuT{U{{=@%Z}!NWy=z~gpAgIQo>D+u{yeogeU_n0+P*$cMPCKqAmrv{T3by z5l;z>k_6=rop&Yb>>GlnhKOqjBm2&KFaxwe#8W!ZA@d&008J3_9HH@p8K4a!o*Oj2 z@(kr_TPLg$BAyd8zQTY$VW?J!cn;8bT9E6_0L>6_?a+9R8?Eeou|!NBCsZlMjd_!` z=2FDmig5`UfSRt-lhN6aw zlX1WmbR2`FnAA-k7A0(oH6t3 zt3(`bm*~jxaiiHW!|i=}`Sf(6sUh)j-J+WF`4eTyW5Y9UwKr~;mwGN78R|MG&@VKX zOMO=N3L{r=g^HMzX0x;>yz4IEUY9VWHc2jR&~%+SC4Aj&+GX)&4yk-9 zt$=^>W!Bl=CtnvS`4|DolVAqM2GNm7xukthcy$p@Xh!hcw>?Byf+2{%`!WU3Vhor( znmM}~zG>8i_k^uem!D|CoVBla84Cy2;v2HI@d3lv8Klr>8bY)(npxppM^E%7$6Yey yw8>mGnH6Xl#=@9c#PFI;7KqrUC%fmpNBalqHfIWG#59}$0000005u}1^@s6i_d2*00009a7bBm000XT z000XT0n*)m`~Uz8h)G02RCwC$o%?axOcce{K}yI>8t`QDcH)r4CQcmNIPX6xff6Wz z5-5QZC_yDq0ww6XM}zXo*LQ`4R$?WcojEfeBVe`r<34t;q$py$*M9&0J=$sZ=g*%x z^!M-I^&!gMkI%|Jmm|!Uw(sA+pZxmuYa#+5YtdGqN!pM=xxshhyU~ZMtE`9OLBR6nQAl|9i;62_$+*;093nw@)=v4E8TPe zE>{mc#spyqtzkn}55IE6K!k0-Mcfx7;)jm-noBG4OO&h?TTF>dSQkUQ z6XImQfB!yJhu-@YgdrGAO`@FaqUaZi>^9_B4=z{3mnl?tT*ey0ARrd+ zJABI`mm6xVR|dW=KnRJuEp*AfgfL4sB-2eSVfi5Rtuyp*AADVb5H49jOI-7DcXv1M z8+@_rWU;Q-h2<4&^OXe<3jLh$gFU*{q0raQ*3 z$2uXz9(^j6>Wg3yTo86HF#&wYYPC=x`tIF3PI$m^t~GB^XCM^F7KE>#5Z>I}OhS+O zrmoKSy;!twF`;W7gDr5yuY>UQA42hD+u$HXhtM&?Hy8*v!4xo{Ba_Jl)wYQi_H{Xt z-4?FQv*uRjd>sUU=!n%plu~g5`*9%@c1)}}zP-I&92Gw4z})H>I?T!I7lf#?w&wb1 znX!EF$YGjUI^RQK3C)5~{lY&p&kNUb(De>ir>CbW1DXpYsb1lepmS<`Nzm8A zQtb%08n)Q@`t_@y8zDV=_Uw^Zzm4$)oB-+SU(id|C)TIp~y5NGw)rSwVU8Mt>k4CBOlvEMK8DhZ!RaUsqqvq%O`g&UmK=I*I{bttsQB{SSLCq1^DwBMy^&5F7E9#IvV#AOX z7bys6k1hAh2g6WRl|48|3n5-n_B+GIa$c z`e2A_e^ebeY%yg5czJm_(Fd~TkMdEruekziR{Xcn2f~DM5UD!Cwc>_hTUY?bSi8xK z_j0CuY|Uw|z}kcOPanj`qf)-=1TD7i0XQCyNBRKXUXAj(H>~*rbNTJJxjumLALVm7 zM)L*c^6}qF9}xP31F3EmCm3m4y+lO6$m$oWiSK9miN;Q#)7@VD?8L)nV*M3kGHcB&K{Q{ruLHQP#(wwE4u$aL)_I&eV1q|g| zU`lfa_E3bd)-NyvrkcovHD_Rt08-%r$P#?2iP}IDK>bhF08&ks=xZShPPFP&K5(G> zU)@sYwjEmD07RC9%Qxx1`|UAH*WoeixT!^Lz+|jR1&BhpbZsa5w-$ zRV$`S0a&FF759tDcZdKE3qYvKJ%hm30|4<)twZ4>fWrf@3WOGG2LYG`qXduuW-7CJ z;SE4stc1;F0!RQMuu$d#Hg5nHK}Z0H1z=hDyaVWhkN^$`z$)-L0lc`lSfc_uuPTel z8bSg%3;?Ub2c|S}9uSd+;I$jq-hAy4JsY!w8+Revy^Ul+Q|P!^_6`2h^-! zBJ<*cGUZEH*3*0mbIUw{bA14pVkn;(u;wexfU|~dL?6IRnDQlT-x++3?%gL^AHYnQ z^0j?uv1L7|FxCe#5utn}AV&NbKLAkt^a3}N&Wn4(l#c{Na|PBO04P3rq7P&oNcq?S z(OjLKosGamRC`AZsTDwRrJ8>l|GoaYNLF*Uohqb5Nk7rzvf_4-rVoK^*`OP zIc!~aM>k9zvixGP^sfNH)x_e(hg@__QTs086t>pUz9xQqX1tMuN>$!|Gj8EA-3uVH zVTbADz*40bpDl*KR#c`TQ>k+oB#PI67+!Q4m2Fs*Mh2tBWP~bvjkuP%_*~S4;*Iek z9As*5@}ao_OHtJ(E_bd!h{*_bi1jO#d|1hdkh|3%#w8i5aqCAbNO`n=vx5Q5tRSGv zi&l`bte@rt?37-5DX@YI{lO43Vk&R_EJol#qq@yy1(^|3`KlMg`fX}kzkDoc5zgHa z3cDT->o<*jHJ26S?g)il56k*RzMELP3BF8=7cLD~NJcFtD(`w!*d1BxFM}0iLNd(6 z!-7wESVm1X6caj#=cEiU@i5@qK6&!wQPgA;vpb_Jrt7sBK$sS_(S-Ea>HuBwFtXm( zU9aVeVS=^jiu)h;Ip)22*K4_At25lD>-Tn>1He&qj3%(HtPU|A>}TBPFgWw*SPf=Z zIbm9atfYm`JCH=U)hBdb^Jgvult|lFwB0kV!JlOrD!!fU0 z7@jDkCcl(9A?!bVP;2XbRhz^LOG4NW_%LVIT*BK$Avb|=?ShaoVK-tvm*sm&$a*x7EU;mboPzoZye&k`XF)AG6IOJ3^^e998831PS4lX+T1U2gdG5W;T4 z7kt9u143@w9XICdJ$!^P%w?8A!Iy^+CvJ&*$L+%BQg7kQZ`;XE7>qm z;+9ustl^Ni^GaGgTD>M?!y$rL7Cgp!{@n6BgKVFM0AC4hpFe*-AvvCxYy`w*SrGdK zV}*0x;>SvN+iC*vEJNRt54zcoHIx=1R_rp2(*GFHaVez-iHlgq8C+N3 zz#)rWp|8wj`|qk}I}5o!qFY@fWY}##(zOm9%AMPuLx2N8ZNaQZHJj z8a|M^rCz?T>b+On>sYMAxApb)iH(ho^otiS3eTTE|K^65FJIcgZwYDqH)b~Pn>9>%qCuin+Pi_E7tPzvNbxf@mT)ahu9+J7SRPuEqJbn7qx_|$E;DoyY0?*CO*|iL&%S{9! z#32==TU|juRr>-FUk3RSTmX6)+q8sH(wjvpm9h%~%w7W#${imyQHlBvasgEUDFXIC ze*D-ber#;4Jg8_LN)KB{k6WB`Ri z!TR#$OAW9O5lxuarSRHOgvfjX$S1pBMuUb65C!?T1}9$v4XiM)4WKdSqm!P1e2I3D55VC%k&k0h-iwPlItjXOXOB#er3wH6t+xEBDHKqrFlo>bUpN=66p;XDTmU(E0`p^_2iinj1catdkxxW_LyHqo1%T->B)bDcpQ(=GpO5 z=`TwGqzLF0Gz5Et8k$OYcE~9GXyvH_08rMD>m3*Y{bqayp0=Zos>>O|CshE9y&4kz z0rOh zY*hdZZW!`{0onwbsqu%Z11>`VRfL(D8AD!xz?@T61T2%f2tOtHstAU(V1e0!e36J9 zj*_iUa{!JD<;&R1wGol`jNPMeuU6j~_qQ%}&EU_>W!| zz|V89t*sULV)7aRqzH{pgpq%@`I)^+zTfA@S~+3&aqobqissI3NnjtM%pgWqUUt3*W{UbI!JUnj%2pr`3aFNU9N?ZU6UDqMN076ln2nN9c9dSGxB)EqFadHs*@`px% zP*CD2IX5;oPKo<|2+%h+HnyYw!3Yp6$o`jjUQ}um>=XBw?Wrj@Z{D2Yf8vhWpmmV5 zE%Cgl6cz2L(?hRQL*dkj5Io4gmUPK!6N$vHssIDjAo~;E+K3P=DAFnN48df6ejxf( z1?Ynrk|C23AUG^9FPC_l=1eAoiMesUL?8h(#6{p8bq3x++!ZxxnkzSM+!!Igf8qiR zj*pM;s*MLJf+4dtP)RTHT-j734v6b(x@BVVfq{XM+1c3&7s1qmmP-GzE?4%QJ9lP? z>nlzRB@@yaa}f-wO_%;-p0IpnW#x!C9@3egi)aYW82#5=1k?gPd&0mGC0*8dvMyUN z^=^yhp-ggea`HeYf^G_nK`p4DR?+a{S>r|NPa@)MlrCZrzJMa43Ks#U$dK#~iu;ds zsr!ZPzwRYr$|WcTUm%CmcrDdTwr^9+fJ*~M$>bwdw&9nvMxqQK71 zPTlM@?8EB*sPBaYDCypxKrP-=VR~HS{ze;|MiOlU85Ol#1T<*e=4VEEFJ$+NR2!@O z{Ru>Vg)B!_l>WHi%SzKo z7o+<8f)k>%PA7s4PosG7MpMKiBLA;!He1!b#Db20733%Um>$0M30rp2O4f-$wc(g2 z{RkTB#8?g-3;X(TxVrZz0OWLKyg%fn#oO!_7bkBh0y(B?SOnmqou-K6SeWD!!6n`M z6BzkPx86>_Tfe*rIhn6cA|OPil2Q$k2s`|g^kRTZ*uXy7wmlirGoZxjtcT zgYsf-J^>=2br`lu2pb?DC13ac1dy*d+?M10&_oasQWYkN=cDU%hWc5-9kQ@lpL(oy0GRbAG2391=tq|*`Pt0D|J znIs1h@VSVE3-n;ss7c2)K|CO@&l8qQ;^|n0{F!QUhB}G-y2hF`NmLttG!j9qFf2g~ z_=zyZK*t#X8!tl3y5DdS=(j(Z$qA*A6-tC8`;e$MoHr6dorMQqfe;pgz-P27ikgHF z=aCIWZu@m2(C^Ntrlxk7$r+4w$yQ^MWWxqV^u@Y(i_3u> z6~adx$eDO;5}`upJzzFIsq|*XV?DI>>x94*82AY+lOi$B!xn*lb57^khkX|#RyyMQ zV?DfG5i Date: Tue, 21 Jan 2025 11:52:12 +0100 Subject: [PATCH 05/15] [Conviction of gun dude] Floating joystick --- .../conviction-of-gun-dude-desktop.json | 292 +- .../conviction-of-gun-dude-mobile.json | 31932 +++++++++++----- 2 files changed, 22825 insertions(+), 9399 deletions(-) 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/conviction-of-gun-dude-mobile.json b/examples/conviction-of-gun-dude-mobile/conviction-of-gun-dude-mobile.json index 6bcfd970a..3cfe66e90 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,7 +1177,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/HealthbarBorder.png", "kind": "image", "metadata": "", @@ -1303,6 +1188,9 @@ "resourceFolders": [] }, "objects": [], + "objectsFolderStructure": { + "folderName": "__ROOT" + }, "objectsGroups": [], "variables": [], "layouts": [ @@ -1417,7 +1305,6 @@ "italic": false, "name": "Reset_Timer", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -1449,6 +1336,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 +1365,6 @@ "italic": false, "name": "Reset_Button", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -1489,9 +1396,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 +1512,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 +1586,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 +1807,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 +1859,7 @@ "gridColor": 10401023, "gridAlpha": 0.8, "snap": true, - "zoomFactor": 1.169999999999991, + "zoomFactor": 0.7354329019769376, "windowMask": false }, "objectsGroups": [ @@ -2470,13 +2413,118 @@ "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": 128, + "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": 128, + "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": 128, + "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": 128, + "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": 128, + "zOrder": 52, + "numberProperties": [ + { + "name": "animation", + "value": 4 + } + ], + "stringProperties": [], + "initialVariables": [] } ], "objects": [ { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "RoomTraps", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -2822,9 +2870,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "RoomDoors", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -3896,9 +3944,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "RoomFloor", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -4774,9 +4822,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Room", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -5598,9 +5646,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Wesley", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -5986,9 +6034,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Gun", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [], @@ -6033,7 +6081,8 @@ }, { "name": "ShakeObject_PositionAngleScale", - "type": "ShakeObject::ShakeObject_PositionAngleScale" + "type": "ShakeObject::ShakeObject_PositionAngleScale", + "Scale": "Scale" } ], "animations": [ @@ -6098,9 +6147,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Imp", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -6128,7 +6177,8 @@ }, { "name": "ShakeObject_PositionAngleScale", - "type": "ShakeObject::ShakeObject_PositionAngleScale" + "type": "ShakeObject::ShakeObject_PositionAngleScale", + "Scale": "Scale" } ], "animations": [ @@ -7171,9 +7221,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Spider", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -7201,7 +7251,8 @@ }, { "name": "ShakeObject_PositionAngleScale", - "type": "ShakeObject::ShakeObject_PositionAngleScale" + "type": "ShakeObject::ShakeObject_PositionAngleScale", + "Scale": "Scale" } ], "animations": [ @@ -8096,9 +8147,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Ghost", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [ @@ -8126,7 +8177,8 @@ }, { "name": "ShakeObject_PositionAngleScale", - "type": "ShakeObject::ShakeObject_PositionAngleScale" + "type": "ShakeObject::ShakeObject_PositionAngleScale", + "Scale": "Scale" } ], "animations": [ @@ -8895,9 +8947,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "GhostOrb", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [], @@ -8981,9 +9033,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Bullet", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [], @@ -9059,7 +9111,6 @@ "italic": false, "name": "UpgradeText", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -9073,6 +9124,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 +9153,6 @@ "italic": false, "name": "EnemyDamageText", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -9095,6 +9166,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 +9198,7 @@ "emitterForceMax": 0, "emitterForceMin": 0, "flow": 50, + "jumpForwardInTimeOnCreation": 0, "maxParticleNb": 300, "name": "Particle_RecoilDust", "particleAlpha1": 150, @@ -9118,6 +9211,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 33, "particleBlue2": 255, + "particleColor1": "126;211;33", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": -10, "particleGreen1": 211, @@ -9133,7 +9228,6 @@ "rendererParam1": 2, "rendererParam2": 1, "rendererType": "Point", - "tags": "", "tank": 2, "textureParticleName": "", "type": "ParticleSystem::ParticleEmitter", @@ -9151,6 +9245,7 @@ "emitterForceMax": 0, "emitterForceMin": 0, "flow": 50, + "jumpForwardInTimeOnCreation": 0, "maxParticleNb": 300, "name": "Particle_Dash", "particleAlpha1": 150, @@ -9163,6 +9258,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 211, "particleBlue2": 255, + "particleColor1": "143;174;211", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": -10, "particleGreen1": 174, @@ -9178,7 +9275,6 @@ "rendererParam1": 3, "rendererParam2": 1, "rendererType": "Point", - "tags": "", "tank": 12, "textureParticleName": "", "type": "ParticleSystem::ParticleEmitter", @@ -9196,6 +9292,7 @@ "emitterForceMax": 0, "emitterForceMin": 0, "flow": 45, + "jumpForwardInTimeOnCreation": 0, "maxParticleNb": 300, "name": "Particle_Death", "particleAlpha1": 255, @@ -9208,6 +9305,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 255, "particleBlue2": 255, + "particleColor1": "255;255;255", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": -10, "particleGreen1": 255, @@ -9223,7 +9322,6 @@ "rendererParam1": 3, "rendererParam2": 1, "rendererType": "Quad", - "tags": "", "tank": 1, "textureParticleName": "WesleyDeathParticle.png", "type": "ParticleSystem::ParticleEmitter", @@ -9235,11 +9333,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 +9396,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 +9427,6 @@ "italic": false, "name": "Debug", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -9318,12 +9440,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 +9487,8 @@ "behaviors": [ { "name": "ShakeObject_PositionAngleScale", - "type": "ShakeObject::ShakeObject_PositionAngleScale" + "type": "ShakeObject::ShakeObject_PositionAngleScale", + "Scale": "Scale" } ], "animations": [ @@ -9591,9 +9735,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "Upgrades", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [], @@ -9623,7 +9767,8 @@ "behaviors": [ { "name": "ShakeObject_PositionAngleScale", - "type": "ShakeObject::ShakeObject_PositionAngleScale" + "type": "ShakeObject::ShakeObject_PositionAngleScale", + "Scale": "Scale" } ], "animations": [ @@ -9875,7 +10020,6 @@ "italic": false, "name": "TotalPointsCount", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -9894,6 +10038,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 +10067,6 @@ "italic": false, "name": "TotalPoints", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -9921,6 +10085,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 +10114,6 @@ "italic": false, "name": "DangerLevelCount", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -9948,6 +10132,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 +10161,6 @@ "italic": false, "name": "DangerLevel", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -9975,12 +10179,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 +10293,6 @@ "italic": false, "name": "Reset_Timer", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -10100,6 +10324,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 +10353,6 @@ "italic": true, "name": "Leaderboard_Submit", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -10140,6 +10384,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 +10413,6 @@ "italic": true, "name": "Reset_Leaderboard", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -10180,6 +10444,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 +10473,6 @@ "italic": false, "name": "Reset_Button", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -10220,12 +10504,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 +10571,6 @@ { "assetStoreId": "", "name": "LeaderboardName_Input", - "tags": "", "type": "TextInput::TextInputObject", "variables": [], "effects": [], @@ -10293,7 +10597,6 @@ "italic": false, "name": "Pause_Text", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -10307,6 +10610,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 +10639,6 @@ "italic": false, "name": "Upgrade_Text", "smoothed": true, - "tags": "", "type": "TextObject::Text", "underlined": false, "variables": [], @@ -10329,12 +10652,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 +10693,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 +10738,9 @@ ] }, { + "adaptCollisionMaskAutomatically": false, "assetStoreId": "", "name": "MobileCovering", - "tags": "", "type": "Sprite", "updateIfNotVisible": false, "variables": [], @@ -10427,7 +10781,6 @@ { "assetStoreId": "", "name": "MovementJoystick", - "tags": "", "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "variables": [], "effects": [], @@ -10435,6 +10788,7 @@ "content": {}, "childrenContent": { "Border": { + "adaptCollisionMaskAutomatically": false, "updateIfNotVisible": false, "animations": [ { @@ -10469,6 +10823,7 @@ ] }, "Thumb": { + "adaptCollisionMaskAutomatically": false, "updateIfNotVisible": false, "animations": [ { @@ -10507,7 +10862,6 @@ { "assetStoreId": "", "name": "AimingJoystick", - "tags": "", "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "variables": [], "effects": [], @@ -10528,6 +10882,7 @@ }, "childrenContent": { "Border": { + "adaptCollisionMaskAutomatically": false, "updateIfNotVisible": false, "animations": [ { @@ -10562,6 +10917,7 @@ ] }, "Thumb": { + "adaptCollisionMaskAutomatically": false, "updateIfNotVisible": false, "animations": [ { @@ -10598,6 +10954,122 @@ } } ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "RoomTraps" + }, + { + "objectName": "RoomDoors" + }, + { + "objectName": "RoomFloor" + }, + { + "objectName": "Room" + }, + { + "objectName": "Wesley" + }, + { + "objectName": "Gun" + }, + { + "objectName": "Imp" + }, + { + "objectName": "Spider" + }, + { + "objectName": "Ghost" + }, + { + "objectName": "GhostOrb" + }, + { + "objectName": "Bullet" + }, + { + "objectName": "UpgradeText" + }, + { + "objectName": "EnemyDamageText" + }, + { + "objectName": "Particle_RecoilDust" + }, + { + "objectName": "Particle_Dash" + }, + { + "objectName": "Particle_Death" + }, + { + "objectName": "HealthBar" + }, + { + "objectName": "Debug" + }, + { + "objectName": "UpgradeIcons" + }, + { + "objectName": "Upgrades" + }, + { + "objectName": "TotalPointsCount" + }, + { + "objectName": "TotalPoints" + }, + { + "objectName": "DangerLevelCount" + }, + { + "objectName": "DangerLevel" + }, + { + "objectName": "Pick_Ups" + }, + { + "objectName": "Reset_Timer" + }, + { + "objectName": "Leaderboard_Submit" + }, + { + "objectName": "Reset_Leaderboard" + }, + { + "objectName": "Reset_Button" + }, + { + "objectName": "Darkening" + }, + { + "objectName": "LeaderboardName_Input" + }, + { + "objectName": "Pause_Text" + }, + { + "objectName": "Upgrade_Text" + }, + { + "objectName": "HelpIcon" + }, + { + "objectName": "MobileCovering" + }, + { + "objectName": "MovementJoystick" + }, + { + "objectName": "AimingJoystick" + } + ] + }, "events": [ { "colorB": 228, @@ -10656,8 +11128,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 +11182,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 +11237,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 +11374,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 +11424,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 +11515,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 +11545,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 +11609,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 +11670,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 +11698,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 +11840,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 +11917,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 +11987,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 +12057,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 +12127,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 +12197,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 +12293,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 +12353,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 +12451,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 +12489,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 +12537,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 +12666,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 +12860,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 +13036,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 +13068,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 +13108,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 +13336,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 +13422,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 +13451,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 +13479,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 +13508,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 +13549,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 +13587,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 +13626,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 +13668,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 +13721,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 +13826,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 +13903,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 +13965,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 +14008,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 +14057,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 +14095,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 +14145,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 +14193,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 +14241,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 +14297,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 +14338,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 +14395,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 +14446,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 +14543,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 +14571,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 +14665,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 +14868,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 +14909,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 +14986,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 +15137,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 +15235,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 +15299,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 +15347,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 +15404,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 +15453,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 +15498,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 +15556,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 +15647,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 +15692,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 +15854,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 +15907,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 +15946,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 +15991,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 +16039,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 +16159,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 +16204,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 +16356,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 +16409,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 +16448,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 +16508,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 +16565,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 +16655,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 +16700,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 +16843,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 +16896,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 +17065,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 +17125,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 +17169,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 +17220,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 +17248,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 +17298,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 +17333,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 +17361,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 +17516,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 +17553,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 +17628,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 +17850,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 +17948,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 +18005,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 +18051,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 +18118,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 +18244,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 +18399,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 +18623,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 +18651,15 @@ "ambientLightColorB": 11412152, "ambientLightColorG": 6040208, "ambientLightColorR": 11290968, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", "followBaseLayerCamera": false, "isLightingLayer": false, + "isLocked": false, "name": "MobileCovering", + "renderingType": "", "visibility": true, "cameras": [], "effects": [] @@ -18165,9 +18668,15 @@ "ambientLightColorB": -2147483632, "ambientLightColorG": 6040208, "ambientLightColorR": 11290968, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 0.1, + "cameraType": "perspective", "followBaseLayerCamera": false, "isLightingLayer": false, + "isLocked": false, "name": "MobileControls", + "renderingType": "", "visibility": true, "cameras": [], "effects": [] @@ -18176,9 +18685,15 @@ "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": [] @@ -18187,9 +18702,15 @@ "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": [] @@ -18198,9 +18719,15 @@ "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 +18736,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 +18755,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 +18775,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 +18802,10 @@ { "name": "ShakeObject_PositionAngleScale", "type": "ShakeObject::ShakeObject_PositionAngleScale" + }, + { + "name": "Text", + "type": "TextContainerCapability::TextContainerBehavior" } ] }, @@ -18271,6 +18836,9 @@ "variables": [], "instances": [], "objects": [], + "objectsFolderStructure": { + "folderName": "__ROOT" + }, "events": [ { "type": "BuiltinCommonInstructions::Comment", @@ -18282,8 +18850,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 +18880,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 +18915,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 +18958,8 @@ "gqDaZjCfevOOxBYkK6zlhtZnXCg1" ], "dependencies": [], + "globalVariables": [], + "sceneVariables": [], "eventsFunctions": [], "eventsBasedBehaviors": [ { @@ -18433,7 +18995,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyStartingAmmo()" + "StartingAmmo" ] }, { @@ -18444,7 +19006,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -18490,8 +19052,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 +19067,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 +19131,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 +19165,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 +19221,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 +19249,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 +19295,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 +19306,7 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Reload gun when needed", + "name": "Reload", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ @@ -18875,8 +19320,7 @@ "textG": 0, "textR": 0 }, - "comment": "Detect when reload is completed", - "comment2": "" + "comment": "Detect when reload is completed" }, { "type": "BuiltinCommonInstructions::Standard", @@ -18899,7 +19343,7 @@ "Object", "\"__FireBullet.ReloadingTimer\"", ">=", - "Object.Behavior::PropertyReloadDuration()" + "ReloadDuration" ] } ], @@ -18950,7 +19394,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -18965,8 +19409,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 +19435,7 @@ "Object", "Behavior", "=", - "min(Object.Behavior::PropertyShotsPerReload(), Object.Behavior::PropertyAmmoQuantity())" + "min(ShotsPerReload, AmmoQuantity)" ] } ] @@ -19007,7 +19450,7 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Reduce heat level (based on cooling rate)", + "name": "Cooling", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ @@ -19019,7 +19462,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "Object.Behavior::HeatLevel()", + "HeatLevel", ">", "0" ] @@ -19051,7 +19494,7 @@ "Object", "Behavior", "=", - "max(0, Object.Behavior::PropertyHeatLevel() - TimeDelta() * Object.Behavior::PropertyExponentialCoolingRate() * Object.Behavior::PropertyHeatLevel())" + "max(0, HeatLevel - TimeDelta() * ExponentialCoolingRate * HeatLevel)" ] } ] @@ -19080,7 +19523,7 @@ "Object", "Behavior", "=", - "max(0, Object.Behavior::PropertyHeatLevel() - TimeDelta() * Object.Behavior::PropertyLinearCoolingRate())" + "max(0, HeatLevel - TimeDelta() * LinearCoolingRate)" ] } ] @@ -19106,6 +19549,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 +19626,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 +19672,7 @@ { "description": "The bullet object", "name": "Bullet", - "type": "objectList" + "type": "objectListOrEmptyIfJustDeclared" }, { "description": "Target X position", @@ -19200,136 +19700,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 +19866,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 +19889,23 @@ ] } ], - "parameters": [] + "variables": [ + { + "folded": true, + "name": "MultiShotAngle", + "type": "number", + "value": 0 + }, + { + "name": "BulletIndex", + "type": "number", + "value": 0 + } + ] } ] } - ], - "parameters": [] + ] } ], "parameters": [ @@ -19428,7 +19933,7 @@ { "description": "The bullet object", "name": "Bullet", - "type": "objectList" + "type": "objectListOrEmptyIfJustDeclared" }, { "description": "Angle of the bullet, in degrees", @@ -19471,8 +19976,7 @@ "textG": 0, "textR": 0 }, - "comment": "Create bullet", - "comment2": "" + "comment": "Create bullet" }, { "type": "BuiltinCommonInstructions::Standard", @@ -19485,9 +19989,9 @@ "parameters": [ "", "Bullet", - "GetArgumentAsNumber(\"XPosition\")", - "GetArgumentAsNumber(\"YPosition\")", - "Object.Behavior::PropertyBulletLayer()" + "XPosition", + "YPosition", + "BulletLayer" ] } ], @@ -19502,8 +20006,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 +20020,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Angle\") + RandomInRange(-Object.Behavior::PropertyAngleVariance(), Object.Behavior::PropertyAngleVariance())" + "Angle + RandomInRange(-AngleVariance, AngleVariance)" ] }, { @@ -19526,8 +20029,8 @@ }, "parameters": [ "Bullet", - "Object.Behavior::PropertyRandomizedAngle()", - "GetArgumentAsNumber(\"Speed\") + RandomInRange(-Object.Behavior::PropertyBulletSpeedVariance(), Object.Behavior::PropertyBulletSpeedVariance())", + "RandomizedAngle", + "Speed + RandomInRange(-BulletSpeedVariance, BulletSpeedVariance)", "1" ] } @@ -19543,60 +20046,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 +20069,7 @@ "parameters": [ "Bullet", "=", - "Object.Behavior::PropertyRandomizedAngle()" + "RandomizedAngle" ] } ] @@ -19636,8 +20086,7 @@ "textG": 0, "textR": 0 }, - "comment": "Update statistics", - "comment2": "" + "comment": "Update statistics" }, { "type": "BuiltinCommonInstructions::Standard", @@ -19685,7 +20134,7 @@ { "description": "The bullet object", "name": "Bullet", - "type": "objectList" + "type": "objectListOrEmptyIfJustDeclared" }, { "description": "Angle of the bullet, in degrees", @@ -19768,20 +20217,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 +20322,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFiringArc()" + "FiringArc" ] } ] @@ -19930,7 +20365,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -19977,7 +20412,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -20021,7 +20456,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAngleVariance()" + "AngleVariance" ] } ] @@ -20064,7 +20499,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -20111,7 +20546,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -20155,7 +20590,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBulletSpeedVariance()" + "BulletSpeedVariance" ] } ] @@ -20198,7 +20633,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -20245,7 +20680,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -20289,7 +20724,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBulletQuantity()" + "BulletQuantity" ] } ] @@ -20332,7 +20767,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -20379,7 +20814,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -20426,7 +20861,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -20469,7 +20904,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"RotateBullet\"" + "\"Value\"" ] } ], @@ -20494,7 +20929,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"RotateBullet\"" + "\"Value\"" ] } ], @@ -20527,7 +20962,7 @@ { "defaultValue": "yes", "description": "Rotate bullet to match trajetory", - "name": "RotateBullet", + "name": "Value", "optional": true, "type": "yesorno" } @@ -20551,7 +20986,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"UnlimitedAmmo\"" + "\"Value\"" ] } ], @@ -20576,7 +21011,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"UnlimitedAmmo\"" + "\"Value\"" ] } ], @@ -20609,7 +21044,7 @@ { "defaultValue": "yes", "description": "Unlimited ammo", - "name": "UnlimitedAmmo", + "name": "Value", "optional": true, "type": "yesorno" } @@ -20633,7 +21068,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFireCooldown()" + "FireCooldown" ] } ] @@ -20676,7 +21111,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -20723,7 +21158,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"NewCooldown\")", + "Value", "" ] } @@ -20744,7 +21179,7 @@ }, { "description": "Cooldown in seconds", - "name": "NewCooldown", + "name": "Value", "type": "expression" } ], @@ -20767,7 +21202,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyReloadDuration()" + "ReloadDuration" ] } ] @@ -20810,7 +21245,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -20857,7 +21292,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -20901,7 +21336,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyOverheatDuration()" + "OverheatDuration" ] } ] @@ -20944,7 +21379,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -20991,7 +21426,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -21035,7 +21470,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAmmoQuantity()" + "AmmoQuantity" ] } ] @@ -21078,7 +21513,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "max(0, Value)" ] } ] @@ -21125,7 +21560,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "max(0, Value)", "" ] } @@ -21169,7 +21604,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHeatIncreasePerShot()" + "HeatIncreasePerShot" ] } ] @@ -21212,7 +21647,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -21259,7 +21694,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -21303,7 +21738,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxAmmo()" + "MaxAmmo" ] } ] @@ -21346,7 +21781,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -21375,7 +21810,7 @@ "Object", "Behavior", "=", - "min(Object.Behavior::MaxAmmo(),Object.Behavior::AmmoQuantity())" + "min(MaxAmmo, AmmoQuantity)" ] } ] @@ -21422,7 +21857,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -21589,7 +22024,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -21632,7 +22067,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -21648,7 +22083,7 @@ "Object", "Behavior", ">", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ], @@ -21661,7 +22096,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -21708,7 +22143,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -21824,7 +22259,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyLinearCoolingRate()" + "LinearCoolingRate" ] } ] @@ -21867,7 +22302,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -21914,7 +22349,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -21958,7 +22393,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyExponentialCoolingRate()" + "ExponentialCoolingRate" ] } ] @@ -22001,7 +22436,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22049,7 +22484,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -22096,7 +22531,7 @@ "Object", "Behavior", "+", - "GetArgumentAsNumber(\"AmmoGained\")" + "AmmoGained" ] } ] @@ -22111,8 +22546,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 +22572,7 @@ "Object", "Behavior", "=", - "min(Object.Behavior::MaxAmmo(),Object.Behavior::AmmoQuantity())" + "min(MaxAmmo, AmmoQuantity)" ] } ] @@ -22217,7 +22651,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyBulletLayer()" + "BulletLayer" ] } ] @@ -22258,7 +22692,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "min(1,Object.Behavior::PropertyHeatLevel())" + "min(1, HeatLevel)" ] } ] @@ -22299,7 +22733,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTotalShotsFired()" + "TotalShotsFired" ] } ] @@ -22340,7 +22774,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTotalBulletsCreated()" + "TotalBulletsCreated" ] } ] @@ -22381,7 +22815,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTotalReloadsCompleted()" + "TotalReloadsCompleted" ] } ] @@ -22422,7 +22856,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShotsBeforeNextReload()" + "ShotsBeforeNextReload" ] } ] @@ -22463,7 +22897,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::Cooldown() - Object.ObjectTimerElapsedTime(\"__FireBullet.FiringCooldown\"))" + "max(0, FireCooldown - Object.ObjectTimerElapsedTime(\"__FireBullet.FiringCooldown\"))" ] } ] @@ -22516,7 +22950,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 +23398,7 @@ "parameters": [ "Object", "Behavior", - "=", + "<=", "0" ] } @@ -22975,8 +23462,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 +23669,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 +23684,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 +23701,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 +23717,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 +23748,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 +23759,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 +23772,7 @@ "description": "", "group": "Ammo", "extraInformation": [], - "hidden": false, + "advanced": true, "name": "MaxAmmo" }, { @@ -23319,7 +23812,7 @@ "description": "", "group": "Ammo", "extraInformation": [], - "hidden": false, + "advanced": true, "name": "StartingAmmo" }, { @@ -23339,7 +23832,7 @@ "description": "", "group": "Ammo", "extraInformation": [], - "hidden": false, + "advanced": true, "name": "UnlimitedAmmo" }, { @@ -23355,11 +23848,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 +23872,7 @@ "description": "", "group": "Reload", "extraInformation": [], - "hidden": false, + "advanced": true, "name": "AutomaticReloading" }, { @@ -23387,10 +23880,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 +23893,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 +23928,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 +23945,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 +23967,10 @@ "touchscreen", "twin stick", "shooter", - "virtual" + "virtual", + "platformer", + "platform", + "top-down" ], "authorIds": [ "gqDaZjCfevOOxBYkK6zlhtZnXCg1", @@ -23494,7 +23979,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 +24444,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Pressed\"" ] @@ -23555,10 +24492,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Released\"" ] @@ -23605,12 +24542,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 +24587,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 +24635,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone" ] } ] @@ -23738,7 +24675,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 4 / 360), 4)" + "mod(round(Angle * 4 / 360), 4)" ] } ] @@ -23773,7 +24710,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 8 / 360), 8)" + "mod(round(Angle * 8 / 360), 8)" ] } ] @@ -23807,7 +24744,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -23820,7 +24757,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -23844,7 +24781,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -23857,7 +24794,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -23881,7 +24818,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -23894,7 +24831,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -23918,7 +24855,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -23931,7 +24868,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -23979,7 +24916,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -23992,7 +24929,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24016,7 +24953,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownRight\"" ] @@ -24029,7 +24966,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24053,7 +24990,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -24066,7 +25003,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24090,7 +25027,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownLeft\"" ] @@ -24103,7 +25040,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24127,7 +25064,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -24140,7 +25077,7 @@ "", "=", "4", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24164,7 +25101,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpLeft\"" ] @@ -24177,7 +25114,7 @@ "", "=", "5", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24201,7 +25138,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -24214,7 +25151,7 @@ "", "=", "6", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24238,7 +25175,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpRight\"" ] @@ -24251,7 +25188,7 @@ "", "=", "7", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -24300,8 +25237,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 +25249,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -24325,8 +25261,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -24381,8 +25317,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 +25329,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -24406,8 +25341,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -24447,9 +25382,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 +25397,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Force)" + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -24481,6 +25417,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 +25480,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 +25512,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 +25527,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 +25605,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 +25634,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 +25957,6 @@ "Behavior", "" ] - }, - { - "type": { - "value": "DebuggerTools::ConsoleLog" - }, - "parameters": [ - "\"Resumed!!!\"", - "", - "" - ] } ] }, @@ -24812,8 +26021,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 +26035,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] } ] @@ -24862,8 +26071,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 +26082,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -24926,8 +26134,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 +26146,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 +26172,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 +26187,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickForce()" + "max(0, JoystickForce - DeadZoneRadius) / (1 - DeadZoneRadius)" ] } ] @@ -25023,7 +26231,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -25032,9 +26240,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickForce()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickForce", "" ] } @@ -25052,6 +26260,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "", + "name": "Parameter", + "type": "objectList" } ], "objectGroups": [] @@ -25072,7 +26285,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickAngle()" + "JoystickAngle" ] } ] @@ -25116,7 +26329,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -25125,9 +26338,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickAngle()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickAngle", "" ] } @@ -25155,193 +26368,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 +26380,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 +26408,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 +26423,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 +26743,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -25486,7 +26781,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyJoystickIdentifier()" + "JoystickIdentifier" ] } ] @@ -25529,7 +26824,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -25567,7 +26862,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDeadZoneRadius()" + "DeadZoneRadius" ] } ] @@ -25610,7 +26905,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 +26974,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "Touch identifier", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -25640,7 +26992,6 @@ "description": "", "group": "", "extraInformation": [], - "hidden": false, "name": "ControllerIdentifier" }, { @@ -25650,7 +27001,6 @@ "description": "", "group": "", "extraInformation": [], - "hidden": false, "name": "JoystickIdentifier" }, { @@ -25660,7 +27010,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 +27153,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 +27190,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] }, { @@ -25878,7 +27246,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -26046,9 +27414,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyButtonIdentifier()", - "GetArgumentAsString(\"ButtonState\")", + "ControllerIdentifier", + "ButtonIdentifier", + "ButtonState", "" ] } @@ -26085,7 +27453,6 @@ "description": "", "group": "", "extraInformation": [], - "hidden": false, "name": "ControllerIdentifier" }, { @@ -26095,7 +27462,6 @@ "description": "", "group": "", "extraInformation": [], - "hidden": false, "name": "ButtonIdentifier" }, { @@ -26127,6 +27493,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 +27528,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -26180,8 +27556,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -26208,8 +27584,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -26245,8 +27621,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -26273,8 +27649,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJumpButton()", + "ControllerIdentifier", + "JumpButton", "\"Down\"" ] } @@ -26318,7 +27694,6 @@ "extraInformation": [ "PlatformBehavior::PlatformerObjectBehavior" ], - "hidden": false, "name": "Property" }, { @@ -26328,7 +27703,6 @@ "description": "", "group": "", "extraInformation": [], - "hidden": false, "name": "ControllerIdentifier" }, { @@ -26341,7 +27715,6 @@ "Primary", "Secondary" ], - "hidden": false, "name": "JoystickIdentifier" }, { @@ -26351,16 +27724,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 +27746,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 +27788,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 +27820,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", + "supplementaryInformation": "SpriteMultitouchJoystick::Platformer3DMultitouchMapper", "type": "behavior" } ], @@ -26874,14 +27831,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 +27846,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 +28103,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 +28129,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 +28194,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 +28219,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 +28259,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 +28275,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 +28356,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 +28384,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyJoystickForce()" + "HorizontalRotationDeceleration" ] } ] @@ -27313,17 +28397,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 +28421,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 +28518,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 +28546,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyControllerIdentifier()" + "VerticalRotationAcceleration" ] } ] @@ -27484,8 +28559,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -27493,8 +28573,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "ControllerIdentifier", - "name": "SetControllerIdentifier", + "getterName": "VerticalRotationAcceleration", + "name": "SetVerticalRotationAcceleration", "sentence": "", "events": [ { @@ -27503,14 +28583,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationAcceleration" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "Value" ] } ] @@ -27520,19 +28599,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 +28624,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 +28654,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "JoystickIdentifier", - "name": "SetJoystickIdentifier", + "getterName": "VerticalRotationDeceleration", + "name": "SetVerticalRotationDeceleration", "sentence": "", "events": [ { @@ -27575,14 +28664,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationDeceleration" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsString(\"Value\")", - "" + "Value" ] } ] @@ -27592,19 +28680,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 +28708,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyDeadZoneRadius()" + "VerticalAngleMin" ] } ] @@ -27628,8 +28721,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -27637,8 +28735,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "DeadZoneRadius", - "name": "SetDeadZoneRadius", + "getterName": "VerticalAngleMin", + "name": "SetVerticalAngleMin", "sentence": "", "events": [ { @@ -27647,14 +28745,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMin" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "Value" ] } ] @@ -27664,271 +28761,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 +28789,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyValue()" + "VerticalAngleMax" ] } ] @@ -27957,7 +28807,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], @@ -27966,8 +28816,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "Value", - "name": "SetValue", + "getterName": "VerticalAngleMax", + "name": "SetVerticalAngleMax", "sentence": "", "events": [ { @@ -27976,68 +28826,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 +28847,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 +28870,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxValue()" + "OffsetZ" ] } ] @@ -28093,7 +28888,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], @@ -28102,8 +28897,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "MaxValue", - "name": "SetMaxValue", + "getterName": "OffsetZ", + "name": "SetOffsetZ", "sentence": "", "events": [ { @@ -28112,13 +28907,13 @@ "actions": [ { "type": { - "value": "PanelSpriteContinuousBar::ResourceBar::SetPropertyMaxValue" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyOffsetZ" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28133,170 +28928,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 +29585,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 +29668,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 +29759,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 +30013,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 +30143,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 +30377,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 +30522,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 +30551,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "FillBar.ResourceBar::Value()" + "Border.MultitouchJoystick::PropertyControllerIdentifier()" ] } ] @@ -29332,7 +30564,7 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" } ], @@ -29341,8 +30573,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "Value", - "name": "SetValue", + "getterName": "ControllerIdentifier", + "name": "SetControllerIdentifier", "sentence": "", "events": [ { @@ -29351,114 +30583,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 +30672,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 +30695,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "FillBar.ResourceBar::PropertyMaxValue()" + "Border.MultitouchJoystick::PropertyDeadZoneRadius()" ] } ] @@ -29510,7 +30708,7 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" } ], @@ -29519,8 +30717,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "MaxValue", - "name": "SetMaxValue", + "getterName": "DeadZoneRadius", + "name": "SetDeadZoneRadius", "sentence": "", "events": [ { @@ -29529,31 +30727,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 +30744,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 +31043,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 +31070,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "FillBar.ResourceBar::PropertyPreviousHighValueDuration()" + "Value" ] } ] @@ -29694,8 +31083,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" } ], "objectGroups": [] @@ -29703,8 +31097,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "PreviousValueDuration", - "name": "SetPreviousValueDuration", + "getterName": "Value", + "name": "SetValue", "sentence": "", "events": [ { @@ -29713,14 +31107,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 +31123,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 +31150,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 +31178,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "type": "object" }, { @@ -29794,55 +31190,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 +31243,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 +31357,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 +31518,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 +31579,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "PanelSpriteContinuousBar::PanelSpriteContinuousBar", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "PanelSpriteContinuousBar::ResourceBar", + "type": "behavior" } ], "objectGroups": [] @@ -30078,641 +31593,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 +32067,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 +32131,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 +34253,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 +34265,7 @@ "parameters": [ "RandomFloatInRange(0,1)", "<", - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ], @@ -31336,7 +34351,7 @@ "Object", "Behavior", "=", - "max(0,Object.Behavior::PropertyDamageToBeApplied() - Object.Behavior::PropertyFlatDamageReduction())" + "max(0,DamageToBeApplied - FlatDamageReduction)" ] } ] @@ -31388,7 +34403,7 @@ "Object", "Behavior", "*", - "1 - min(1, Object.Behavior::PropertyPercentDamageReduction())" + "1 - min(1, PercentDamageReduction)" ] } ] @@ -31420,8 +34435,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 +34503,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 +34516,7 @@ "Object", "Behavior", "<=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -31516,7 +34529,7 @@ "Object", "Behavior", "-", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { @@ -31527,7 +34540,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { @@ -31553,8 +34566,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 +34579,7 @@ "Object", "Behavior", ">", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -31580,7 +34592,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -31633,8 +34645,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 +34670,7 @@ "Object", "Behavior", "-", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] }, { @@ -31741,7 +34752,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyCurrentHealth() - Object.Behavior::PropertyDamageToBeApplied()", + "CurrentHealth - DamageToBeApplied", "" ] } @@ -31754,10 +34765,2119 @@ } ] } - ], - "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": [ + { + "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": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if health was just damaged previously in the events.", + "fullName": "Is health just damaged", + "functionType": "Condition", + "group": "Health", + "name": "IsJustDamaged", + "sentence": "Health has just been damaged on _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyIsHealthJustDamaged" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object was just healed previously in the events.", + "fullName": "Is just healed", + "functionType": "Condition", + "group": "Health", + "name": "IsJustHealed", + "sentence": "_PARAM0_ has just been healed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyIsJustHealed" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if damage cooldown is active. Object and shield cannot be damaged while this is active.", + "fullName": "Is damage cooldown active", + "functionType": "Condition", + "group": "Health", + "name": "IsDamageCooldownActive", + "sentence": "Damage cooldown on _PARAM0_ is active", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyHitAtLeastOnce" + }, + "parameters": [ + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "Health::Health::PropertyDamageCooldown" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + }, + { + "type": { + "value": "CompareObjectTimer" + }, + "parameters": [ + "Object", + "\"__Health.TimeSinceLastHit\"", + "<", + "DamageCooldown" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the time before damage cooldown ends (seconds).", + "fullName": "Time remaining in damage cooldown", + "functionType": "ExpressionAndCondition", + "group": "Health", + "name": "DamageCooldownRemaining", + "sentence": "the time before damage cooldown end", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::IsDamageCooldownActive" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "max(0,DamageCooldown - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is considered dead (no health points).", + "fullName": "Is dead", + "functionType": "Condition", + "group": "Health", + "name": "IsDead", + "sentence": "_PARAM0_ is dead", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyCurrentHealth" + }, + "parameters": [ + "Object", + "Behavior", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the time since last taken hit (seconds).", + "fullName": "Time since last hit", + "functionType": "ExpressionAndCondition", + "group": "Health", + "name": "TimeSinceLastHit", + "sentence": "the time since last taken hit on health", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\")" + ] + } + ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -31769,36 +36889,193 @@ "name": "Behavior", "supplementaryInformation": "Health::Health", "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the health damage taken from most recent hit.", + "fullName": "Health damage taken from most recent hit", + "functionType": "ExpressionAndCondition", + "group": "Health", + "name": "PreviousDamageTaken", + "sentence": "the health damage taken from most recent hit", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "DamageToBeApplied" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, { - "description": "Points of damage", - "name": "DamageValue", + "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" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "MaxShield", + "name": "SetMaxShieldOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyMaxShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Maximum shield", + "name": "Value", "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the maximum shield points of the object.", + "fullName": "Maximum shield points (deprecated)", + "functionType": "Action", + "group": "Shield configuration", + "name": "SetMaxShield", + "private": true, + "sentence": "Change the maximum shield of _PARAM0_ to _PARAM2_ points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetMaxShieldOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, { - "defaultValue": "yes", - "description": "Shield can reduce damage taken", - "name": "UseShield", - "optional": true, - "type": "yesorno" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" }, { - "defaultValue": "yes", - "description": "Armor can reduce damage taken", - "name": "UseArmor", - "optional": true, - "type": "yesorno" + "description": "Maximum shield", + "name": "Value", + "type": "expression" } ], "objectGroups": [] }, { - "description": "Change the health points of the object. Will not trigger damage cooldown.", - "fullName": "Change health points", + "description": "Change maximum shield points.", + "fullName": "Max shield points (deprecated)", "functionType": "Action", - "group": "Health configuration", - "name": "SetHealth", - "sentence": "Change the health of _PARAM0_ to _PARAM2_ points", + "group": "Shield configuration", + "name": "SetMaxShieldPoints", + "private": true, + "sentence": "Change the maximum shield points on _PARAM0_ to _PARAM2_ points", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -31806,55 +37083,368 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "Health::Health::SetMaxShieldOp" }, "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": "If MaxHealth is set, prevent health from going above it", - "comment2": "" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" }, + { + "description": "Shield points", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the current shield points of the object.", + "fullName": "Shield points", + "functionType": "ExpressionAndCondition", + "group": "Shield", + "name": "ShieldPoints", + "sentence": "the shield points", + "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "Health::Health::PropertyMaxHealth" + "value": "SetReturnNumber" + }, + "parameters": [ + "CurrentShieldPoints" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ShieldPoints", + "name": "SetShieldPointsOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentShieldPoints" }, "parameters": [ "Object", "Behavior", - ">", - "0" + "=", + "Value" ] } - ], + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Shield points", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change current shield points. Will not trigger damage cooldown.", + "fullName": "Shield points (deprecated)", + "functionType": "Action", + "group": "Shield configuration", + "name": "SetShieldPoints", + "private": true, + "sentence": "Change current shield points on _PARAM0_ to _PARAM2_ points", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetShieldPointsOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Shield points", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the rate of shield regeneration (points per second).", + "fullName": "Rate of shield regeneration", + "functionType": "ExpressionAndCondition", + "group": "Shield configuration", + "name": "ShieldRegenRate", + "sentence": "the rate of shield regeneration", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ShieldRegenRate" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ShieldRegenRate", + "name": "SetShieldRegenRateOp", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyShieldRegenRate" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Regeneration rate (points per second)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change rate of shield regeneration.", + "fullName": "Shield regeneration rate (deprecated)", + "functionType": "Action", + "group": "Shield configuration", + "name": "SetShieldRegenRate", + "private": true, + "sentence": "Change the shield regeneration rate of _PARAM0_ to _PARAM2_ points per second", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Health::Health::SetShieldRegenRateOp" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Health::Health", + "type": "behavior" + }, + { + "description": "Regeneration rate (points per second)", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the delay before shield regeneration starts after being hit (seconds).", + "fullName": "Shield regeneration delay", + "functionType": "ExpressionAndCondition", + "group": "Shield configuration", + "name": "ShieldRegenDelay", + "sentence": "the shield regeneration delay", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "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::SetPropertyCurrentHealth" + "value": "Health::Health::SetPropertyShieldRegenDelay" }, "parameters": [ "Object", "Behavior", "=", - "min(Object.Behavior::PropertyCurrentHealth(), Object.Behavior::PropertyMaxHealth())" + "Value" ] } ] @@ -31873,7 +37463,7 @@ "type": "behavior" }, { - "description": "New health value", + "description": "Regeneration delay (seconds)", "name": "Value", "type": "expression" } @@ -31881,13 +37471,13 @@ "objectGroups": [] }, { - "description": "Change the health points of the object. Will not trigger damage cooldown.", - "fullName": "Change health points (deprecated)", + "description": "Change delay before shield regeneration starts after being hit.", + "fullName": "Shield regeneration delay (deprecated)", "functionType": "Action", - "group": "Health configuration", - "name": "SetCurrentHealth", + "group": "Shield configuration", + "name": "SetShieldRegenDelay", "private": true, - "sentence": "Change the health of _PARAM0_ to _PARAM2_ points", + "sentence": "Change the shield regeneration delay on _PARAM0_ to _PARAM2_ seconds", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -31895,12 +37485,13 @@ "actions": [ { "type": { - "value": "Health::Health::SetHealth" + "value": "Health::Health::SetShieldRegenDelayOp" }, "parameters": [ "Object", "Behavior", - "GetArgumentAsNumber(\"Value\")", + "=", + "Value", "" ] } @@ -31920,7 +37511,7 @@ "type": "behavior" }, { - "description": "New health value", + "description": "Regeneration delay (seconds)", "name": "Value", "type": "expression" } @@ -31928,179 +37519,31 @@ "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", + "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": [ { - "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", - "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\")" - ] - } - ] - }, - { - "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", - "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())" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Perform heal", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Health::Health::SetPropertyCurrentHealth" - }, - "parameters": [ - "Object", - "Behavior", - "+", - "Object.Behavior::PropertyHealToBeApplied()" - ] - } - ] - }, + "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": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Health::Health::SetPropertyIsJustHealed" - }, - "parameters": [ - "Object", - "Behavior", - "yes" - ] - } + "parameters": [ + "ShieldDuration" ] } - ], - "parameters": [] + ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -32112,22 +37555,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": "ShieldDuration", + "name": "SetShieldDurationOp", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32135,55 +37572,13 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyMaxHealth" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Make sure Current Health does not exceed new Max Health", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyCurrentHealth" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "Object.Behavior::MaxHealth()" - ] - } - ], - "actions": [ - { - "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "Health::Health::SetPropertyShieldDuration" }, "parameters": [ "Object", "Behavior", "=", - "Object.Behavior::MaxHealth()" + "Value" ] } ] @@ -32202,7 +37597,7 @@ "type": "behavior" }, { - "description": "Maximum health", + "description": "Shield duration (seconds)", "name": "Value", "type": "expression" } @@ -32210,12 +37605,13 @@ "objectGroups": [] }, { - "description": "Change the rate of health regeneration.", - "fullName": "Rate of health regeneration", + "description": "Change duration of shield. Use \"0\" to make shield permanent.", + "fullName": "Duration of shield (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": "SetShieldDuration", + "private": true, + "sentence": "Change the duration of shield on _PARAM0_ to _PARAM2_ seconds", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32223,13 +37619,14 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealthRegenRate" + "value": "Health::Health::SetShieldDurationOp" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value", + "" ] } ] @@ -32248,7 +37645,7 @@ "type": "behavior" }, { - "description": "Rate of regen", + "description": "Shield duration (seconds)", "name": "Value", "type": "expression" } @@ -32256,12 +37653,12 @@ "objectGroups": [] }, { - "description": "Change the duration of damage cooldown (seconds).", - "fullName": "Damage cooldown", + "description": "Renew shield duration to it's full value.", + "fullName": "Renew shield duration", "functionType": "Action", - "group": "Health configuration", - "name": "SetCooldownDuration", - "sentence": "Change the duration of damage cooldown on _PARAM0_ to _PARAM2_ seconds", + "group": "Shield", + "name": "RenewShieldDuration", + "sentence": "Renew the shield duration on _PARAM0_", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32269,13 +37666,11 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageCooldown" + "value": "ResetObjectTimer" }, "parameters": [ "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "\"__Health.ShieldDuration\"" ] } ] @@ -32292,22 +37687,17 @@ "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", + "description": "Activate the shield by setting the shield points and renewing the shield duration (optional).", + "fullName": "Activate shield", "functionType": "Action", - "group": "Health configuration", - "name": "SetHealthRegenDelay", - "sentence": "Change the health regeneration delay on _PARAM0_ to _PARAM2_ seconds", + "group": "Shield", + "name": "ActivateShield", + "sentence": "Activate the shield on _PARAM0_ with _PARAM2_ points (Renew shield duration: _PARAM3_)", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32315,59 +37705,67 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealthRegenDelay" + "value": "Health::Health::SetPropertyCurrentShieldPoints" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "ShieldPoints" ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyMaxShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyCurrentShieldPoints" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "min(ShieldPoints,Object.Behavior::MaxShield())" + ] + } + ] }, - { - "description": "Delay (seconds)", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Change the chance to dodge incoming damage.", - "fullName": "Chance to dodge incoming damage", - "functionType": "Action", - "group": "Health configuration", - "name": "SetChanceToDodge", - "sentence": "Change the chance to dodge on _PARAM0_ to _PARAM2_", - "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"RenewShieldDuration\"" + ] + } + ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyChanceToDodge" + "value": "Health::Health::RenewShieldDuration" }, "parameters": [ "Object", "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "" ] } ] @@ -32386,20 +37784,27 @@ "type": "behavior" }, { - "description": "Chance to dodge (Range: 0 to 1)", - "name": "Value", + "description": "Shield points", + "name": "ShieldPoints", "type": "expression" + }, + { + "defaultValue": "yes", + "description": "Renew shield duration", + "name": "RenewShieldDuration", + "optional": true, + "type": "yesorno" } ], "objectGroups": [] }, { - "description": "Change the flat damage reduction from armor. Incoming damage is reduced by this value.", - "fullName": "Flat damage reduction from armor", + "description": "Enable (or disable) blocking excess damage when shield breaks.", + "fullName": "Block excess damage when shield breaks", "functionType": "Action", - "group": "Health configuration", - "name": "SetFlatDamageReduction", - "sentence": "Change the flat damage reduction from armor on _PARAM0_ to _PARAM2_ points", + "group": "Shield configuration", + "name": "SetShieldBlockExcessDamage", + "sentence": "Shield on _PARAM0_ blocks excess damage when it breaks: _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32407,13 +37812,37 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyFlatDamageReduction" + "value": "Health::Health::SetPropertyBlockExcessDamage" }, "parameters": [ "Object", "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Health::Health::SetPropertyBlockExcessDamage" + }, + "parameters": [ + "Object", + "Behavior", + "yes" ] } ] @@ -32432,20 +37861,20 @@ "type": "behavior" }, { - "description": "Flat reduction from armor", + "description": "Block excess damage", "name": "Value", - "type": "expression" + "type": "yesorno" } ], "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_", + "description": "Check if the shield was just damaged previously in the events.", + "fullName": "Is shield just damaged", + "functionType": "Condition", + "group": "Shield", + "name": "IsShieldJustDamaged", + "sentence": "Shield on _PARAM0_ has just been damaged", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32453,13 +37882,34 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyPercentDamageReduction" + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Health::Health::PropertyIsShieldJustDamaged" }, "parameters": [ "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" ] } ] @@ -32476,22 +37926,17 @@ "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_", + "description": "Check if incoming damage was just dodged.", + "fullName": "Damage was just dodged", + "functionType": "Condition", + "group": "Health", + "name": "IsJustDodged", + "sentence": "_PARAM0_ just dodged incoming damage", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32499,12 +37944,10 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyAllowOverHealing" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "Behavior", - "no" + "False" ] } ] @@ -32514,22 +37957,21 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "Health::Health::PropertyIsJustDodged" }, "parameters": [ - "\"Value\"" + "Object", + "Behavior" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyAllowOverHealing" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "Behavior", - "yes" + "True" ] } ] @@ -32546,23 +37988,17 @@ "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_", + "description": "Check if the shield is active (based on shield points and duration).", + "fullName": "Is shield active", + "functionType": "Condition", + "group": "Shield", + "name": "IsShieldActive", + "sentence": "Shield on _PARAM0_ is active", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32570,37 +38006,116 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHitAtLeastOnce" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "Behavior", - "no" + "False" ] } ] }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "To be considered \"active\", a shield must have positive points AND not exceed duration" + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "Health::Health::PropertyCurrentShieldPoints" }, "parameters": [ - "\"Value\"" + "Object", + "Behavior", + ">", + "0" ] } ], - "actions": [ + "actions": [], + "events": [ { - "type": { - "value": "Health::Health::SetPropertyHitAtLeastOnce" + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 }, - "parameters": [ - "Object", - "Behavior", - "yes" + "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" + ] + } ] } ] @@ -32617,23 +38132,17 @@ "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_", + "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", @@ -32641,12 +38150,10 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsHealthJustDamaged" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "no" + "0" ] } ] @@ -32656,27 +38163,31 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "Health::Health::PropertyShieldDuration" }, "parameters": [ - "\"Value\"" + "Object", + "Behavior", + ">", + "0" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsHealthJustDamaged" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "yes" + "max(0,ShieldDuration - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -32688,81 +38199,36 @@ "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_", + "description": "the shield damage taken from most recent hit.", + "fullName": "Shield damage taken from most recent hit", + "functionType": "ExpressionAndCondition", + "group": "Shield", + "name": "PreviousDamageToShield", + "sentence": "the shield damage taken from most recent hit", "events": [ - { - "type": "BuiltinCommonInstructions::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": [ - { - "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" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "\"__Health.TimeSinceLastHit\"" + "ShieldDamageTaken" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -32779,66 +38245,31 @@ "objectGroups": [] }, { - "description": "Check if the object has been hit at least once.", - "fullName": "Object has been hit at least once", - "functionType": "Condition", + "description": "the health points gained from previous heal.", + "fullName": "Health points gained from previous heal", + "functionType": "ExpressionAndCondition", "group": "Health", - "name": "HitAtLeastOnce", - "private": true, - "sentence": "_PARAM0_ has been hit at least once", + "name": "PreviousHealAmount", + "sentence": "the health points gained from previous heal", "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" - }, - "parameters": [ - "False" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyHitAtLeastOnce" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "HealToBeApplied" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -32853,76 +38284,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" }, { - "description": "Check if health was just damaged previously in the events.", - "fullName": "Is health just damaged", - "functionType": "Condition", - "group": "Health", - "name": "IsJustDamaged", - "sentence": "Health has just been damaged on _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "False" - ] - } - ] - }, + "type": "BuiltinCommonInstructions::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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyIsHealthJustDamaged" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } + "type": { + "inverted": true, + "value": "Flash::ColorTint" + }, + "parameters": [ + "", + "=", + "\"255;255;255\"", + "Object", + "" ] } ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, + "actions": [ { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] } - ], - "objectGroups": [] + ] + } + ], + "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": "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", + "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", @@ -32930,9 +38712,11 @@ "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetObjectVariableAsBoolean" }, "parameters": [ + "Object", + "__Flash_ColorTintToggled", "False" ] } @@ -32943,59 +38727,35 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsJustHealed" + "value": "Flash::ColorTint" }, "parameters": [ + "", + "=", + "Object.VariableString(__FlashColor_StartingTint)", "Object", - "Behavior" + "" ] } ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "ChangeColor" }, "parameters": [ - "True" + "Object", + "ColorTint" ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if damage cooldown is active. Object and shield cannot be damaged while this is active.", - "fullName": "Is damage cooldown active", - "functionType": "Condition", - "group": "Health", - "name": "IsDamageCooldownActive", - "sentence": "Damage cooldown on _PARAM0_ is active", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + }, { "type": { - "value": "SetReturnBoolean" + "value": "SetObjectVariableAsBoolean" }, "parameters": [ - "False" + "Object", + "__Flash_ColorTintToggled", + "True" ] } ] @@ -33005,276 +38765,293 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyHitAtLeastOnce" - }, - "parameters": [ - "Object", - "Behavior" - ] - }, - { - "type": { - "value": "Health::Health::PropertyDamageCooldown" + "value": "ObjectVariableAsBoolean" }, "parameters": [ "Object", - "Behavior", - ">", - "0" + "__Flash_ColorTintToggled", + "False" ] }, { "type": { - "value": "CompareObjectTimer" + "inverted": true, + "value": "Flash::ColorTint" }, "parameters": [ + "", + "=", + "Object.VariableString(__FlashColor_StartingTint)", "Object", - "\"__Health.TimeSinceLastHit\"", - "<", - "Object.Behavior::PropertyDamageCooldown()" + "" ] } ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "ChangeColor" }, "parameters": [ - "True" + "Object", + "Object.VariableString(__FlashColor_StartingTint)" ] } ] } ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" - } - ], - "objectGroups": [] + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "objectList" }, { - "description": "Check if the object is considered dead (no health points).", - "fullName": "Is dead", - "functionType": "Condition", - "group": "Health", - "name": "IsDead", - "sentence": "_PARAM0_ is dead", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "False" - ] - } - ] - }, + "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": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyCurrentHealth" - }, - "parameters": [ - "Object", - "Behavior", - "<=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_VisibilityToggled", + "False" ] } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" - } - ], - "objectGroups": [] + ] }, { - "description": "maximum health points of the object.", - "fullName": "Maximum health points", - "functionType": "ExpressionAndCondition", - "group": "Health", - "name": "MaxHealth", - "sentence": "maximum health points", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyMaxHealth()" - ] - } + "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": "Duration of damage cooldown (seconds).", - "fullName": "Damage cooldown", - "functionType": "Expression", - "group": "Health", - "name": "DamageCooldownDuration", - "sentence": "", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyDamageCooldown()" - ] - } + "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" - } - ], - "objectGroups": [] - }, - { - "description": "current health points of the object.", - "fullName": "Health points", - "functionType": "ExpressionAndCondition", - "group": "Health", - "name": "Health", - "sentence": "health points", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyCurrentHealth()" - ] - } + "type": { + "inverted": true, + "value": "Visible" + }, + "parameters": [ + "Object" ] } ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, + "actions": [ { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] } - ], - "objectGroups": [] - }, + ] + } + ], + "parameters": [ { - "description": "Delay before health regeneration starts after last being hit (seconds).", - "fullName": "Health regeneration delay", - "functionType": "Expression", - "group": "Health", - "name": "HealthRegenDelay", + "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::PropertyHealthRegenDelay()" + "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", @@ -33284,186 +39061,93 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::Flash", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Rate of health regeneration (points per second).", - "fullName": "Rate of health regeneration", - "functionType": "Expression", - "group": "Health", - "name": "HealthRegenRate", - "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::PropertyHealthRegenRate()" + "Object", + "Behavior", + "" ] } - ] - } - ], - "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": "Flash::ToggleVisibility" }, "parameters": [ - "0" + "", + "Object", + "" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "Health::Health::IsDamageCooldownActive" + "value": "Flash::Flash::SetPropertyIsFlashing" }, "parameters": [ "Object", "Behavior", - "" + "yes" ] - } - ], - "actions": [ + }, { "type": { - "value": "SetReturnNumber" + "value": "ResetObjectTimer" }, "parameters": [ - "max(0,Object.Behavior::PropertyDamageCooldown() - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" + "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": "Time since last hit (seconds).", - "fullName": "Time since last hit", - "functionType": "Expression", - "group": "Health", - "name": "TimeSinceLastHit", - "sentence": "", - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "ResetObjectTimer" }, "parameters": [ - "Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\")" + "Object", + "\"Flash_Visibility_Duration_Timer\"" ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" - } - ], - "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": [], - "actions": [ + }, { "type": { - "value": "SetReturnNumber" + "value": "Flash::Flash::SetPropertyFlashDuration" }, "parameters": [ - "Object.Behavior::PropertyChanceToDodge()" + "Object", + "Behavior", + "=", + "NewFlashDuration" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -33473,19 +39157,24 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::Flash", "type": "behavior" + }, + { + "description": "Duration of the flashing, in seconds", + "longDescription": "Use \"0\" to keep flashing until stopped.", + "name": "NewFlashDuration", + "type": "expression" } ], "objectGroups": [] }, { - "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", - "sentence": "", + "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", @@ -33493,100 +39182,39 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" }, "parameters": [ - "Object.Behavior::PropertyFlatDamageReduction()" + "False" ] } ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "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": "", - "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SetReturnNumber" + "value": "Flash::Flash::PropertyIsFlashing" }, "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": "SetReturnBoolean" }, "parameters": [ - "Object.Behavior::PropertyDamageToBeApplied()" + "True" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -33596,19 +39224,17 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::Flash", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Change the maximum shield points of the object.", - "fullName": "Maximum shield points", + "fullName": "", "functionType": "Action", - "group": "Shield configuration", - "name": "SetMaxShield", - "sentence": "Change the maximum shield of _PARAM0_ to _PARAM2_ points", + "name": "onDeActivate", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -33616,13 +39242,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyMaxShieldPoints" + "value": "Flash::Flash::Stop" }, "parameters": [ "Object", "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "" ] } ] @@ -33637,38 +39262,68 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::Flash", "type": "behavior" - }, - { - "description": "Maximum shield", - "name": "Value", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Change current shield points. Will not trigger damage cooldown.", - "fullName": "Shield points", + "description": "Stop flashing visibility (blink) of an object.", + "fullName": "Stop flashing visibility (blink)", "functionType": "Action", - "group": "Shield configuration", - "name": "SetShieldPoints", - "sentence": "Change current shield points on _PARAM0_ to _PARAM2_ points", + "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::SetPropertyCurrentShieldPoints" + "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\"" ] } ] @@ -33683,24 +39338,19 @@ { "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", - "functionType": "Action", - "group": "Shield configuration", - "name": "SetShieldRegenRate", - "sentence": "Change the shield regeneration rate of _PARAM0_ to _PARAM2_ points per second", + "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", @@ -33708,18 +39358,18 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldRegenRate" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "HalfPeriodTime" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -33729,24 +39379,18 @@ { "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", - "functionType": "Action", - "group": "Shield configuration", - "name": "SetShieldRegenDelay", - "sentence": "Change the shield regeneration delay on _PARAM0_ to _PARAM2_ seconds", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HalfPeriodTime", + "name": "SetHalfPeriodTime", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -33754,13 +39398,13 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldRegenDelay" + "value": "Flash::Flash::SetPropertyHalfPeriodTime" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -33775,40 +39419,176 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::Flash", "type": "behavior" - }, - { - "description": "Regeneration delay (seconds)", - "name": "Value", - "type": "expression" } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Half period ", + "description": "Time that the object is invisible", + "group": "", + "extraInformation": [], + "name": "HalfPeriodTime" }, { - "description": "Change duration of shield. Use \"0\" to make shield permanent.", - "fullName": "Duration of 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 configuration", - "name": "SetShieldDuration", - "sentence": "Change the duration of shield on _PARAM0_ to _PARAM2_ seconds", + "name": "doStepPreEvents", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "Health::Health::SetPropertyShieldDuration" + "value": "Flash::FlashColor::PropertyIsFlashing" }, "parameters": [ "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "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": [] + } ] } ], @@ -33816,189 +39596,116 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashColor", "type": "behavior" - }, - { - "description": "Shield duration (seconds)", - "name": "Value", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Renew shield duration to it's full value.", - "fullName": "Renew shield duration", + "description": "Make an object flash a color tint for a period of time.", + "fullName": "Flash a color tint", "functionType": "Action", - "group": "Shield configuration", - "name": "RenewShieldDuration", - "sentence": "Renew the shield duration on _PARAM0_", + "name": "Flash", + "sentence": "Make _PARAM0_ flash the color tint _PARAM3_ for _PARAM2_ seconds", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "ResetObjectTimer" + "inverted": true, + "value": "Flash::FlashColor::PropertyIsFlashing" }, "parameters": [ "Object", - "\"__Health.ShieldDuration\"" + "Behavior" ] } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Activate the shield by setting the shield points and renewing the shield duration (optional).", - "fullName": "Activate shield", - "functionType": "Action", - "group": "Shield", - "name": "ActivateShield", - "sentence": "Activate the shield on _PARAM0_ with _PARAM2_ points (Renew shield duration: _PARAM3_)", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "ModVarObjetTxt" }, "parameters": [ "Object", - "Behavior", + "__FlashColor_StartingTint", "=", - "GetArgumentAsNumber(\"ShieldPoints\")" + "Flash::ColorTint(Object)" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "Health::Health::PropertyMaxShieldPoints" + "value": "ResetObjectTimer" }, "parameters": [ "Object", - "Behavior", - ">", - "0" + "\"Flash_Color_Timer\"" ] - } - ], - "actions": [ + }, { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "Flash::ToggleColorTint" + }, + "parameters": [ + "", + "Object", + "NewColorTint", + "" + ] + }, + { + "type": { + "value": "Flash::FlashColor::SetPropertyIsFlashing" }, "parameters": [ "Object", "Behavior", - "=", - "min(GetArgumentAsNumber(\"ShieldPoints\"),Object.Behavior::MaxShield())" + "yes" ] } ] }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "ResetObjectTimer" }, "parameters": [ - "\"RenewShieldDuration\"" + "Object", + "\"Flash_Color_Duration_Timer\"" ] - } - ], - "actions": [ + }, { "type": { - "value": "Health::Health::RenewShieldDuration" + "value": "Flash::FlashColor::SetPropertyTintColor" }, "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::SetPropertyFlashDuration" }, "parameters": [ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "NewFlashDuration" ] } ] @@ -34008,29 +39715,35 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "object" }, { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashColor", "type": "behavior" }, { - "description": "Shield points", - "name": "Value", + "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": "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_", + "description": "Check if an object is flashing a color tint.", + "fullName": "Is object flashing a color tint", + "functionType": "Condition", + "name": "IsFlashing", + "sentence": "_PARAM0_ is flashing a color tint", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -34038,12 +39751,10 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyBlockExcessDamage" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "Behavior", - "no" + "False" ] } ] @@ -34053,22 +39764,21 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "Flash::FlashColor::PropertyIsFlashing" }, "parameters": [ - "\"Value\"" + "Object", + "Behavior" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyBlockExcessDamage" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "Behavior", - "yes" + "True" ] } ] @@ -34078,29 +39788,23 @@ { "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" } ], "objectGroups": [] }, { - "description": "Check if the shield was just damaged previously in the events.", - "fullName": "Is shield just damaged", - "functionType": "Condition", - "group": "Shield", - "name": "IsShieldJustDamaged", - "sentence": "Shield on _PARAM0_ has just been damaged", + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -34108,20 +39812,46 @@ "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "Flash::FlashColor::Stop" }, "parameters": [ - "False" + "Object", + "Behavior", + "" ] } ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashColor", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Stop flashing a color tint on an object.", + "fullName": "Stop flashing color tint", + "functionType": "Action", + "name": "Stop", + "sentence": "Stop flashing color tint _PARAM0_", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "Health::Health::PropertyIsShieldJustDamaged" + "value": "Flash::FlashColor::PropertyIsFlashing" }, "parameters": [ "Object", @@ -34132,10 +39862,39 @@ "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "Flash::FlashColor::SetPropertyIsFlashing" }, "parameters": [ - "True" + "Object", + "Behavior", + "no" + ] + }, + { + "type": { + "value": "ChangeColor" + }, + "parameters": [ + "Object", + "Object.VariableString(__FlashColor_StartingTint)" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Timer\"" + ] + }, + { + "type": { + "value": "RemoveObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Color_Duration_Timer\"" ] } ] @@ -34145,24 +39904,25 @@ { "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", + "description": "the half period (time between flashes) of the object.", + "fullName": "Half period", + "functionType": "ExpressionAndCondition", + "group": "Flash color tint configuration", + "name": "HalfPeriodTime", + "sentence": "the half period (time between flashes)", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -34170,61 +39930,40 @@ "actions": [ { "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "False" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyIsJustDodged" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "HalfPeriodTime" ] } ] } ], + "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": [] }, { - "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", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HalfPeriodTime", + "name": "SetHalfPeriodTime", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -34232,119 +39971,252 @@ "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "Flash::FlashColor::SetPropertyHalfPeriodTime" }, "parameters": [ - "False" + "Object", + "Behavior", + "=", + "Value" ] } ] - }, + } + ], + "parameters": [ { - "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": "" + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashColor", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "0.1", + "type": "Number", + "unit": "Second", + "label": "Half period", + "description": "Time between flashes", + "group": "", + "extraInformation": [], + "name": "HalfPeriodTime" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "IsFlashing" + }, + { + "value": "0", + "type": "Number", + "unit": "Second", + "label": "Flash duration", + "description": "Use \"0\" to keep flashing until stopped", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "FlashDuration" + }, + { + "value": "\"255;255;255\"", + "type": "String", + "label": "Tint color", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TintColor" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Flash opacity smoothly (fade) in a repeating loop.", + "fullName": "Flash opacity smothly (fade)", + "name": "FlashOpacity", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" + "value": "Flash::FlashOpacity::IsFlashing" }, "parameters": [ "Object", "Behavior", - ">", - "0" + "" ] } ], "actions": [], "events": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Don't check the timer when duration is zero (or negative)", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Alternate states", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { - "type": { - "value": "Health::Health::PropertyShieldDuration" - }, - "parameters": [ - "Object", - "Behavior", - "<=", - "0" + "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\"" + ] + } ] - } - ], - "actions": [ + }, { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "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": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Health::Health::PropertyShieldDuration" - }, - "parameters": [ - "Object", - "Behavior", - ">", - "0" - ] - }, + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Stop flashing", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { - "type": { - "value": "CompareObjectTimer" - }, - "parameters": [ - "Object", - "\"__Health.ShieldDuration\"", - "<", - "Object.Behavior::PropertyShieldDuration()" + "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", + "" + ] + } ] } ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] + "parameters": [] } ] } @@ -34358,79 +40230,109 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashOpacity", "type": "behavior" } ], "objectGroups": [] }, { - "description": "maximum shield points of the object.", - "fullName": "Maximum shield points", - "functionType": "ExpressionAndCondition", - "group": "Shield", - "name": "MaxShield", - "sentence": "maximum shield points", + "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": [], + "conditions": [ + { + "type": { + "inverted": true, + "value": "Flash::FlashOpacity::PropertyIsFlashing" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "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::PropertyMaxShieldPoints()" + "Object", + "Behavior", + "yes" ] } ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Duration of the shield (seconds).", - "fullName": "Duration of shield", - "functionType": "Expression", - "group": "Shield", - "name": "ShieldDuration", - "sentence": "", - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"Flash_Opacity_Duration_Timer\"" + ] + }, + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyFlashDuration" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "NewFlashDuration" + ] + }, + { + "type": { + "value": "Flash::FlashOpacity::SetPropertyTargetOpacity" }, "parameters": [ - "Object.Behavior::PropertyShieldDuration()" + "Object", + "Behavior", + "=", + "NewTargetOpacity" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -34440,19 +40342,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": "Delay before shield regeneration starts after being hit (seconds).", - "fullName": "Shield regeneration delay", - "functionType": "Expression", - "group": "Shield", - "name": "ShieldRegenDelay", - "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", @@ -34460,18 +40378,39 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Flash::FlashOpacity::PropertyIsFlashing" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenDelay()" + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -34481,18 +40420,16 @@ { "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", + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", "sentence": "", "events": [ { @@ -34501,18 +40438,17 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "Flash::FlashOpacity::Stop" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenRate()" + "Object", + "Behavior", + "" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -34522,105 +40458,87 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashOpacity", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Time before the shield duration ends (seconds).", - "fullName": "Time before shield duration ends", - "functionType": "Expression", - "group": "Shield", - "name": "ShieldTimeRemaining", - "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": [], - "actions": [ + "conditions": [ { "type": { - "value": "SetReturnNumber" + "value": "Flash::FlashOpacity::IsFlashing" }, "parameters": [ - "0" + "Object", + "Behavior", + "" ] } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + ], + "actions": [ { "type": { - "value": "Health::Health::PropertyShieldDuration" + "value": "Flash::FlashOpacity::SetPropertyIsFlashing" }, "parameters": [ "Object", "Behavior", - ">", - "0" + "no" ] - } - ], - "actions": [ + }, { "type": { - "value": "SetReturnNumber" + "value": "RemoveObjectTimer" }, "parameters": [ - "max(0,Object.Behavior::PropertyShieldDuration() - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" + "Object", + "\"Flash_Color_Duration_Timer\"" ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "Health::Health", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "current shield points of the object.", - "fullName": "Shield points", - "functionType": "ExpressionAndCondition", - "group": "Shield", - "name": "ShieldPoints", - "sentence": "shield points", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + }, { "type": { - "value": "SetReturnNumber" + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToTargetOpacity\"" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Object", + "TweenBehavior", + "\"__Flash.ToStartingOpacity\"" + ] + }, + { + "type": { + "value": "OpacityCapability::OpacityBehavior::SetValue" }, "parameters": [ - "Object.Behavior::PropertyCurrentShieldPoints()" + "Object", + "Opacity", + "=", + "StartingOpacity" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -34630,19 +40548,19 @@ { "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": "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 +40571,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDamageTaken()" + "HalfPeriodTime" ] } ] @@ -34671,18 +40589,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 +40608,18 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "Flash::FlashOpacity::SetPropertyHalfPeriodTime" }, "parameters": [ - "Object.Behavior::PropertyHealToBeApplied()" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -34712,7 +40629,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Health::Health", + "supplementaryInformation": "Flash::FlashOpacity", "type": "behavior" } ], @@ -34720,289 +40637,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": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "HealToBeApplied" - } - ], - "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": [ + "type": "Number", + "unit": "Dimensionless", + "label": "Starting opacity", + "description": "Opacity will fade between the starting value and a target value", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "StartingOpacity" + } + ], + "sharedPropertyDescriptors": [] + }, { - "description": "Make the object flash (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 +40732,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 +40968,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 +41012,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 +41039,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 +41076,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 +41119,7 @@ "conditions": [ { "type": { - "value": "Flash::Flash::PropertyIsFlashing" + "value": "Flash::FlashEffect::PropertyIsFlashing" }, "parameters": [ "Object", @@ -35287,7 +41148,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Flash::Flash", + "supplementaryInformation": "Flash::FlashEffect", "type": "behavior" } ], @@ -35296,7 +41157,7 @@ { "fullName": "", "functionType": "Action", - "name": "onOwnerRemovedFromScene", + "name": "onDeActivate", "sentence": "", "events": [ { @@ -35305,7 +41166,7 @@ "actions": [ { "type": { - "value": "Flash::Flash::Stop" + "value": "Flash::FlashEffect::Stop" }, "parameters": [ "Object", @@ -35325,16 +41186,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 +41371,13 @@ "actions": [ { "type": { - "value": "Flash::Flash::Stop" + "value": "Flash::FlashEffect::SetPropertyHalfPeriodTime" }, "parameters": [ "Object", "Behavior", - "" + "=", + "Value" ] } ] @@ -35363,50 +41392,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 +41509,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 +41556,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 +41582,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 +41619,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 +41655,7 @@ "textG": 0, "textR": 0 }, - "comment": "Start/Reset duration timer", - "comment2": "" + "comment": "Start/Reset duration timer" }, { "type": "BuiltinCommonInstructions::Standard", @@ -35576,8 +41682,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 +41696,7 @@ "Object", "__ShakeObject_Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -35602,7 +41707,7 @@ "Object", "__ShakeObject_PowerX", "=", - "GetArgumentAsNumber(\"PowerX\")" + "PowerX" ] }, { @@ -35613,7 +41718,7 @@ "Object", "__ShakeObject_PowerY", "=", - "GetArgumentAsNumber(\"PowerY\")" + "PowerY" ] }, { @@ -35624,7 +41729,7 @@ "Object", "__ShakeObject_PowerAngle", "=", - "GetArgumentAsNumber(\"PowerAngle\")" + "PowerAngle" ] }, { @@ -35635,7 +41740,7 @@ "Object", "__ShakeObject_TimeBetweenShakes", "=", - "GetArgumentAsNumber(\"TimeBetweenShakes\")" + "TimeBetweenShakes" ] } ] @@ -35650,8 +41755,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 +41808,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 +41878,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 +41919,7 @@ "textG": 0, "textR": 0 }, - "comment": "Detect initial shake", - "comment2": "" + "comment": "Detect initial shake" }, { "type": "BuiltinCommonInstructions::Standard", @@ -35859,8 +41960,7 @@ "textG": 0, "textR": 0 }, - "comment": "Initiate the onScenePostEvents function", - "comment2": "" + "comment": "Initiate the onScenePostEvents function" }, { "type": "BuiltinCommonInstructions::Standard", @@ -35907,6 +42007,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 +42018,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 +42082,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 +42140,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 +42217,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 +42314,7 @@ "textG": 0, "textR": 0 }, - "comment": "Reset drift detection variables", - "comment2": "" + "comment": "Reset drift detection variables" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36270,8 +42368,7 @@ "textG": 0, "textR": 0 }, - "comment": "Calculate Position Shake", - "comment2": "" + "comment": "Calculate Position Shake" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36319,8 +42416,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 +42428,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 +42517,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 +42608,7 @@ "textG": 0, "textR": 0 }, - "comment": "Calculate Rotation (angle) shake ", - "comment2": "" + "comment": "Calculate Rotation (angle) shake " }, { "type": "BuiltinCommonInstructions::Standard", @@ -36544,8 +42637,7 @@ "textG": 0, "textR": 0 }, - "comment": "Every \"even\" shake, rotate clockwise", - "comment2": "" + "comment": "Every \"even\" shake, rotate clockwise" }, { "type": "BuiltinCommonInstructions::Comment", @@ -36557,8 +42649,7 @@ "textG": 0, "textR": 0 }, - "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude", - "comment2": "" + "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36598,8 +42689,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 +42701,7 @@ "textG": 0, "textR": 0 }, - "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude", - "comment2": "" + "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36654,8 +42743,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 +42786,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 +42815,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 +42844,7 @@ "textG": 0, "textR": 0 }, - "comment": "Change position", - "comment2": "" + "comment": "Change position" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36828,8 +42913,7 @@ "textG": 0, "textR": 0 }, - "comment": "Save movement to calculate drift", - "comment2": "" + "comment": "Save movement to calculate drift" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36871,8 +42955,7 @@ "textG": 0, "textR": 0 }, - "comment": "Change angle", - "comment2": "" + "comment": "Change angle" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36911,8 +42994,7 @@ "textG": 0, "textR": 0 }, - "comment": "Save movement to calculate drift", - "comment2": "" + "comment": "Save movement to calculate drift" }, { "type": "BuiltinCommonInstructions::Standard", @@ -36945,8 +43027,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 +43055,7 @@ "textG": 0, "textR": 0 }, - "comment": "Change position", - "comment2": "" + "comment": "Change position" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37044,8 +43124,7 @@ "textG": 0, "textR": 0 }, - "comment": "Save movement to calculate drift", - "comment2": "" + "comment": "Save movement to calculate drift" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37087,8 +43166,7 @@ "textG": 0, "textR": 0 }, - "comment": "Change angle", - "comment2": "" + "comment": "Change angle" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37127,8 +43205,7 @@ "textG": 0, "textR": 0 }, - "comment": "Save movement to calculate drift", - "comment2": "" + "comment": "Save movement to calculate drift" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37178,8 +43255,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 +43340,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 +43437,7 @@ "textG": 0, "textR": 0 }, - "comment": "Reset drift detection variables", - "comment2": "" + "comment": "Reset drift detection variables" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37536,13 +43610,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 +43641,7 @@ "textG": 0, "textR": 0 }, - "comment": "Start/Reset duration timer", - "comment2": "" + "comment": "Start/Reset duration timer" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37595,8 +43668,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 +43682,7 @@ "Object", "__ShakeObject_Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -37621,7 +43693,7 @@ "Object", "__ShakeObject_PowerX", "=", - "GetArgumentAsNumber(\"PowerX\")" + "PowerX" ] }, { @@ -37632,7 +43704,7 @@ "Object", "__ShakeObject_PowerY", "=", - "GetArgumentAsNumber(\"PowerY\")" + "PowerY" ] }, { @@ -37643,7 +43715,7 @@ "Object", "__ShakeObject_PowerAngle", "=", - "GetArgumentAsNumber(\"PowerAngle\")" + "PowerAngle" ] }, { @@ -37654,7 +43726,7 @@ "Object", "__ShakeObject_PowerScale", "=", - "GetArgumentAsNumber(\"PowerScale\")" + "PowerScale" ] }, { @@ -37665,7 +43737,7 @@ "Object", "__ShakeObject_TimeBetweenShakes", "=", - "GetArgumentAsNumber(\"TimeBetweenShakes\")" + "TimeBetweenShakes" ] } ] @@ -37680,8 +43752,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 +43805,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 +43875,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 +43916,7 @@ "textG": 0, "textR": 0 }, - "comment": "Detect initial shake", - "comment2": "" + "comment": "Detect initial shake" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37889,8 +43957,7 @@ "textG": 0, "textR": 0 }, - "comment": "Initiate the onScenePostEvents function", - "comment2": "" + "comment": "Initiate the onScenePostEvents function" }, { "type": "BuiltinCommonInstructions::Standard", @@ -37917,7 +43984,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -37938,6 +44004,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 +44020,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 +44084,7 @@ "textG": 0, "textR": 0 }, - "comment": "Keep object shaking forever (if desired)", - "comment2": "" + "comment": "Keep object shaking forever (if desired)" }, { "type": "BuiltinCommonInstructions::Standard", @@ -38075,8 +44142,7 @@ "textG": 0, "textR": 0 }, - "comment": "Run once before every shake movement", - "comment2": "" + "comment": "Run once before every shake movement" }, { "type": "BuiltinCommonInstructions::Standard", @@ -38154,8 +44220,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", @@ -38260,10 +44325,11 @@ "actions": [ { "type": { - "value": "ChangeScale" + "value": "ScalableCapability::ScalableBehavior::SetValue" }, "parameters": [ "Object", + "Scale", "-", "Object.Variable(__ShakeObject_ScaleTravelled)" ] @@ -38280,8 +44346,7 @@ "textG": 0, "textR": 0 }, - "comment": "Reset drift detection variables", - "comment2": "" + "comment": "Reset drift detection variables" }, { "type": "BuiltinCommonInstructions::Standard", @@ -38346,8 +44411,7 @@ "textG": 0, "textR": 0 }, - "comment": "Calculate Position Shake", - "comment2": "" + "comment": "Calculate Position Shake" }, { "type": "BuiltinCommonInstructions::Standard", @@ -38395,8 +44459,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", @@ -38408,8 +44471,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", @@ -38498,8 +44560,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", @@ -38590,8 +44651,7 @@ "textG": 0, "textR": 0 }, - "comment": "Calculate Rotation (angle) shake ", - "comment2": "" + "comment": "Calculate Rotation (angle) shake " }, { "type": "BuiltinCommonInstructions::Standard", @@ -38620,8 +44680,7 @@ "textG": 0, "textR": 0 }, - "comment": "Every \"even\" shake, rotate clockwise", - "comment2": "" + "comment": "Every \"even\" shake, rotate clockwise" }, { "type": "BuiltinCommonInstructions::Comment", @@ -38633,8 +44692,7 @@ "textG": 0, "textR": 0 }, - "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude", - "comment2": "" + "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude" }, { "type": "BuiltinCommonInstructions::Standard", @@ -38674,8 +44732,7 @@ "textG": 0, "textR": 0 }, - "comment": "Every \"odd\" shake, rotate counter-clockwise", - "comment2": "" + "comment": "Every \"odd\" shake, rotate counter-clockwise" }, { "type": "BuiltinCommonInstructions::Comment", @@ -38687,8 +44744,7 @@ "textG": 0, "textR": 0 }, - "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude", - "comment2": "" + "comment": "AngleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude" }, { "type": "BuiltinCommonInstructions::Standard", @@ -38730,8 +44786,7 @@ "textG": 0, "textR": 0 }, - "comment": "Calculate Scale shake", - "comment2": "" + "comment": "Calculate Scale shake" }, { "type": "BuiltinCommonInstructions::Standard", @@ -38760,8 +44815,7 @@ "textG": 0, "textR": 0 }, - "comment": "Calculate object scale displacement, with linear decay over time", - "comment2": "" + "comment": "Calculate object scale displacement, with linear decay over time" }, { "type": "BuiltinCommonInstructions::Comment", @@ -38773,8 +44827,7 @@ "textG": 0, "textR": 0 }, - "comment": "ScaleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * 1/100", - "comment2": "" + "comment": "ScaleDisplacement = (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * 1/100" }, { "type": "BuiltinCommonInstructions::Comment", @@ -38786,8 +44839,7 @@ "textG": 0, "textR": 0 }, - "comment": "Every even shake, increase scale", - "comment2": "" + "comment": "Every even shake, increase scale" }, { "type": "BuiltinCommonInstructions::Standard", @@ -38827,8 +44879,7 @@ "textG": 0, "textR": 0 }, - "comment": "Every \"odd\" shake, decrease scale", - "comment2": "" + "comment": "Every \"odd\" shake, decrease scale" }, { "type": "BuiltinCommonInstructions::Comment", @@ -38840,8 +44891,7 @@ "textG": 0, "textR": 0 }, - "comment": "ScaleDisplacement = -1 * (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * 1/100", - "comment2": "" + "comment": "ScaleDisplacement = -1 * (DesiredDuration - RunningTimer) / DesiredDuration * Amplitude * 1/100" }, { "type": "BuiltinCommonInstructions::Standard", @@ -38883,8 +44933,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", @@ -38927,8 +44976,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", @@ -38957,8 +45005,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", @@ -38987,8 +45034,7 @@ "textG": 0, "textR": 0 }, - "comment": "Change position", - "comment2": "" + "comment": "Change position" }, { "type": "BuiltinCommonInstructions::Standard", @@ -39057,8 +45103,7 @@ "textG": 0, "textR": 0 }, - "comment": "Save movement to calculate drift", - "comment2": "" + "comment": "Save movement to calculate drift" }, { "type": "BuiltinCommonInstructions::Standard", @@ -39100,8 +45145,7 @@ "textG": 0, "textR": 0 }, - "comment": "Change angle", - "comment2": "" + "comment": "Change angle" }, { "type": "BuiltinCommonInstructions::Standard", @@ -39140,8 +45184,7 @@ "textG": 0, "textR": 0 }, - "comment": "Save movement to calculate drift", - "comment2": "" + "comment": "Save movement to calculate drift" }, { "type": "BuiltinCommonInstructions::Standard", @@ -39172,8 +45215,7 @@ "textG": 0, "textR": 0 }, - "comment": "Change scale", - "comment2": "" + "comment": "Change scale" }, { "type": "BuiltinCommonInstructions::Standard", @@ -39192,10 +45234,11 @@ "actions": [ { "type": { - "value": "ChangeScale" + "value": "ScalableCapability::ScalableBehavior::SetValue" }, "parameters": [ "Object", + "Scale", "+", "round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" ] @@ -39212,8 +45255,7 @@ "textG": 0, "textR": 0 }, - "comment": "Save movement to calculate drift", - "comment2": "" + "comment": "Save movement to calculate drift" }, { "type": "BuiltinCommonInstructions::Standard", @@ -39237,1239 +45279,4419 @@ ] }, { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "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": { + "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_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" + }, + { + "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" + }, + { + "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" + }, + "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" + }, + { + "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" + }, + "parameters": [ + "Object", + "__ShakeObject_ScaleTravelled", + "-", + "round(1024 * Object.Variable(__ShakeObject_DisplacementScale) * Object.Variable(__ShakeObject_PercentTimeElapsedThisFrame)) / 1024" + ] + } + ] + } + ] + } + ] + } + ], + "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" + }, + "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": [] + } + ] + } + ], + "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", + "\"\"", + "" + ] + } + ] + }, + { + "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" }, - "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" + ] + } + ], + "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" ] } - ], - "parameters": [] + ] } ] } - ], - "parameters": [] + ] + } + ], + "variables": [ + { + "folded": true, + "name": "AmplitudeX", + "type": "number", + "value": 0 }, { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Stop shaking", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "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": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Layer.Shakable", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraDeltaX", + "=", + "Layer.CameraDeltaX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraDeltaY", + "=", + "Layer.CameraDeltaY" + ] + }, + { + "type": { + "value": "SetNumberVariable" }, - "comment": "Stop shaking when the duration has been reached (or if the stop shaking function was called)", - "comment2": "" + "parameters": [ + "CameraDeltaAngle", + "=", + "Layer.CameraDeltaAngle" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "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" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Determine if the shake should keep going until stopped" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShakeForever\"" + ] } ], - "parameters": [] + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "1234567890" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Add default values if none were provided" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Duration", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "0.5" + ] + } + ] } ], - "parameters": [ + "parameters": [] + } + ], + "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" + ] }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngleScale", - "type": "behavior" + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "1234567890" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StartEaseDuration", + "=", + "EaseDuration" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Ease duration (in seconds)", + "name": "EaseDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Stop shaking the camera.", + "fullName": "Stop camera shaking", + "functionType": "Action", + "name": "StopShaking", + "sentence": "Stop shaking the camera with _PARAM1_ seconds of easing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Duration", + "=", + "EaseDuration" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StopEaseDuration", + "=", + "EaseDuration" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Ease duration (in seconds)", + "name": "EaseDuration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Mark a layer as shakable.", + "fullName": "Shakable layer", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetLayerShakable", + "sentence": "Mark the layer: _PARAM2_ as shakable: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "NewLayerName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "NewLayerName", + "=", + "\"\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Shakable\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "Layers[LayerName].Shakable", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Shakable\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "Layers[LayerName].Shakable", + "True", + "" + ] + } + ] + } + ], + "parameters": [ + { + "defaultValue": "yes", + "description": "Shakable", + "name": "Shakable", + "optional": true, + "type": "yesorno" + }, + { + "description": "Layer", + "name": "NewLayerName", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the camera is shaking.", + "fullName": "Camera is shaking", + "functionType": "Condition", + "name": "IsShaking", + "sentence": "Camera is shaking", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Time", + "<", + "Duration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "Change the translation amplitude of the shaking (in pixels).", + "fullName": "Layer translation amplitude", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetLayerTranslationAmplitude", + "sentence": "Change the translation amplitude of the shaking to _PARAM1_; _PARAM2_ (layer: _PARAM3_)", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "NewLayerName" + ] } - ], - "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ShakeObject::ShakeObject_PositionAngleScale::IsShaking" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_ShakeInProgress", - "=", - "-1" - ] - } + "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": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].AmplitudeX", + "=", + "AmplitudeX" + ] }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ShakeObject::ShakeObject_PositionAngleScale", - "type": "behavior" + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].AmplitudeY", + "=", + "AmplitudeY" + ] } - ], - "objectGroups": [] + ] + } + ], + "parameters": [ + { + "description": "Amplitude of shaking on the X axis (in pixels)", + "name": "AmplitudeX", + "type": "expression" }, { - "description": "Check if an object is shaking.", - "fullName": "Check if an object is shaking", - "functionType": "Condition", - "name": "IsShaking", - "sentence": "_PARAM0_ is shaking", - "events": [ + "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Object", - "__ShakeObject_ShakeInProgress", - "=", - "1" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "NewLayerName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "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": "" - }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetGlobalVariableAsBoolean" - }, - "parameters": [ - "__CameraShake_ShakeForever", - "False" - ] - } + "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::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"ShakeForever\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetGlobalVariableAsBoolean" - }, - "parameters": [ - "__CameraShake_ShakeForever", - "True" - ] - } + "type": { + "value": "SetStringVariable" + }, + "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": "Add default values if none were provided", - "comment2": "" - }, + "parameters": [ + "NewLayerName", + "=", + "\"\"" + ] + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_Duration", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_Duration", - "=", - "0.5" - ] - } + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_TimeBetweenShakes", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_TimeBetweenShakes", - "=", - "0.08" - ] - } + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].Frequency", + "=", + "Frequency" ] - }, + } + ] + } + ], + "parameters": [ + { + "description": "Frequency", + "name": "Frequency", + "type": "expression" + }, + { + "description": "NewLayerName", + "name": "NewLayerName", + "type": "layer" + } + ], + "objectGroups": [] + }, + { + "description": "Change the default translation amplitude of the shaking (in pixels).", + "fullName": "Default translation amplitude", + "functionType": "Action", + "group": "Camera shake configuration", + "name": "SetDefaultTranslationAmplitude", + "sentence": "Change the default translation amplitude of the shaking to _PARAM1_; _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "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": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_Duration", - "<", - "GlobalVariable(__CameraShake_TimeBetweenShakes)" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_Duration", - "=", - "GlobalVariable(__CameraShake_TimeBetweenShakes)" - ] - } + "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": "Angle rotation amplitude (degrees) (For example: 2)", - "name": "PowerAngle", + "description": "X coordinate", + "name": "X", "type": "expression" }, { - "description": "Zoom amplitude (percent change) (For example: 3)", - "name": "PowerZoom", + "description": "Y coordinate", + "name": "Y", "type": "expression" }, { - "description": "Amount of time between shakes (seconds) (Default: 0.08)", - "name": "TimeBetweenShakes", + "description": "Z coordinate", + "name": "Z", "type": "expression" }, { - "description": "Keep shaking until stopped", - "longDescription": "Duration value will be ignored", - "name": "ShakeForever", - "type": "yesorno" + "description": "W coordinate", + "name": "W", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Create a noise generator with default settings (frequency = 1, octaves = 1, persistence = 0.5, lacunarity = 2).", + "fullName": "Create a noise generator", + "functionType": "Action", + "name": "Create", + "private": true, + "sentence": "Create a noise generator named _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Delete a noise generator and loose its settings.", + "fullName": "Delete a noise generator", + "functionType": "Action", + "name": "Delete", + "private": true, + "sentence": "Delete _PARAM1_ noise generator", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.deleteGenerator(name);" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Delete all noise generators and loose their settings.", + "fullName": "Delete all noise generators", + "functionType": "Action", + "name": "DeleteAll", + "private": true, + "sentence": "Delete all noise generators", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "gdjs._cameraShakeExtension.noiseManager.deleteAllGenerators();", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "description": "The seed is a number used to generate the random noise. Setting the same seed will result in the same random noise generation. It's for example useful to generate the same world, by saving this seed value and reusing it later to generate again a world.", + "fullName": "Noise seed", + "functionType": "Action", + "name": "SetSeed", + "private": true, + "sentence": "Change the noise seed to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "gdjs._cameraShakeExtension.noiseManager.setSeed(eventsFunctionContext.getArgument(\"Seed\"));", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Seed", + "longDescription": "15 digits numbers maximum", + "name": "Seed", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Change the looping period on X used for noise generation. The noise will wrap-around on X.", + "fullName": "Noise looping period on X", + "functionType": "Action", + "name": "SetLoopPeriodX", + "private": true, + "sentence": "Change the looping period on X of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).xLoopPeriod = eventsFunctionContext.getArgument(\"LoopPeriod\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Looping period on X", + "name": "LoopPeriod", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the looping period on Y used for noise generation. The noise will wrap-around on Y.", + "fullName": "Noise looping period on Y", + "functionType": "Action", + "name": "SetLoopPeriodY", + "private": true, + "sentence": "Change the looping period on Y of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).yLoopPeriod = eventsFunctionContext.getArgument(\"LoopPeriod\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "parameters": [ + { + "description": "Looping period on Y", + "name": "LoopPeriod", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the base frequency used for noise generation. A lower frequency will zoom in the noise.", + "fullName": "Noise base frequency", + "functionType": "Action", + "name": "SetFrequency", + "private": true, + "sentence": "Change the noise frequency of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).frequency = eventsFunctionContext.getArgument(\"Frequency\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Frequency", + "name": "Frequency", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the number of octaves used for noise generation. It can be seen as layers of noise with different zoom.", + "fullName": "Noise octaves", + "functionType": "Action", + "name": "SetOctaves", + "private": true, + "sentence": "Change the number of noise octaves of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).octaves = eventsFunctionContext.getArgument(\"Octaves\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Octaves", + "name": "Octaves", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the persistence used for noise generation. At its default value \"0.5\", it halves the noise amplitude at each octave.", + "fullName": "Noise persistence", + "functionType": "Action", + "name": "SetPersistence", + "private": true, + "sentence": "Change the noise persistence of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).persistence = eventsFunctionContext.getArgument(\"Persistence\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Persistence", + "name": "Persistence", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "Change the lacunarity used for noise generation. At its default value \"2\", it doubles the frequency at each octave.", + "fullName": "Noise lacunarity", + "functionType": "Action", + "name": "SetLacunarity", + "private": true, + "sentence": "Change the noise lacunarity of _PARAM2_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "gdjs._cameraShakeExtension.noiseManager.getGenerator(name).lacunarity = eventsFunctionContext.getArgument(\"Lacunarity\");" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [ + { + "description": "Lacunarity", + "name": "Lacunarity", + "type": "expression" + }, + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "The seed used for noise generation.", + "fullName": "Noise seed", + "functionType": "Expression", + "name": "Seed", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.seed;", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [], + "objectGroups": [] + }, + { + "description": "The base frequency used for noise generation.", + "fullName": "Noise base frequency", + "functionType": "Expression", + "name": "Frequency", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).frequency;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "The number of octaves used for noise generation.", + "fullName": "Noise octaves number", + "functionType": "Expression", + "name": "Octaves", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).octaves;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" + } + ], + "objectGroups": [] + }, + { + "description": "The persistence used for noise generation.", + "fullName": "Noise persistence", + "functionType": "Expression", + "name": "Persistence", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const name = eventsFunctionContext.getArgument(\"Name\");\r", + "\r", + "eventsFunctionContext.returnValue = gdjs._cameraShakeExtension.noiseManager.getGenerator(name).persistence;" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Generator name", + "name": "Name", + "type": "string" } ], "objectGroups": [] }, { - "fullName": "", - "functionType": "Action", - "name": "onScenePostEvents", - "sentence": "", - "events": [ + "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": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Camera Shake", - "source": "", - "type": "BuiltinCommonInstructions::Group", + "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": [], + "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", @@ -40481,1872 +49703,6022 @@ "textG": 0, "textR": 0 }, - "comment": "Keep shaking forever (if desired)", - "comment2": "" + "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": "GlobalVariableAsBoolean" + "value": "ButtonStates::ButtonFSM::PropertyShouldCheckHovering" }, "parameters": [ - "__CameraShake_ShakeForever", - "True" + "Object", + "Behavior" + ] + }, + { + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "Object", + "MouseOnlyCursorX(Object.Layer(), 0)", + "MouseOnlyCursorY(Object.Layer(), 0)" ] } ], "actions": [ { "type": { - "value": "ModVarGlobal" + "value": "ButtonStates::ButtonFSM::SetPropertyMouseIsInside" }, "parameters": [ - "__CameraShake_Duration", - "=", - "100" + "Object", + "Behavior", + "yes" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Touches are always pressed, so ShouldCheckHovering doesn't matter." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { "type": { - "value": "ResetTimer" + "value": "ButtonStates::ButtonFSM::SetPropertyTouchIsInside" }, "parameters": [ - "", - "\"__CameraShake_DurationTimer\"" + "Object", + "Behavior", + "no" ] } ] }, { - "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": "ButtonStates::ButtonFSM::PropertyTouchId" }, - "comment": "Run once before every shake movement", - "comment2": "" + "parameters": [ + "Object", + "Behavior", + "!=", + "0" + ] }, { - "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" - ] - } - ], + "type": { + "value": "CollisionPoint" + }, + "parameters": [ + "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": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyIndex" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "StartedTouchOrMouseCount()", + "conditions": [], + "actions": [], "events": [ - { - "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" + "value": "CollisionPoint" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerX", - "!=", - "0" - ] - }, - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerY", - "!=", - "0" - ] - } + "parameters": [ + "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": "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": "" - }, + "actions": [ { - "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": { + "value": "ButtonStates::ButtonFSM::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "StartedTouchOrMouseId(Index)" ] }, { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyTouchIsInside" }, - "comment": "After initial shake pick a random direction", - "comment2": "" - }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ], + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "VarGlobal" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "__CameraShake_InitialShake", - "=", - "0" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerX", - "!=", - "0" - ] - } - ], - "actions": [ + "parameters": [], + "subInstructions": [ { "type": { - "value": "ModVarGlobal" + "value": "ButtonStates::ButtonFSM::PropertyState" }, "parameters": [ - "__CameraShake_DisplacementX", + "Object", + "Behavior", "=", - "(GlobalVariable(__CameraShake_Duration) - TimerElapsedTime(\"__CameraShake_DurationTimer\")) / GlobalVariable(__CameraShake_Duration) * GlobalVariable(__CameraShake_PowerX) * RandomWithStep(-1, 1, 2)" + "\"Hovered\"" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_PowerY", - "!=", - "0" - ] - } - ], - "actions": [ + }, { "type": { - "value": "ModVarGlobal" + "value": "ButtonStates::ButtonFSM::PropertyState" }, "parameters": [ - "__CameraShake_DisplacementY", + "Object", + "Behavior", "=", - "(GlobalVariable(__CameraShake_Duration) - TimerElapsedTime(\"__CameraShake_DurationTimer\")) / GlobalVariable(__CameraShake_Duration) * GlobalVariable(__CameraShake_PowerY) * RandomWithStep(-1, 1, 2)" + "\"Idle\"" ] } ] } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Calculate Rotation (angle) shake ", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_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 counter-clockwise", - "comment2": "" - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "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)" - ] - } - ] - }, - { - "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" + "value": "ButtonStates::ButtonFSM::SetPropertyState" }, "parameters": [ - "__CameraShake_DisplacementAngle", + "Object", + "Behavior", "=", - "-1 * (GlobalVariable(__CameraShake_Duration) - TimerElapsedTime(\"__CameraShake_DurationTimer\")) / GlobalVariable(__CameraShake_Duration) * GlobalVariable(__CameraShake_PowerAngle)" + "\"PressedInside\"" ] } ] } ] }, - { - "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": [ + "conditions": [], + "actions": [ { "type": { - "value": "VarGlobal" + "value": "ButtonStates::ButtonFSM::SetPropertyIndex" }, "parameters": [ - "__CameraShake_PowerZoom", - "!=", - "0" - ] - } - ], - "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" - }, - "parameters": [ - "mod(GlobalVariable(__CameraShake_ShakeCounter),2)", - "=", - "1" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_DisplacementZoom", - "=", - "(GlobalVariable(__CameraShake_Duration) - TimerElapsedTime(\"__CameraShake_DurationTimer\")) / GlobalVariable(__CameraShake_Duration) * GlobalVariable(__CameraShake_PowerZoom) * (1/100)" - ] - } + "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": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "inverted": true, + "value": "ButtonStates::ButtonFSM::PropertyState" }, - "comment": "Save that initial shake has been processed", - "comment2": "" - }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Validated\"" + ] + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_InitialShake", - "=", - "0" - ] - } + "type": { + "value": "ButtonStates::ButtonFSM::SetPropertyState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" ] } ] } - ], - "parameters": [] + ] + } + ], + "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", + "" + ] }, { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Move camera", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "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": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "ButtonStates::ButtonScaleTween::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::ButtonScaleTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" ] }, { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "ButtonStates::ButtonScaleTween::FadeIn" }, - "comment": "Increase change for the first half of the shake (move away from original values)", - "comment2": "" - }, + "parameters": [ + "Object", + "Behavior", + "FocusedScale", + "" + ] + } + ] + }, + { + "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::ButtonScaleTween::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::ButtonScaleTween::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::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", + "" + ] + }, + { + "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": { + "value": "ButtonStates::ButtonColorTintTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Idle\"" ] } ], - "parameters": [] + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::FadeIn" + }, + "parameters": [ + "Object", + "Behavior", + "FocusedColorTint", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::PropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Pressed\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyPreviousState" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Focused\"" + ] + }, + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::FadeOut" + }, + "parameters": [ + "Object", + "Behavior", + "FocusedColorTint", + "" + ] + } + ] + } + ] + }, + { + "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" }, { - "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-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": "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": "" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "Timer" - }, - "parameters": [ - "", - "GlobalVariable(__CameraShake_Duration)", - "\"__CameraShake_DurationTimer\"" - ] - }, - { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_ShakeInProgress", - "=", - "-1" - ] - } - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_ShakeInProgress", - "=", - "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 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" - ] - }, - { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_ShakeCounter", - "=", - "0" - ] - } - ] - } - ], - "parameters": [] - } + "parameters": [ + "FadeInEasing" ] } - ], - "parameters": [] + ] } ], - "parameters": [] - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Check if camera is shaking.", - "fullName": "Check if camera is shaking", - "functionType": "Condition", - "name": "IsShaking", - "sentence": " Camera is shaking", - "events": [ + "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": [] + }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "FadeInEasing", + "name": "SetFadeInEasing", + "sentence": "", + "events": [ { - "type": { - "value": "VarGlobal" - }, - "parameters": [ - "__CameraShake_ShakeInProgress", - "=", - "1" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ButtonStates::ButtonColorTintTween::SetPropertyFadeInEasing" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } ] } ], - "actions": [ + "parameters": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] + "description": "Object", + "name": "Object", + "supplementaryInformation": "Sprite", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ButtonStates::ButtonColorTintTween", + "type": "behavior" } - ] - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Stop shaking the camera.", - "fullName": "Stop shaking the camera", - "functionType": "Action", - "name": "StopShaking", - "sentence": "Stop shaking the camera", - "events": [ + ], + "objectGroups": [] + }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "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": { - "value": "CameraShake::IsShaking" - }, - "parameters": [ - "", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "FadeOutEasing" + ] + } ] } ], - "actions": [ + "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": [ { - "type": { - "value": "ModVarGlobal" - }, - "parameters": [ - "__CameraShake_ShakeInProgress", - "=", - "-1" + "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": [] } ], - "parameters": [], - "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": [] } ], - "eventsBasedBehaviors": [], "eventsBasedObjects": [] } ], - "externalLayouts": [], - "externalSourceFiles": [] + "externalLayouts": [] } \ No newline at end of file From f5affe8bd213c8b7fd1a6cacfe0389e094dd8eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 21 Jan 2025 13:21:09 +0100 Subject: [PATCH 06/15] [Platformer] Floating joystick --- examples/platformer/platformer.json | 11292 ++++++++++++++++++-------- 1 file changed, 7966 insertions(+), 3326 deletions(-) diff --git a/examples/platformer/platformer.json b/examples/platformer/platformer.json index c6047bd19..5bde842e7 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,7 +818,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/gui/black.png", "kind": "image", "metadata": "", @@ -1107,7 +1024,7 @@ "persistentUuid": "8e48ab68-c147-4828-9609-d7cc250c52a1", "width": 160, "x": 816, - "y": 432, + "y": 420, "zOrder": 28, "numberProperties": [], "stringProperties": [], @@ -1562,7 +1479,7 @@ "persistentUuid": "fcbc25c5-15d6-4b85-a6ec-08b9140c8cb7", "width": 160, "x": 144, - "y": 432, + "y": 420, "zOrder": 62, "numberProperties": [], "stringProperties": [], @@ -5730,7 +5647,8 @@ "TouchID": 0, "TouchDistance": 0, "TouchCounter": 0, - "IsReleased": false + "IsReleased": false, + "Radius": 160 } ], "animations": [ @@ -5952,6 +5870,66 @@ "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DepartScene" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Joystick" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Joystick", + "", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "SystemInfo::HasTouchScreen" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "MobileControls", + "" + ] + } + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -5966,6 +5944,33 @@ ], "actions": [], "events": [ + { + "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 +6037,6 @@ ] } ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "SystemInfo::HasTouchScreen" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Delete" - }, - "parameters": [ - "MobileControls", - "" - ] - } - ] } ], "parameters": [] @@ -8392,7 +8372,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 +10211,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 +11124,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 +12032,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"EnableAnimationChanges\"" + "\"Value\"" ] } ], @@ -12068,7 +12065,7 @@ { "defaultValue": "yes", "description": "Change animations automatically", - "name": "EnableAnimationChanges", + "name": "Value", "optional": true, "type": "yesorno" } @@ -12106,7 +12103,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"EnableHorizontalFlipping\"" + "\"Value\"" ] } ], @@ -12139,7 +12136,7 @@ { "defaultValue": "yes", "description": "Enable horizontal flipping", - "name": "EnableHorizontalFlipping", + "name": "Value", "optional": true, "type": "yesorno" } @@ -12166,7 +12163,7 @@ "Object", "Behavior", "=", - "AnimationName" + "Value" ] } ] @@ -12186,7 +12183,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -12212,7 +12209,7 @@ "Object", "Behavior", "=", - "AnimationName" + "Value" ] } ] @@ -12232,7 +12229,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -12258,7 +12255,7 @@ "Object", "Behavior", "=", - "AnimationName" + "Value" ] } ] @@ -12278,7 +12275,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -12304,7 +12301,7 @@ "Object", "Behavior", "=", - "AnimationName" + "Value" ] } ] @@ -12324,7 +12321,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -12350,7 +12347,7 @@ "Object", "Behavior", "=", - "AnimationName" + "Value" ] } ] @@ -12370,7 +12367,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -12490,7 +12487,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 +14859,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 +16397,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 +17147,7 @@ "Object", "Behavior", "=", - "TimeFromStart() + WaitingDuration" + "TimeFromStart() + NewWaitingDuration" ] }, { @@ -17161,7 +17158,7 @@ "Object", "Behavior", "=", - "WaitingSpeedXMax" + "NewWaitingSpeedXMax" ] }, { @@ -17172,7 +17169,7 @@ "Object", "Behavior", "=", - "WaitingSpeedYMax" + "NewWaitingSpeedYMax" ] }, { @@ -17183,7 +17180,7 @@ "Object", "Behavior", "=", - "CatchUpDuration" + "NewCatchUpDuration" ] } ] @@ -17220,22 +17217,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 +17605,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"FollowOnX\"" + "\"Value\"" ] } ], @@ -17640,7 +17637,7 @@ }, { "description": "Follow on X axis", - "name": "FollowOnX", + "name": "Value", "type": "yesorno" } ], @@ -17678,7 +17675,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"FollowOnY\"" + "\"Value\"" ] } ], @@ -17710,7 +17707,7 @@ }, { "description": "Follow on Y axis", - "name": "FollowOnY", + "name": "Value", "type": "yesorno" } ], @@ -17736,7 +17733,7 @@ "Object", "Behavior", "=", - "max(0, SetFollowFreeAreaRight)" + "max(0, Value)" ] } ] @@ -17756,7 +17753,7 @@ }, { "description": "Follow free area right border", - "name": "SetFollowFreeAreaRight", + "name": "Value", "type": "expression" } ], @@ -17782,7 +17779,7 @@ "Object", "Behavior", "=", - "max(0, SetFollowFreeAreaLeft)" + "max(0, Value)" ] } ] @@ -17802,7 +17799,7 @@ }, { "description": "Follow free area left border", - "name": "SetFollowFreeAreaLeft", + "name": "Value", "type": "expression" } ], @@ -17828,7 +17825,7 @@ "Object", "Behavior", "=", - "max(0, FollowFreeAreaTop)" + "max(0, Value)" ] } ] @@ -17848,7 +17845,7 @@ }, { "description": "Follow free area top border", - "name": "FollowFreeAreaTop", + "name": "Value", "type": "expression" } ], @@ -17874,7 +17871,7 @@ "Object", "Behavior", "=", - "max(0, SetFollowFreeAreaBottom)" + "max(0, Value)" ] } ] @@ -17894,7 +17891,7 @@ }, { "description": "Follow free area bottom border", - "name": "SetFollowFreeAreaBottom", + "name": "Value", "type": "expression" } ], @@ -17920,7 +17917,7 @@ "Object", "Behavior", "=", - "max(0, Speed)" + "max(0, Value)" ] } ] @@ -17940,7 +17937,7 @@ }, { "description": "Leftward maximum speed (in ratio per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -17966,7 +17963,7 @@ "Object", "Behavior", "=", - "max(0, Speed)" + "max(0, Value)" ] } ] @@ -17986,7 +17983,7 @@ }, { "description": "Rightward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -18012,7 +18009,7 @@ "Object", "Behavior", "=", - "max(0, Speed)" + "max(0, Value)" ] } ] @@ -18032,7 +18029,7 @@ }, { "description": "Upward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -18058,7 +18055,7 @@ "Object", "Behavior", "=", - "max(0, Speed)" + "max(0, Value)" ] } ] @@ -18078,7 +18075,7 @@ }, { "description": "Downward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -18104,7 +18101,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, LeftwardSpeed)" + "clamp(0, 1, Value)" ] }, { @@ -18115,7 +18112,7 @@ "Object", "Behavior", "=", - "log(1 - LeftwardSpeed)" + "log(1 - Value)" ] } ] @@ -18135,7 +18132,7 @@ }, { "description": "Leftward catch-up speed (in ratio per second)", - "name": "LeftwardSpeed", + "name": "Value", "type": "expression" } ], @@ -18161,7 +18158,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, RightwardSpeed)" + "clamp(0, 1, Value)" ] }, { @@ -18172,7 +18169,7 @@ "Object", "Behavior", "=", - "log(1 - RightwardSpeed)" + "log(1 - Value)" ] } ] @@ -18192,7 +18189,7 @@ }, { "description": "Rightward catch-up speed (in ratio per second)", - "name": "RightwardSpeed", + "name": "Value", "type": "expression" } ], @@ -18218,7 +18215,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, DownwardSpeed)" + "clamp(0, 1, Value)" ] }, { @@ -18229,7 +18226,7 @@ "Object", "Behavior", "=", - "log(1 - DownwardSpeed)" + "log(1 - Value)" ] } ] @@ -18249,7 +18246,7 @@ }, { "description": "Downward catch-up speed (in ratio per second)", - "name": "DownwardSpeed", + "name": "Value", "type": "expression" } ], @@ -18275,7 +18272,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, UpwardSpeed)" + "clamp(0, 1, Value)" ] }, { @@ -18286,7 +18283,7 @@ "Object", "Behavior", "=", - "log(1 - UpwardSpeed)" + "log(1 - Value)" ] } ] @@ -18306,7 +18303,7 @@ }, { "description": "Upward catch-up speed (in ratio per second)", - "name": "UpwardSpeed", + "name": "Value", "type": "expression" } ], @@ -18426,7 +18423,7 @@ "Object", "Behavior", "=", - "CameraOffsetX", + "Value", "" ] } @@ -18447,7 +18444,7 @@ }, { "description": "Camera offset X", - "name": "CameraOffsetX", + "name": "Value", "type": "expression" } ], @@ -18614,7 +18611,7 @@ "Object", "Behavior", "=", - "min(0, ForecastTime)" + "min(0, Value)" ] } ] @@ -18634,7 +18631,7 @@ }, { "description": "Forecast time", - "name": "ForecastTime", + "name": "Value", "type": "expression" } ], @@ -18660,7 +18657,7 @@ "Object", "Behavior", "=", - "min(0, CameraDelay)" + "min(0, Value)" ] } ] @@ -18680,7 +18677,7 @@ }, { "description": "Camera delay", - "name": "CameraDelay", + "name": "Value", "type": "expression" } ], @@ -21788,11 +21785,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 +21824,9 @@ }, "parameters": [ "ToSaveObject", - "__Checkpoints.Position[\"X\"+GetArgumentAsString(\"CheckpointName\")]", + "__Checkpoints.Position[\"X\"+CheckpointName]", "=", - "GetArgumentAsNumber(\"CoordinateX\")" + "CoordinateX" ] }, { @@ -21838,9 +21835,9 @@ }, "parameters": [ "ToSaveObject", - "__Checkpoints.Position[\"Y\"+GetArgumentAsString(\"CheckpointName\")]", + "__Checkpoints.Position[\"Y\"+CheckpointName]", "=", - "GetArgumentAsNumber(\"CoordinateY\")" + "CoordinateY" ] } ] @@ -21900,7 +21897,7 @@ "parameters": [ "ToLoadObject", "__Checkpoints.Position", - "\"X\" + GetArgumentAsString(\"CheckpointName\")" + "\"X\" + CheckpointName" ] }, { @@ -21910,7 +21907,7 @@ "parameters": [ "ToLoadObject", "__Checkpoints.Position", - "\"Y\" + GetArgumentAsString(\"CheckpointName\")" + "\"Y\" + CheckpointName" ] } ] @@ -21926,7 +21923,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"SetIgnoreUndefined\")", + "SetIgnoreUndefined", "!=", "\"true\"" ] @@ -21945,7 +21942,7 @@ "parameters": [ "ToLoadObject", "__Checkpoints.Position", - "\"Y\" + GetArgumentAsString(\"CheckpointName\")" + "\"Y\" + CheckpointName" ] }, { @@ -21956,7 +21953,7 @@ "parameters": [ "ToLoadObject", "__Checkpoints.Position", - "\"X\" + GetArgumentAsString(\"CheckpointName\")" + "\"X\" + CheckpointName" ] } ] @@ -21974,9 +21971,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 +22023,7 @@ "parameters": [ "ToCheckObject", "__Checkpoints.Position", - "\"Y\" + GetArgumentAsString(\"CheckpointName\")" + "\"Y\" + CheckpointName" ] }, { @@ -22036,7 +22033,7 @@ "parameters": [ "ToCheckObject", "__Checkpoints.Position", - "\"X\" + GetArgumentAsString(\"CheckpointName\")" + "\"X\" + CheckpointName" ] } ], @@ -22068,7 +22065,7 @@ "parameters": [ "ToCheckObject", "__Checkpoints.Position", - "\"X\" + GetArgumentAsString(\"CheckpointName\")" + "\"X\" + CheckpointName" ] }, { @@ -22079,7 +22076,7 @@ "parameters": [ "ToCheckObject", "__Checkpoints.Position", - "\"Y\" + GetArgumentAsString(\"CheckpointName\")" + "\"Y\" + CheckpointName" ] } ] @@ -22126,7 +22123,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,225 +22162,666 @@ "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::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" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] }, - { - "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", + "//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 stick = eventsFunctionContext.getArgument(\"stick\").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", + " return \"UNKNOWN_BUTTON\";\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", + "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", - "if (stick !== \"LEFT\" && stick !== \"RIGHT\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a stick force\"');\r", - " return;\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", - "const gamepad = gamepads[playerId];\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", - "//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", + " // 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", - "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", + " if (v == null) {\r", + " return 0;\r", + " } else {\r", + " return v;\r", + " }\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", + " } 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", - " default:\r", - " eventsFunctionContext.returnValue = -1;\r", - " break;\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": "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)", - "functionType": "Expression", - "name": "StickRotationValue", - "private": true, - "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", + "fullName": "", + "functionType": "Action", + "name": "onScenePostEvents", + "sentence": "", "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" + "actions": [] }, - { - "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", + "//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 stick = eventsFunctionContext.getArgument(\"stick\").toUpperCase();\r", - "\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 stick rotation\"');\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 stick rotation\"');\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 (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", + "switch (trigger) {\r", + " case 'LT':\r", + " case 'L2':\r", + " eventsFunctionContext.returnValue = gamepad.buttons[6].value;\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", + " case 'RT':\r", + " case 'R2':\r", + " eventsFunctionContext.returnValue = gamepad.buttons[7].value;\r", " break;\r", "\r", " default:\r", @@ -22406,21 +22844,20 @@ "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": "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_", + "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", @@ -22431,73 +22868,254 @@ "//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", "\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", + " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a stick force\"');\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", + "\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", - "let parameterError = false;\r", + "\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", + " 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", - " 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", + " 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", @@ -23844,210 +24462,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 +25433,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 +25465,77 @@ "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": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "GamepadIdentifier", - "\"Up\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "TopDownMovementBehavior::SimulateUpKey" - }, - "parameters": [ - "Object", - "TopDownMovement" - ] - } + "type": { + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"A or Cross\"" ] }, { - "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", + "\"A\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" ] } ] @@ -25176,203 +25545,73 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseLeftStick" + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" }, "parameters": [ "Object", - "Behavior" + "Behavior", + "=", + "\"B or Circle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"B\"", + "\"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": "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::Platformer3DGamepadMapper::PropertyJumpButton" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"X or Square\"" ] }, { - "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", + "\"X\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" ] } ] @@ -25382,203 +25621,187 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseRightStick" + "value": "Gamepads::Platformer3DGamepadMapper::PropertyJumpButton" }, "parameters": [ "Object", - "Behavior" + "Behavior", + "=", + "\"Y or Triangle\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Y\"", + "\"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", + "=", + "\"LB or L1\"" ] }, { - "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", + "\"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": "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", + "\"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" ] } ] @@ -25595,7 +25818,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Gamepads::TopDownGamepadMapper", + "supplementaryInformation": "Gamepads::Platformer3DGamepadMapper", "type": "behavior" } ], @@ -25606,13 +25829,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,310 +25847,3556 @@ "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", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarSceneTxt" - }, - "parameters": [ - "__MultitouchJoystick.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": "VarSceneTxt" - }, - "parameters": [ - "__MultitouchJoystick.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": "ModVarSceneTxt" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Buttons[Button].State", - "=", - "ButtonState" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Button name", - "name": "Button", - "type": "string" - }, - { - "description": "Button state", - "name": "ButtonState", - "supplementaryInformation": "[\"Idle\",\"Pressed\",\"Released\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Change the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", - "fullName": "Dead zone radius", - "functionType": "Action", - "name": "SetDeadZone", - "private": true, - "sentence": "Change the dead zone of multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", - "=", - "DeadZoneRadius" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "type": "string" - }, - { - "description": "Dead zone radius", - "name": "DeadZoneRadius", - "supplementaryInformation": "[]", - "type": "expression" - } - ], - "objectGroups": [] }, { - "description": "Return the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", - "fullName": "Dead zone radius", - "functionType": "Expression", - "name": "DeadZone", - "private": true, - "sentence": "Change multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ dead zone to _PARAM3_", - "events": [ + "description": "Control a 3D physics character with a gamepad.", + "fullName": "3D shooter gamepad mapper", + "name": "Shooter3DGamepadMapper", + "objectType": "", + "eventsFunctions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Variable(__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone)" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, + "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...)", @@ -25937,1103 +29406,2000 @@ { "description": "Joystick name", "name": "JoystickIdentifier", - "type": "string" + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" } ], "objectGroups": [] }, { - "description": "the direction index (left = 1, bottom = 1, right = 2, top = 3) for an angle (in degrees).", - "fullName": "Angle to 4-way index", + "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": "AngleTo4Way", + "name": "JoystickForce", "private": true, - "sentence": "The angle _PARAM1_ 4-way index", + "sentence": "Joystick _PARAM2_ of multitouch controller _PARAM1_ force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + }, + { + "description": "", + "name": "Coucou", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the force of multitouch contoller stick (from 0 to 1).", + "fullName": "Stick force", + "functionType": "ExpressionAndCondition", + "name": "StickForce", + "sentence": "multitouch controller _PARAM1_ _PARAM2_ stick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "max(0, Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier)) / (1 - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Stick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Change the percentage the thumb has been pulled away from the joystick center (Range: 0 to 1).", + "fullName": "Joystick force", + "functionType": "Action", + "name": "SetJoystickForce", + "private": true, + "sentence": "Change the force of the joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "type": "string" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the joystick is pointing towards (Range: -180 to 180).", + "fullName": "Joystick angle (deprecated)", + "functionType": "Expression", + "name": "JoystickAngle", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the multitouch controller stick is pointing towards (Range: -180 to 180).", + "fullName": "Stick angle", + "functionType": "Expression", + "name": "StickAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Change the angle the joystick is pointing towards (Range: -180 to 180).", + "fullName": "Joystick angle", + "functionType": "Action", + "name": "SetJoystickAngle", + "private": true, + "sentence": "Change the angle of the joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "type": "string" + }, + { + "description": "Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the multitouch contoller stick force on X axis (from -1 at the left to 1 at the right).", + "fullName": "Stick X force", + "functionType": "Expression", + "name": "StickForceX", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "XFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Return the multitouch contoller stick force on Y axis (from -1 at the top to 1 at the bottom).", + "fullName": "Stick Y force", + "functionType": "Expression", + "name": "StickForceY", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "mod(round(Angle * 4 / 360), 4)" + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "YFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", + "type": "expression" + }, + { + "description": "Joystick name", + "name": "JoystickIdentifier", + "supplementaryInformation": "[\"Primary\",\"Secondary\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a new touch has started on the right or left side of the screen.", + "fullName": "New touch on a screen side", + "functionType": "Condition", + "group": "Multitouch Joystick", + "name": "HasTouchStartedOnScreenSide", + "sentence": "A new touch has started on the _PARAM2_ side of the screen on _PARAM1_'s layer", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "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" + ] + } ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { - "description": "Angle", - "name": "Angle", - "type": "expression" + "description": "Multitouch joystick", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "objectList" + }, + { + "description": "Screen side", + "name": "Side", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" } ], "objectGroups": [] - }, + } + ], + "eventsBasedBehaviors": [ { - "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", + "description": "Joystick that can be controlled by interacting with a touchscreen.", + "fullName": "Multitouch Joystick", + "name": "MultitouchJoystick", + "objectType": "", "private": true, - "sentence": "The angle _PARAM1_ 8-way index", - "events": [ + "eventsFunctions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "mod(round(Angle * 8 / 360), 8)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SetDeadZone" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "DeadZoneRadius", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } ] } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, { - "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": [ + "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": [] + }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Right\"" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasGameJustResumed" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } ] }, { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" - }, - "parameters": [ - "", - "=", - "0", - "Angle", - "" + "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)" + ] + } ] } ], - "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": [] + }, + { + "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", + "" + ] + } ] } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + ], + "parameters": [ { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Down\"" - ] + "description": "Object", + "name": "Object", + "type": "object" }, { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" - }, - "parameters": [ - "", - "=", - "1", - "Angle", - "" - ] - } - ], - "actions": [ + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + }, { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] + "description": "", + "name": "Parameter", + "type": "objectList" } - ] + ], + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Left\"" - ] - }, + "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": [ - "", - "=", - "2", - "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" } - ] + ], + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Up\"" - ] - }, + "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::AngleTo4Way" - }, - "parameters": [ - "", - "=", - "3", - "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": [ { - "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": [ + "description": "Object", + "name": "Object", + "type": "object" + }, { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Right\"" - ] + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" }, { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "0", - "Angle", - "" - ] + "description": "Angle", + "name": "Value", + "type": "expression" } ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] + "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" - ] + "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": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"Left\"" - ] - }, + "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": [ - "", - "=", - "4", - "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", - "=", - "\"UpLeft\"" - ] + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" }, { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "5", - "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", - "=", - "\"Up\"" - ] - }, + "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": [ - "", - "=", - "6", - "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" } - ] + ], + "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": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "Direction", - "=", - "\"UpRight\"" + "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::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "7", - "Angle", - "" - ] + "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": "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 + ], + "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::IsAngleIn4WayDirection" - }, - "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" - }, - { - "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" + "objectGroups": [] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::JoystickForce" - }, - "parameters": [ - "", - ">", - "0", - "ControllerIdentifier", - "JoystickIdentifier", - "" - ] - }, + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ControllerIdentifier", + "name": "SetControllerIdentifier", + "sentence": "", + "events": [ { - "type": { - "value": "SpriteMultitouchJoystick::IsAngleIn8WayDirection" - }, - "parameters": [ - "", - "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", - "Direction", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyControllerIdentifier" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } ] } ], - "actions": [ + "parameters": [ { - "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": [ + "description": "Object", + "name": "Object", + "type": "object" + }, { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" - ] + "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", + "description": "the joystick name.", + "fullName": "Joystick name", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", "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": [ + "sentence": "the joystick name", + "events": [ { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "max(0, Variable(__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force) - SpriteMultitouchJoystick::DeadZone(ControllerIdentifier, JoystickIdentifier)) / (1 - SpriteMultitouchJoystick::DeadZone(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" + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "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": [ + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JoystickIdentifier", + "name": "SetJoystickIdentifier", + "sentence": "", + "events": [ { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", - "=", - "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" + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "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": [ + "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::StickAngle(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": [] - }, - { - "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": [ + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DeadZoneRadius", + "name": "SetDeadZoneRadius", + "sentence": "", + "events": [ { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Variable(__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyDeadZoneRadius" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SetDeadZone" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "Value", + "" + ] + } ] } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "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": [] - }, - { - "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": [ + "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": { - "value": "ModVarScene" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle", - "=", - "Value" + "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": [] } ], - "parameters": [ + "propertyDescriptors": [ { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "description": "", + "group": "", + "extraInformation": [], + "name": "ControllerIdentifier" }, { - "description": "Joystick name", - "name": "JoystickIdentifier", - "type": "string" + "value": "Primary", + "type": "String", + "label": "Joystick name", + "description": "", + "group": "", + "extraInformation": [], + "name": "JoystickIdentifier" }, { - "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": [ + "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" + }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "SpriteMultitouchJoystick::JoystickForce(ControllerIdentifier, JoystickIdentifier) * cos(ToRad(SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)))" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ + "value": "0", + "type": "Number", + "label": "Joystick angle (range: -180 to 180)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "JoystickAngle" + }, { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" + "value": "0", + "type": "Number", + "label": "Joystick force (range: 0 to 1)", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "JoystickForce" }, { - "description": "Joystick name", - "name": "JoystickIdentifier", - "supplementaryInformation": "[\"Primary\",\"Secondary\"]", - "type": "stringWithSelector" + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchId" + }, + { + "value": "", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "TouchIndex" } ], - "objectGroups": [] + "sharedPropertyDescriptors": [] }, { - "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": [ + "description": "Detect button presses made on a touchscreen.", + "fullName": "Multitouch button", + "name": "MultitouchButton", + "objectType": "", + "eventsFunctions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "SpriteMultitouchJoystick::JoystickForce(ControllerIdentifier, JoystickIdentifier) * sin(ToRad(SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)))" + "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": "BuiltinCommonInstructions::Or" + }, + "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()))" + ] + } + ] + } + ], + "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" + ] + } + ] + } + ] + } ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "supplementaryInformation": "[\"Primary\",\"Secondary\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - } - ], - "eventsBasedBehaviors": [ - { - "description": "Joystick that can be controlled by interacting with a touchscreen.", - "fullName": "Multitouch Joystick", - "name": "MultitouchJoystick", - "objectType": "", - "private": true, - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ + }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::SetDeadZone" + "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" }, "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "DeadZoneRadius", + "Object", + "Behavior", "" ] }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + "value": "HasTouchEnded" + }, + "parameters": [ + "", + "TouchId" + ] + } + ], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" }, "parameters": [ "Object", "Behavior", + "\"Released\"", "" ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyIsReleased" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "0" + ] } ] } @@ -27047,30 +31413,39 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "", - "functionType": "Action", - "name": "onDeActivate", - "sentence": "", + "description": "Check if button is released.", + "fullName": "Button released", + "functionType": "Condition", + "name": "IsReleased", + "sentence": "Button _PARAM0_ is released", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyIsReleased" }, "parameters": [ "Object", - "Behavior", - "" + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" ] } ] @@ -27085,237 +31460,44 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchButton", "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", + "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": "HasGameJustResumed" + "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyTouchId" }, "parameters": [ - "" + "Object", + "Behavior", + "!=", + "0" ] } ], "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "Behavior", - "" + "True" ] } ] - }, - { - "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": [ @@ -27327,18 +31509,18 @@ { "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", + "fullName": "Button state", + "functionType": "Action", + "name": "SetButtonState", + "private": true, + "sentence": "Mark the button _PARAM0_ as _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -27346,18 +31528,19 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::SetButtonState" }, "parameters": [ - "max(0, JoystickForce - DeadZoneRadius) / (1 - DeadZoneRadius)" + "", + "ControllerIdentifier", + "ButtonIdentifier", + "ButtonState", + "" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -27367,228 +31550,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" + }, + { + "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": "ActionWithOperator", - "getterName": "JoystickForce", - "name": "SetJoystickForce", - "private": true, + "functionType": "Action", + "name": "doStepPreEvents", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Left\"", + "" + ] + } + ], "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickForce" + "value": "PlatformBehavior::SimulateLeftKey" }, "parameters": [ "Object", - "Behavior", - "=", - "Value" + "Property" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::SetJoystickForce" + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" }, "parameters": [ "", "ControllerIdentifier", "JoystickIdentifier", - "JoystickForce", + "\"Right\"", "" ] } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Return the angle the joystick is pointing towards (Range: -180 to 180).", - "fullName": "Joystick angle", - "functionType": "Expression", - "name": "JoystickAngle", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "PlatformBehavior::SimulateRightKey" }, "parameters": [ - "JoystickAngle" + "Object", + "Property" ] } ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Change the angle the joystick is pointing towards (Range: -180 to 180).", - "fullName": "Joystick angle", - "functionType": "Action", - "name": "SetJoystickAngle", - "private": true, - "sentence": "Change the joystick angle of _PARAM0_ to _PARAM2_", - "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Up\"", + "" + ] + } + ], "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickAngle" + "value": "PlatformBehavior::SimulateUpKey" }, "parameters": [ "Object", - "Behavior", - "=", - "Value" + "Property" ] }, { "type": { - "value": "SpriteMultitouchJoystick::SetJoystickAngle" + "value": "PlatformBehavior::SimulateLadderKey" }, "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "JoystickAngle", - "" + "Object", + "Property" ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" }, - { - "description": "Angle", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Return the stick force on X axis (from -1 at the left to 1 at the right).", - "fullName": "Stick X force", - "functionType": "Expression", - "name": "StickForceX", - "sentence": "", - "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Down\"", + "" + ] + } + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "PlatformBehavior::SimulateDownKey" }, "parameters": [ - "Object.Behavior::JoystickForce() * cos(ToRad(Object.Behavior::JoystickAngle()))" + "Object", + "Property" ] } ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Return the stick force on Y axis (from -1 at the top to 1 at the bottom).", - "fullName": "Stick Y force", - "functionType": "Expression", - "name": "StickForceY", - "sentence": "", - "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsButtonPressed" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JumpButton", + "\"Down\"" + ] + } + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "PlatformBehavior::SimulateJumpKey" }, "parameters": [ - "Object.Behavior::JoystickForce() * sin(ToRad(Object.Behavior::JoystickAngle()))" + "Object", + "Property" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -27598,53 +31795,135 @@ { "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": "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": "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::MultitouchJoystick::JoystickForce" + "value": "SpriteMultitouchJoystick::StickForce" }, "parameters": [ - "Object", - "Behavior", + "", ">", "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SetForwardAngle" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D", + "=", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier) + CameraAngle(Object.Layer())" + ] }, { "type": { - "value": "SpriteMultitouchJoystick::IsAngleIn4WayDirection" + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D", + "-90", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsButtonPressed" }, "parameters": [ "", - "JoystickAngle", - "Direction", - "" + "ControllerIdentifier", + "JumpButton", + "\"Down\"" ] } ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" }, "parameters": [ - "True" + "Object", + "PhysicsCharacter3D" ] } ] @@ -27659,59 +31938,124 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::Platformer3DMultitouchMapper", "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 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": "SpriteMultitouchJoystick::IsAngleIn8WayDirection" + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsButtonPressed" }, "parameters": [ "", - "JoystickAngle", - "Direction", - "" + "ControllerIdentifier", + "JumpButton", + "\"Down\"" ] } ], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" }, "parameters": [ - "True" + "Object", + "PhysicsCharacter3D" ] } ] @@ -27726,47 +32070,148 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::Shooter3DMultitouchMapper", "type": "behavior" - }, - { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", - "type": "stringWithSelector" } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D physics character", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" }, { - "description": "Check if a joystick is pressed.", - "fullName": "Joystick pressed", - "functionType": "Condition", - "name": "IsPressed", - "sentence": "Joystick _PARAM0_ is pressed", + "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::PropertyTouchId" + "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", - "Behavior", - "!=", - "0" + "Object3D", + "=", + "clamp(Object.Object3D::RotationY(), VerticalAngleMin, VerticalAngleMax)" ] - } - ], - "actions": [ + }, { "type": { - "value": "SetReturnBoolean" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::LookFromObjectEyes" }, "parameters": [ - "True" + "Object", + "Behavior", + "" ] } ] @@ -27781,19 +32226,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 +32247,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 +32317,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 +32340,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "ControllerIdentifier" + "HorizontalRotationSpeedMax" ] } ] @@ -27875,7 +32358,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], @@ -27884,8 +32367,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "ControllerIdentifier", - "name": "SetControllerIdentifier", + "getterName": "HorizontalRotationSpeedMax", + "name": "SetHorizontalRotationSpeedMax", "sentence": "", "events": [ { @@ -27894,7 +32377,7 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyControllerIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationSpeedMax" }, "parameters": [ "Object", @@ -27915,19 +32398,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 +32418,17 @@ "actions": [ { "type": { - "value": "SetReturnString" + "value": "SetReturnNumber" }, "parameters": [ - "JoystickIdentifier" + "HorizontalRotationAcceleration" ] } ] } ], "expressionType": { - "type": "string" + "type": "expression" }, "parameters": [ { @@ -27956,7 +32439,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], @@ -27965,8 +32448,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "JoystickIdentifier", - "name": "SetJoystickIdentifier", + "getterName": "HorizontalRotationAcceleration", + "name": "SetHorizontalRotationAcceleration", "sentence": "", "events": [ { @@ -27975,7 +32458,7 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationAcceleration" }, "parameters": [ "Object", @@ -27996,19 +32479,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 +32502,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "DeadZoneRadius" + "HorizontalRotationDeceleration" ] } ] @@ -28037,7 +32520,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], @@ -28046,8 +32529,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "DeadZoneRadius", - "name": "SetDeadZoneRadius", + "getterName": "HorizontalRotationDeceleration", + "name": "SetHorizontalRotationDeceleration", "sentence": "", "events": [ { @@ -28056,7 +32539,7 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyDeadZoneRadius" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationDeceleration" }, "parameters": [ "Object", @@ -28077,291 +32560,73 @@ { "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", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyIsReleased" - }, - "parameters": [ - "Object", - "Behavior", - "no" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "\"Idle\"", - "" + "VerticalRotationSpeedMax" ] } ] - }, + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ { - "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" - ] - } - ] - } - ] - } - ] + "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": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::IsPressed" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "HasTouchEnded" - }, - "parameters": [ - "", - "TouchId" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetButtonState" - }, - "parameters": [ - "Object", - "Behavior", - "\"Released\"", - "" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyIsReleased" - }, - "parameters": [ - "Object", - "Behavior", - "yes" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationSpeedMax" }, "parameters": [ "Object", "Behavior", "=", - "0" + "Value" ] } ] @@ -28376,44 +32641,38 @@ { "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", + "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::MultitouchButton::PropertyIsReleased" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "VerticalRotationAcceleration" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -28423,41 +32682,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 +32722,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 +32742,18 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::SetButtonState" + "value": "SetReturnNumber" }, "parameters": [ - "", - "ControllerIdentifier", - "ButtonIdentifier", - "ButtonState", - "" + "VerticalRotationDeceleration" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -28513,227 +32763,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": [ + ], + "objectGroups": [] + }, { "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 +33046,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::PlatformerMultitouchMapper", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "type": "behavior" } ], @@ -28759,13 +33057,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 +33075,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 +33905,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 +34012,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyControllerIdentifier()", + "ControllerIdentifier", "" ] }, @@ -29584,7 +34024,7 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyJoystickIdentifier()", + "JoystickIdentifier", "" ] }, @@ -29596,7 +34036,91 @@ "Border", "MultitouchJoystick", "=", - "Object.PropertyDeadZoneRadius()", + "DeadZoneRadius", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Show the joystick until it is released.", + "fullName": "Show and start pressing", + "functionType": "Action", + "name": "TeleportAndPress", + "sentence": "Show _PARAM0_ at the cursor position and start pressing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Object", + "=", + "Object.ParentTouchX(StartedTouchOrMouseId(0))", + "=", + "Object.ParentTouchY(StartedTouchOrMouseId(0))" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Object", + "yes", + "" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::SetPropertyShouldBeHiddenWhenReleased" + }, + "parameters": [ + "Object", + "yes" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::ForceStartPressing" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "StartedTouchOrMouseId(0)", "" ] } @@ -29613,6 +34137,92 @@ ], "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 +34943,16 @@ "extraInformation": [], "hidden": true, "name": "ParentOrigin" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "ShouldBeHiddenWhenReleased" } ], "objects": [ @@ -30447,12 +35067,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 +35106,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 +35178,7 @@ "Object", "__ShakeObject_Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -30569,7 +35189,7 @@ "Object", "__ShakeObject_PowerX", "=", - "GetArgumentAsNumber(\"PowerX\")" + "PowerX" ] }, { @@ -30580,7 +35200,7 @@ "Object", "__ShakeObject_PowerY", "=", - "GetArgumentAsNumber(\"PowerY\")" + "PowerY" ] }, { @@ -30591,7 +35211,7 @@ "Object", "__ShakeObject_PowerAngle", "=", - "GetArgumentAsNumber(\"PowerAngle\")" + "PowerAngle" ] }, { @@ -30602,7 +35222,7 @@ "Object", "__ShakeObject_TimeBetweenShakes", "=", - "GetArgumentAsNumber(\"TimeBetweenShakes\")" + "TimeBetweenShakes" ] } ] @@ -32472,10 +37092,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 +37164,7 @@ "Object", "__ShakeObject_Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -32555,7 +37175,7 @@ "Object", "__ShakeObject_PowerX", "=", - "GetArgumentAsNumber(\"PowerX\")" + "PowerX" ] }, { @@ -32566,7 +37186,7 @@ "Object", "__ShakeObject_PowerY", "=", - "GetArgumentAsNumber(\"PowerY\")" + "PowerY" ] }, { @@ -32577,7 +37197,7 @@ "Object", "__ShakeObject_PowerAngle", "=", - "GetArgumentAsNumber(\"PowerAngle\")" + "PowerAngle" ] }, { @@ -32588,7 +37208,7 @@ "Object", "__ShakeObject_PowerScale", "=", - "GetArgumentAsNumber(\"PowerScale\")" + "PowerScale" ] }, { @@ -32599,7 +37219,7 @@ "Object", "__ShakeObject_TimeBetweenShakes", "=", - "GetArgumentAsNumber(\"TimeBetweenShakes\")" + "TimeBetweenShakes" ] } ] @@ -32846,7 +37466,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -33188,10 +37807,11 @@ "actions": [ { "type": { - "value": "ChangeScale" + "value": "ScalableCapability::ScalableBehavior::SetValue" }, "parameters": [ "Object", + "Scale", "-", "Object.Variable(__ShakeObject_ScaleTravelled)" ] @@ -34096,10 +38716,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 +38998,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 +39259,11 @@ "actions": [ { "type": { - "value": "ChangeScale" + "value": "ScalableCapability::ScalableBehavior::SetValue" }, "parameters": [ "Object", + "Scale", "-", "Object.Variable(__ShakeObject_ScaleTravelled)" ] @@ -34725,7 +39348,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -34777,7 +39399,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -34827,7 +39448,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -34840,7 +39460,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": [] } ], @@ -35777,6 +40418,5 @@ "eventsBasedObjects": [] } ], - "externalLayouts": [], - "externalSourceFiles": [] + "externalLayouts": [] } \ No newline at end of file From 926ab7355d6b0853d2624b70b6723a6e7f0491b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 21 Jan 2025 13:51:18 +0100 Subject: [PATCH 07/15] [Wave defense shooter] Floating joystick --- .../wave-defense-shooter.json | 10114 ++++++++++------ 1 file changed, 6209 insertions(+), 3905 deletions(-) diff --git a/examples/wave-defense-shooter/wave-defense-shooter.json b/examples/wave-defense-shooter/wave-defense-shooter.json index e5af7c5f6..3eaf1b118 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": { @@ -18,7 +18,6 @@ "scaleMode": "nearest", "sizeOnStartupMode": "", "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,7 +769,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "thumbnail.png", "kind": "image", "metadata": "", @@ -878,19 +800,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 +834,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": { @@ -1592,6 +1514,7 @@ "text": "It displays the value when it changes.", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 20, "color": "221;221;221" } @@ -1674,6 +1597,7 @@ "text": "It displays the value when it changes.", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 20, "color": "221;221;221" } @@ -4864,6 +4788,7 @@ "text": "8 / 16", "font": "", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 16, "color": "255;255;255" } @@ -4998,6 +4923,7 @@ "text": "", "font": "Kenney Mini Square.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 40, "color": "255;255;255" } @@ -5081,6 +5007,7 @@ "text": "", "font": "Kenney Mini Square.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 45, "color": "255;255;255" } @@ -5164,6 +5091,7 @@ "text": "", "font": "Kenney Mini Square.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 45, "color": "255;255;255" } @@ -5217,6 +5145,7 @@ "text": "Wave: 1", "font": "Kenney Mini Square.ttf", "textAlignment": "left", + "verticalTextAlignment": "top", "characterSize": 40, "color": "255;255;255" } @@ -5536,7 +5465,7 @@ "effects": [], "behaviors": [], "content": { - "ControllerIdentifier": 2, + "ControllerIdentifier": 1, "JoystickIdentifier": "Secondary" }, "childrenContent": { @@ -5654,10 +5583,10 @@ "objectName": "StatsLabel" }, { - "objectName": "Aiming" + "objectName": "Movement" }, { - "objectName": "Movement" + "objectName": "Aiming" } ] }, @@ -5908,12 +5837,108 @@ ] } ] + }, + { + "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", + "", + "" + ] + } + ] } ] } ], "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 +7024,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 +7048,7 @@ "parameters": [ "Player", "Flippable", - "yes" + "" ] }, { @@ -7071,7 +7058,7 @@ "parameters": [ "Gun", "Flippable", - "yes" + "" ] } ] @@ -7081,14 +7068,12 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + "value": "PosX" }, "parameters": [ - "", - "2", - "\"Secondary\"", - "\"Right\"", - "" + "Player", + ">", + "CursorX()" ] } ], @@ -7100,7 +7085,7 @@ "parameters": [ "Player", "Flippable", - "" + "yes" ] }, { @@ -7110,7 +7095,7 @@ "parameters": [ "Gun", "Flippable", - "" + "yes" ] } ] @@ -7122,25 +7107,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 +7150,7 @@ "parameters": [ "Player", "Flippable", - "" + "yes" ] }, { @@ -7162,7 +7160,7 @@ "parameters": [ "Gun", "Flippable", - "" + "yes" ] } ] @@ -7172,12 +7170,14 @@ "conditions": [ { "type": { - "value": "PosX" + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" }, "parameters": [ - "Player", - ">", - "CursorX()" + "", + "1", + "\"Secondary\"", + "\"Right\"", + "" ] } ], @@ -7189,7 +7189,7 @@ "parameters": [ "Player", "Flippable", - "yes" + "" ] }, { @@ -7199,7 +7199,7 @@ "parameters": [ "Gun", "Flippable", - "yes" + "" ] } ] @@ -7235,11 +7235,11 @@ "subInstructions": [ { "type": { - "value": "MouseButtonPressed" + "value": "MouseButtonFromTextPressed" }, "parameters": [ "", - "Left" + "\"Left\"" ] }, { @@ -7259,7 +7259,7 @@ "", ">", "0", - "2", + "1", "\"Secondary\"", "" ] @@ -7927,7 +7927,7 @@ "Gun", "FireBullet", "=", - "Gun.FireBullet::Cooldown()*0.9", + "Gun.FireBullet::Cooldown() * 0.9", "" ] } @@ -7965,7 +7965,7 @@ "Gun", "FireBullet", "=", - "Gun.FireBullet::AngleVariance()*0.9", + "Gun.FireBullet::AngleVariance() * 0.9", "" ] } @@ -8113,6 +8113,10 @@ } ], "behaviorsSharedData": [ + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, { "name": "BoidsMovement", "type": "BoidsMovement::BoidsMovement" @@ -8137,6 +8141,10 @@ "name": "Health", "type": "Health::Health" }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, { "name": "Resizable", "type": "ResizableCapability::ResizableBehavior" @@ -8149,6 +8157,10 @@ "name": "ShakeObject_PositionAngle", "type": "ShakeObject::ShakeObject_PositionAngle" }, + { + "name": "Text", + "type": "TextContainerCapability::TextContainerBehavior" + }, { "name": "TopDownMovement", "type": "TopDownMovementBehavior::TopDownMovementBehavior" @@ -8176,7 +8188,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,276 +8223,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": [] - }, - { - "description": "Check if a button is released on a gamepad.", - "fullName": "Multitouch controller button released", - "functionType": "Condition", - "name": "IsButtonReleased", - "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is released", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarSceneTxt" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", - "=", - "\"Released\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Button name", - "name": "Button", - "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", - "type": "string" - } - ], - "objectGroups": [] - }, + "sceneVariables": [ { - "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": [ + "name": "Controllers", + "type": "array", + "children": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "type": "structure", + "children": [ { - "type": { - "value": "ModVarSceneTxt" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", - "=", - "GetArgumentAsString(\"ButtonState\")" + "name": "Buttons", + "type": "array", + "children": [ + { + "type": "structure", + "children": [ + { + "name": "State", + "type": "string", + "value": "Idle" + } + ] + } ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Button name", - "name": "Button", - "type": "string" - }, - { - "description": "Button state", - "name": "ButtonState", - "supplementaryInformation": "[\"Idle\",\"Pressed\",\"Released\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Change the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", - "fullName": "Dead zone radius", - "functionType": "Action", - "name": "SetDeadZone", - "private": true, - "sentence": "Change the dead zone of multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + }, { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone", - "=", - "GetArgumentAsNumber(\"DeadZoneRadius\")" - ] + "name": "Joystick", + "type": "structure", + "children": [] } ] } - ], - "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": [] - }, + ] + } + ], + "eventsFunctions": [ { - "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", + "fullName": "Accelerated speed", "functionType": "Expression", - "name": "DeadZone", - "private": true, - "sentence": "Change multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ dead zone to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone)" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "type": "string" - } - ], - "objectGroups": [] - }, - { - "description": "the direction index (left = 1, bottom = 1, right = 2, top = 3) for an angle (in degrees).", - "fullName": "Angle to 4-way index", - "functionType": "ExpressionAndCondition", - "name": "AngleTo4Way", - "private": true, - "sentence": "The angle _PARAM1_ 4-way index", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 4 / 360), 4)" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Angle", - "name": "Angle", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "the direction index (left = 1, bottom-left = 1... top-left = 7) for an angle (in degrees).", - "fullName": "Angle to 8-way index", - "functionType": "ExpressionAndCondition", - "name": "AngleTo8Way", + "name": "AcceleratedSpeed", "private": true, - "sentence": "The angle _PARAM1_ 8-way index", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -8488,132 +8271,428 @@ "actions": [ { "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 8 / 360), 8)" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Angle", - "name": "Angle", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Check if angle is in a given direction.", - "fullName": "Angle 4-way direction", - "functionType": "Condition", - "name": "IsAngleIn4WayDirection", - "private": true, - "sentence": "The angle _PARAM1_ is the 4-way direction _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "GetArgumentAsString(\"Direction\")", - "=", - "\"Right\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" + "value": "SetNumberVariable" }, "parameters": [ - "", + "AcceleratedSpeed", "=", - "0", - "GetArgumentAsNumber(\"Angle\")", - "" + "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": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "GetArgumentAsString(\"Direction\")", - "=", - "\"Down\"" + "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": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" - }, - "parameters": [ - "", - "=", - "1", - "GetArgumentAsNumber(\"Angle\")", - "" + "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)" + ] + } ] } ], - "actions": [ + "variables": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] + "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": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "GetArgumentAsString(\"Direction\")", - "=", - "\"Left\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" + "value": "StringVariable" }, "parameters": [ - "", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", - "2", - "GetArgumentAsNumber(\"Angle\")", - "" + "\"Pressed\"" ] } ], @@ -8627,30 +8706,41 @@ ] } ] + } + ], + "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": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "GetArgumentAsString(\"Direction\")", - "=", - "\"Up\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" + "value": "StringVariable" }, "parameters": [ - "", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", - "3", - "GetArgumentAsNumber(\"Angle\")", - "" + "\"Released\"" ] } ], @@ -8668,87 +8758,250 @@ ], "parameters": [ { - "description": "Angle", - "name": "Angle", + "description": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier", "type": "expression" }, { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", - "type": "stringWithSelector" + "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 angle is in a given direction.", - "fullName": "Angle 8-way direction", - "functionType": "Condition", - "name": "IsAngleIn8WayDirection", + "description": "Change a button state for a multitouch controller.", + "fullName": "Button state", + "functionType": "Action", + "name": "SetButtonState", "private": true, - "sentence": "The angle _PARAM1_ is the 8-way direction _PARAM2_", + "sentence": "Mark _PARAM2_ button as _PARAM3_ for multitouch controller _PARAM1_", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "GetArgumentAsString(\"Direction\")", - "=", - "\"Right\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "0", - "GetArgumentAsNumber(\"Angle\")", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetStringVariable" }, "parameters": [ - "True" + "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": [ + "conditions": [], + "actions": [ { "type": { - "value": "BuiltinCommonInstructions::CompareStrings" + "value": "SetNumberVariable" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", "=", - "\"DownRight\"" + "DeadZoneRadius" ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" - }, - "parameters": [ - "", - "=", - "1", - "GetArgumentAsNumber(\"Angle\")", - "" + } + ] + } + ], + "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", + "" ] } ], @@ -8771,7 +9024,216 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "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\"" ] @@ -8784,7 +9246,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8808,7 +9270,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownLeft\"" ] @@ -8821,7 +9283,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8845,7 +9307,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -8858,7 +9320,7 @@ "", "=", "4", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8882,7 +9344,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpLeft\"" ] @@ -8895,7 +9357,7 @@ "", "=", "5", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8919,7 +9381,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -8932,7 +9394,7 @@ "", "=", "6", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -8956,7 +9418,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpRight\"" ] @@ -8969,7 +9431,7 @@ "", "=", "7", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9030,9 +9492,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -9042,8 +9504,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -9110,9 +9572,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -9122,8 +9584,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -9178,7 +9640,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -9198,6 +9660,11 @@ "name": "JoystickIdentifier", "supplementaryInformation": "[\"Primary\",\"Secondary\"]", "type": "stringWithSelector" + }, + { + "description": "", + "name": "Coucou", + "type": "expression" } ], "objectGroups": [] @@ -9218,7 +9685,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 +9723,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 +9770,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -9343,7 +9810,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle" ] } ] @@ -9381,12 +9848,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 +9894,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 +9934,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 +9957,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 +10100,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyDeadZoneRadius()", + "ControllerIdentifier", + "JoystickIdentifier", + "DeadZoneRadius", "" ] }, @@ -9680,8 +10264,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 +10278,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] } ] @@ -9741,7 +10325,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -9793,8 +10377,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 +10389,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 +10430,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickForce()" + "max(0, JoystickForce - DeadZoneRadius) / (1 - DeadZoneRadius)" ] } ] @@ -9890,7 +10474,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -9899,9 +10483,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickForce()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickForce", "" ] } @@ -9919,6 +10503,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "", + "name": "Parameter", + "type": "objectList" } ], "objectGroups": [] @@ -9939,7 +10528,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickAngle()" + "JoystickAngle" ] } ] @@ -9983,7 +10572,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -9992,9 +10581,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickAngle()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickAngle", "" ] } @@ -10113,13 +10702,14 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyJoystickForce" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" }, "parameters": [ "Object", "Behavior", ">", - "Object.Behavior::PropertyDeadZoneRadius()" + "0", + "" ] }, { @@ -10128,8 +10718,8 @@ }, "parameters": [ "", - "Object.Behavior::JoystickAngle()", - "GetArgumentAsString(\"Direction\")", + "JoystickAngle", + "Direction", "" ] } @@ -10179,13 +10769,14 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyJoystickForce" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" }, "parameters": [ "Object", "Behavior", ">", - "Object.Behavior::PropertyDeadZoneRadius()" + "0", + "" ] }, { @@ -10194,8 +10785,8 @@ }, "parameters": [ "", - "Object.Behavior::JoystickAngle()", - "GetArgumentAsString(\"Direction\")", + "JoystickAngle", + "Direction", "" ] } @@ -10352,7 +10943,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyControllerIdentifier()" + "ControllerIdentifier" ] } ] @@ -10395,7 +10986,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -10433,7 +11024,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyJoystickIdentifier()" + "JoystickIdentifier" ] } ] @@ -10476,7 +11067,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -10514,7 +11105,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDeadZoneRadius()" + "DeadZoneRadius" ] } ] @@ -10557,7 +11148,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 +11217,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "Touch identifier", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -10748,12 +11396,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 +11433,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] }, { @@ -10822,7 +11489,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -10990,9 +11657,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyButtonIdentifier()", - "GetArgumentAsString(\"ButtonState\")", + "ControllerIdentifier", + "ButtonIdentifier", + "ButtonState", "" ] } @@ -11069,6 +11736,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 +11771,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -11122,8 +11799,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -11150,8 +11827,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -11187,8 +11864,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -11215,8 +11892,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJumpButton()", + "ControllerIdentifier", + "JumpButton", "\"Down\"" ] } @@ -11296,9 +11973,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 +11989,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,594 +12163,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": [ + ] + } + ], + "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": "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": { + "value": "CentreCamera" + }, + "parameters": [ + "", + "Object", + "", + "Object.Layer()", + "" ] }, - { - "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": [ - { - "defaultName": "Joystick", - "description": "Joystick for touchscreens.", - "fullName": "Multitouch Joystick", - "name": "SpriteMultitouchJoystick", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ { "type": { - "value": "Create" + "value": "Scene3D::SetCameraZ" }, "parameters": [ "", - "Border", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "Create" - }, - "parameters": [ + "=", + "Object.Object3D::Z() + Object.Object3D::Depth() + OffsetZ", "", - "Thumb", - "0", - "0", "" ] }, { "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Border", - "=", - "1" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Thumb", - "=", - "2" - ] - }, - { - "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()", "" ] } @@ -11968,17 +12437,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", @@ -11986,32 +12462,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": [ { @@ -12020,11 +12502,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationSpeedMax" }, "parameters": [ "Object", - "" + "Behavior", + "=", + "Value" ] } ] @@ -12034,19 +12518,24 @@ { "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_", + "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", @@ -12054,107 +12543,53 @@ "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": "SetReturnNumber" }, "parameters": [ - "Border", - "MultitouchJoystick", - "=", - "Object.PropertyDeadZoneRadius()", - "" + "HorizontalRotationAcceleration" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "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_", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationAcceleration", + "name": "SetHorizontalRotationAcceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationAcceleration" }, "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" + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -12164,67 +12599,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Activate", - "name": "ShouldActivate", - "type": "yesorno" - } - ], - "objectGroups": [] - }, - { - "description": "Check if a stick is pressed.", - "fullName": "Stick pressed", - "functionType": "Condition", - "name": "IsPressed", - "sentence": "Stick _PARAM0_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsPressed" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "!=" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", - "type": "object" + "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", @@ -12235,7 +12627,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::JoystickForce()" + "HorizontalRotationDeceleration" ] } ] @@ -12248,18 +12640,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", @@ -12267,34 +12664,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", @@ -12305,7 +12708,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::StickForceX()" + "VerticalRotationSpeedMax" ] } ] @@ -12318,18 +12721,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", @@ -12337,35 +12745,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", @@ -12376,7 +12789,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::JoystickAngle()" + "VerticalRotationAcceleration" ] } ] @@ -12389,17 +12802,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": [ { @@ -12408,107 +12826,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" ] } ] @@ -12518,25 +12923,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", @@ -12547,7 +12951,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyControllerIdentifier()" + "VerticalAngleMin" ] } ] @@ -12560,8 +12964,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -12569,8 +12978,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "ControllerIdentifier", - "name": "SetControllerIdentifier", + "getterName": "VerticalAngleMin", + "name": "SetVerticalAngleMin", "sentence": "", "events": [ { @@ -12579,14 +12988,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMin" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "Value" ] } ] @@ -12596,19 +13004,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", @@ -12616,24 +13029,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": [] @@ -12641,8 +13059,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "JoystickIdentifier", - "name": "SetJoystickIdentifier", + "getterName": "VerticalAngleMax", + "name": "SetVerticalAngleMax", "sentence": "", "events": [ { @@ -12651,14 +13069,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMax" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsString(\"Value\")", - "" + "Value" ] } ] @@ -12668,19 +13085,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", @@ -12691,7 +13113,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyDeadZoneRadius()" + "OffsetZ" ] } ] @@ -12704,8 +13126,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -12713,8 +13140,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "DeadZoneRadius", - "name": "SetDeadZoneRadius", + "getterName": "OffsetZ", + "name": "SetOffsetZ", "sentence": "", "events": [ { @@ -12723,14 +13150,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyOffsetZ" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "Value" ] } ] @@ -12740,134 +13166,1965 @@ { "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 - } + "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" + ] + } + ] + } + ] + } + ] + } + ], + "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", + "isUsingLegacyInstancesRenderer": true, + "name": "SpriteMultitouchJoystick", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Border", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Thumb", + "0", + "0", + "" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Border", + "=", + "1" + ] + }, + { + "type": { + "value": "ChangePlan" + }, + "parameters": [ + "Thumb", + "=", + "2" + ] + }, + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Border", + "=", + "0", + "=", + "0" + ] + }, + { + "type": { + "value": "SetCenter" + }, + "parameters": [ + "Thumb", + "=", + "0", + "=", + "0" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "SetIncludedInParentCollisionMask" + }, + "parameters": [ + "Thumb", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreAutour" + }, + "parameters": [ + "Thumb", + "Border", + "Border.MultitouchJoystick::JoystickForce() * Border.Width() / 2", + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + }, + { + "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": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Pass the object property values to the behavior.", + "fullName": "Update configuration", + "functionType": "Action", + "name": "UpdateConfiguration", + "private": true, + "sentence": "Update the configuration of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "ControllerIdentifier", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "JoystickIdentifier", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "DeadZoneRadius", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Show the joystick until it is released.", + "fullName": "Show and start pressing", + "functionType": "Action", + "name": "TeleportAndPress", + "sentence": "Show _PARAM0_ at the cursor position and start pressing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Object", + "=", + "Object.ParentTouchX(StartedTouchOrMouseId(0))", + "=", + "Object.ParentTouchY(StartedTouchOrMouseId(0))" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Object", + "yes", + "" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "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", + "functionType": "Action", + "name": "ActivateControl", + "sentence": "Activate control of _PARAM0_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldActivate\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Activate", + "name": "ShouldActivate", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a stick is pressed.", + "fullName": "Stick pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Stick _PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsPressed" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "!=" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick force (from 0 to 1).", + "fullName": "Joystick force (deprecated)", + "functionType": "ExpressionAndCondition", + "name": "JoystickForce", + "private": true, + "sentence": "the joystick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickForce()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the strick force (from 0 to 1).", + "fullName": "Stick force", + "functionType": "ExpressionAndCondition", + "name": "StickForce", + "sentence": "the stick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickForce()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the stick force on X axis (from -1 at the left to 1 at the right).", + "fullName": "Stick X force", + "functionType": "ExpressionAndCondition", + "name": "StickForceX", + "sentence": "the stick X force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::StickForceX()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the stick force on Y axis (from -1 at the top to 1 at the bottom).", + "fullName": "Stick Y force", + "functionType": "ExpressionAndCondition", + "name": "StickForceY", + "sentence": "the stick Y force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::StickForceY()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the joystick is pointing towards (from -180 to 180).", + "fullName": "Joystick angle (deprecated)", + "functionType": "Expression", + "name": "JoystickAngle", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the stick is pointing towards (from -180 to 180).", + "fullName": "Stick angle", + "functionType": "Expression", + "name": "StickAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (4-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed4Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (8-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed8Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "the multitouch controller identifier (1, 2, 3, 4...).", + "fullName": "Multitouch controller identifier", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "ControllerIdentifier", + "sentence": "the multitouch controller identifier", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyControllerIdentifier()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ControllerIdentifier", + "name": "SetControllerIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "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": [ { @@ -12894,7 +15151,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 +15197,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 +15220,14 @@ ], "dependencies": [], "globalVariables": [], - "sceneVariables": [], + "sceneVariables": [ + { + "folded": true, + "name": "HasAlreadyRunThisFrame", + "type": "boolean", + "value": false + } + ], "eventsFunctions": [ { "description": "Define helper classes JavaScript code.", @@ -13302,9 +15598,9 @@ " */", " constructor() {", " /**", - " * @type {Map}", + " * @type {Set}", " */", - " this.boids = new Map();", + " this.boids = new Set();", " this.boidsRBush = new rbush();", " }", "", @@ -13314,8 +15610,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 +15642,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 +15660,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 +15687,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 +15701,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 +15778,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 +15823,11 @@ "conditions": [ { "type": { - "value": "SceneVariableAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "__BoidsBehaviour_hasAlreadyRunThisFrame", + "HasAlreadyRunThisFrame", + "=", "" ] } @@ -13528,21 +15835,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 +15885,12 @@ "actions": [ { "type": { - "value": "SetSceneVariableAsBoolean" + "value": "SetBooleanVariable" }, "parameters": [ - "__BoidsBehaviour_hasAlreadyRunThisFrame", - "False" + "HasAlreadyRunThisFrame", + "False", + "" ] } ] @@ -13834,8 +16146,7 @@ "Behavior", "TargetedObject.CenterX()", "TargetedObject.CenterY()", - "DecisionWeight", - "GetArgumentAsNumber(\"DecisionWeight\")" + "DecisionWeight" ] } ] @@ -13891,56 +16202,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 +16222,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 +16526,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 +16616,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 +16629,18 @@ "actions": [ { "type": { - "value": "BoidsMovement::BoidsMovement::SetPropertyMaxSpeed" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", "MaxSpeed" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -14288,22 +16652,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 +16670,13 @@ "actions": [ { "type": { - "value": "BoidsMovement::BoidsMovement::SetPropertyMaxAcceleration" + "value": "BoidsMovement::BoidsMovement::SetPropertyMaxSpeed" }, "parameters": [ "Object", "Behavior", "=", - "SteeringForce" + "Value" ] } ] @@ -14336,67 +16695,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 +16719,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "MaxSpeed" + "MaxAcceleration" ] } ] @@ -14433,12 +16744,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 +16757,18 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "BoidsMovement::BoidsMovement::SetPropertyMaxAcceleration" }, "parameters": [ - "MaxAcceleration" + "Object", + "Behavior", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -14469,6 +16780,11 @@ "name": "Behavior", "supplementaryInformation": "BoidsMovement::BoidsMovement", "type": "behavior" + }, + { + "description": "Steering Force", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -15087,14 +17403,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 +17429,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 +17635,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 +17706,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 +17720,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { @@ -15676,7 +17993,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -16215,7 +18532,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -16313,9 +18630,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 +19268,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 +19611,7 @@ "parameters": [ "Label", "=", - "GetArgumentAsString(\"LabelText\")" + "LabelText" ] }, { @@ -17706,6 +20047,7 @@ "text": "Text", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 20, "color": "0;0;0" } @@ -17793,7 +20135,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 +20181,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 +20248,7 @@ "Object", "\"__ResourceBar.LastValueChange\"", "<=", - "Object.Behavior::PropertyPreviousHighValueDuration()" + "PreviousHighValueDuration" ] } ], @@ -17923,7 +20297,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyValue()" + "Value" ] } ] @@ -17966,7 +20340,7 @@ "Object", "Behavior", "=", - "clamp(GetArgumentAsNumber(\"Value\"), 0, Object.Behavior::MaxValue())" + "clamp(Value, 0, Object.Behavior::MaxValue())" ] } ] @@ -18009,7 +20383,7 @@ "Object", "Behavior", ">=", - "Object.Behavior::PropertyPreviousHighValue()" + "PreviousHighValue" ] } ], @@ -18059,7 +20433,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxValue()" + "MaxValue" ] } ] @@ -18102,7 +20476,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -18190,7 +20564,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyMaxValue()" + "MaxValue" ] } ], @@ -18237,7 +20611,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPreviousHighValue()" + "PreviousHighValue" ] } ] @@ -18280,7 +20654,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyValue()" + "Value" ] } ] @@ -18318,7 +20692,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPreviousHighValueDuration()" + "PreviousHighValueDuration" ] } ] @@ -18361,7 +20735,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -18400,7 +20774,7 @@ "Object", "Behavior", "!=", - "Object.Behavior::PropertyValue()", + "Value", "" ] }, @@ -18412,7 +20786,7 @@ "Object", "\"__ResourceBar.LastValueChange\"", "<=", - "Object.Behavior::PropertyPreviousHighValueDuration()" + "PreviousHighValueDuration" ] } ], @@ -18488,9 +20862,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 +21350,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 +21731,7 @@ "FillBar", "ResourceBar", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -19511,7 +21909,7 @@ "FillBar", "ResourceBar", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -19695,7 +22093,7 @@ "FillBar", "ResourceBar", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -20237,6 +22635,7 @@ "text": "2 / 3", "font": "", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 20, "color": "0;0;0" } @@ -20323,7 +22722,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 +22767,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 +22818,6 @@ "Behavior", "" ] - }, - { - "type": { - "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyType" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"Flash\"" - ] - }, - { - "type": { - "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyMaxOpacity" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "255" - ] } ] } @@ -20623,7 +23032,18 @@ ] } ], - "actions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::FillOpacity" + }, + "parameters": [ + "Object", + "=", + "MaxOpacity" + ] + } + ], "events": [ { "colorB": 228, @@ -20716,78 +23136,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 +23190,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 +23244,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 +23347,7 @@ "Object", "Behavior", "=", - "Duration" + "NewDuration" ] }, { @@ -21130,7 +23358,7 @@ "Object", "Behavior", "=", - "Direction" + "NewDirection" ] }, { @@ -21146,6 +23374,23 @@ } ], "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyType" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "\"Flash\"" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -21154,7 +23399,7 @@ "value": "CompareArgumentAsString" }, "parameters": [ - "\"Type\"", + "\"NewType\"", "!=", "\"\"" ] @@ -21169,7 +23414,7 @@ "Object", "Behavior", "=", - "Type" + "NewType" ] } ] @@ -21200,6 +23445,23 @@ } ] }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "FlashTransitionPainter::FlashTransitionPainter::SetPropertyMaxOpacity" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "255" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -21208,7 +23470,7 @@ "value": "CompareArgumentAsNumber" }, "parameters": [ - "\"MaxOpacity\"", + "\"NewMaxOpacity\"", "!=", "0" ] @@ -21223,7 +23485,7 @@ "Object", "Behavior", "=", - "MaxOpacity" + "NewMaxOpacity" ] } ] @@ -21251,24 +23513,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 +23636,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 +23653,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 +23701,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyValue()" + "Value" ] } ] @@ -21514,7 +23756,7 @@ "Object", "Behavior", "=", - "clamp(GetArgumentAsNumber(\"Value\"), Object.Behavior::PropertyMinValue(), Object.Behavior::PropertyMaxValue())" + "clamp(Value, MinValue, MaxValue)" ] } ] @@ -21543,7 +23785,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 +23823,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMinValue()" + "MinValue" ] } ] @@ -21624,7 +23866,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -21674,7 +23916,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxValue()" + "MaxValue" ] } ] @@ -21717,7 +23959,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -21807,7 +24049,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyStepSize()" + "StepSize" ] } ] @@ -21850,7 +24092,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -22108,8 +24350,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 +24421,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 +24435,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { @@ -22466,7 +24708,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -22965,7 +25207,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -23063,9 +25305,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 +25998,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 +26261,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -24082,7 +26348,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -24178,7 +26444,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, @@ -24274,7 +26540,7 @@ "FillBar", "Slider", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -25112,6 +27378,7 @@ "text": "It displays the value when it changes.", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 20, "color": "0;0;0" } @@ -25207,7 +27474,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 +27520,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 +27562,7 @@ { "fullName": "", "functionType": "Action", - "name": "doStepPostEvents", + "name": "doStepPreEvents", "sentence": "", "events": [ { @@ -25437,8 +27736,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 +27807,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 +27821,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { @@ -25795,7 +28094,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -26334,7 +28633,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -26452,7 +28751,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyIdleEffect()", + "IdleEffect", "yes" ] }, @@ -26463,7 +28762,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyFocusedEffect()", + "FocusedEffect", "no" ] }, @@ -26474,7 +28773,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyPressedEffect()", + "PressedEffect", "no" ] } @@ -26522,7 +28821,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyIdleEffect()", + "IdleEffect", "no" ] }, @@ -26533,7 +28832,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyFocusedEffect()", + "FocusedEffect", "no" ] }, @@ -26544,7 +28843,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyPressedEffect()", + "PressedEffect", "no" ] } @@ -26583,7 +28882,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyIdleEffect()", + "IdleEffect", "yes" ] } @@ -26622,7 +28921,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyFocusedEffect()", + "FocusedEffect", "yes" ] } @@ -26661,7 +28960,7 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyPressedEffect()", + "PressedEffect", "yes" ] } @@ -26703,7 +29002,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyIdleEffect()" + "IdleEffect" ] } ] @@ -26746,7 +29045,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -26784,7 +29083,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFocusedEffect()" + "FocusedEffect" ] } ] @@ -26827,7 +29126,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -26865,7 +29164,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyPressedEffect()" + "PressedEffect" ] } ] @@ -26908,7 +29207,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -26987,7 +29286,7 @@ "description": "Change the animation of buttons according to their state.", "fullName": "Button animation", "name": "ButtonAnimationName", - "objectType": "Sprite", + "objectType": "", "eventsFunctions": [ { "fullName": "", @@ -27007,7 +29306,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyIdleAnimationName()" + "IdleAnimationName" ] } ] @@ -27017,7 +29316,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27067,7 +29365,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyIdleAnimationName()" + "IdleAnimationName" ] } ] @@ -27095,7 +29393,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyFocusedAnimationName()" + "FocusedAnimationName" ] } ] @@ -27123,7 +29421,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyPressedAnimationName()" + "PressedAnimationName" ] } ] @@ -27136,7 +29434,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27165,7 +29462,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyIdleAnimationName()" + "IdleAnimationName" ] } ] @@ -27178,7 +29475,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27209,7 +29505,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -27219,7 +29515,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27248,7 +29543,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFocusedAnimationName()" + "FocusedAnimationName" ] } ] @@ -27261,7 +29556,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27292,7 +29586,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -27302,7 +29596,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27331,7 +29624,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyPressedAnimationName()" + "PressedAnimationName" ] } ] @@ -27344,7 +29637,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27375,7 +29667,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -27385,7 +29677,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -27399,6 +29690,17 @@ } ], "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Animatable capability", + "description": "", + "group": "", + "extraInformation": [ + "AnimatableCapability::AnimatableBehavior" + ], + "name": "Animation" + }, { "value": "", "type": "Behavior", @@ -27464,7 +29766,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyIdleValue()" + "IdleValue" ] } ] @@ -27544,7 +29846,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyIdleValue()", + "IdleValue", "" ] } @@ -27600,7 +29902,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedValue()", + "FocusedValue", "" ] } @@ -27640,7 +29942,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedValue()", + "FocusedValue", "" ] } @@ -27692,7 +29994,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyPressedValue()", + "PressedValue", "" ] } @@ -27733,8 +30035,8 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFadeInDuration()", - "Object.Behavior::PropertyFadeInEasing()", + "FadeInDuration", + "FadeInEasing", "" ] } @@ -27763,8 +30065,8 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFadeOutDuration()", - "Object.Behavior::PropertyFadeOutEasing()", + "FadeOutDuration", + "FadeOutEasing", "" ] } @@ -27870,7 +30172,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyEffectValue()" + "EffectValue" ] }, { @@ -27881,7 +30183,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -27948,7 +30250,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyEffectValue()" + "EffectValue" ] }, { @@ -27959,7 +30261,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28003,7 +30305,7 @@ "Object", "Behavior", "<", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] } ], @@ -28027,7 +30329,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 +30345,7 @@ "Object", "Behavior", ">=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] } ], @@ -28067,7 +30369,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyTweenTargetedValue()" + "TweenTargetedValue" ] } ] @@ -28083,9 +30385,9 @@ "parameters": [ "Object", "Effect", - "Object.Behavior::PropertyEffectName()", - "Object.Behavior::PropertyEffectProperty()", - "Object.Behavior::PropertyEffectValue()" + "EffectName", + "EffectProperty", + "EffectValue" ] } ] @@ -28134,7 +30436,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyEffectName()" + "EffectName" ] } ] @@ -28175,7 +30477,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyEffectProperty()" + "EffectProperty" ] } ] @@ -28220,7 +30522,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "NewEffectName" ] }, { @@ -28231,7 +30533,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "NewPropertyName" ] } ] @@ -28251,12 +30553,12 @@ }, { "description": "Effect name", - "name": "EffectName", + "name": "NewEffectName", "type": "string" }, { "description": "Parameter name", - "name": "PropertyName", + "name": "NewPropertyName", "type": "string" } ], @@ -28279,7 +30581,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyIdleValue()" + "IdleValue" ] } ] @@ -28322,7 +30624,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28360,7 +30662,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFocusedValue()" + "FocusedValue" ] } ] @@ -28403,7 +30705,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28441,7 +30743,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPressedValue()" + "PressedValue" ] } ] @@ -28484,7 +30786,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28522,7 +30824,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeInEasing()" + "FadeInEasing" ] } ] @@ -28566,7 +30868,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -28604,7 +30906,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeOutEasing()" + "FadeOutEasing" ] } ] @@ -28648,7 +30950,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -28686,7 +30988,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeInDuration()" + "FadeInDuration" ] } ] @@ -28729,7 +31031,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28767,7 +31069,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeOutDuration()" + "FadeOutDuration" ] } ] @@ -28810,7 +31112,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29081,7 +31383,7 @@ "description": "Smoothly resize buttons according to their state.", "fullName": "Button scale tween", "name": "ButtonScaleTween", - "objectType": "Sprite", + "objectType": "", "eventsFunctions": [ { "fullName": "", @@ -29101,7 +31403,7 @@ "Object", "Scale", "=", - "Object.Behavior::PropertyIdleScale()" + "IdleScale" ] } ] @@ -29111,7 +31413,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29182,7 +31483,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyIdleScale()", + "IdleScale", "" ] } @@ -29238,7 +31539,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedScale()", + "FocusedScale", "" ] } @@ -29278,7 +31579,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedScale()", + "FocusedScale", "" ] } @@ -29330,7 +31631,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyPressedScale()", + "PressedScale", "" ] } @@ -29344,7 +31645,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29375,10 +31675,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 +31690,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29426,10 +31725,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 +31740,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29475,7 +31773,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyIdleScale()" + "IdleScale" ] } ] @@ -29488,7 +31786,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29519,7 +31816,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29529,7 +31826,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29558,7 +31854,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFocusedScale()" + "FocusedScale" ] } ] @@ -29571,7 +31867,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29602,7 +31897,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29612,7 +31907,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29641,7 +31935,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPressedScale()" + "PressedScale" ] } ] @@ -29654,7 +31948,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29685,7 +31978,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29695,7 +31988,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29724,7 +32016,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeInDuration()" + "FadeInDuration" ] } ] @@ -29737,7 +32029,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29768,7 +32059,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29778,7 +32069,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29807,7 +32097,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeOutDuration()" + "FadeOutDuration" ] } ] @@ -29820,7 +32110,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29851,7 +32140,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -29861,7 +32150,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29890,7 +32178,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeInEasing()" + "FadeInEasing" ] } ] @@ -29904,7 +32192,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29935,7 +32222,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -29945,7 +32232,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -29974,7 +32260,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeOutEasing()" + "FadeOutEasing" ] } ] @@ -29988,7 +32274,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -30019,7 +32304,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -30029,7 +32314,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -30043,6 +32327,17 @@ } ], "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Scalable capability", + "description": "", + "group": "", + "extraInformation": [ + "ScalableCapability::ScalableBehavior" + ], + "name": "Scale" + }, { "value": "", "type": "Behavior", @@ -30240,7 +32535,7 @@ }, "parameters": [ "Object", - "Object.Behavior::PropertyIdleColorTint()" + "IdleColorTint" ] } ] @@ -30321,7 +32616,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyIdleColorTint()", + "IdleColorTint", "" ] } @@ -30377,7 +32672,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedColorTint()", + "FocusedColorTint", "" ] } @@ -30417,7 +32712,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFocusedColorTint()", + "FocusedColorTint", "" ] } @@ -30469,7 +32764,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyPressedColorTint()", + "PressedColorTint", "" ] } @@ -30514,9 +32809,9 @@ "Object", "Tween", "\"__ButtonColorTintTween.Fade\"", - "GetArgumentAsString(\"Value\")", - "Object.Behavior::PropertyFadeInEasing()", - "1000 * Object.Behavior::PropertyFadeInDuration()", + "Value", + "FadeInEasing", + "1000 * FadeInDuration", "no", "yes" ] @@ -30564,9 +32859,9 @@ "Object", "Tween", "\"__ButtonColorTintTween.Fade\"", - "GetArgumentAsString(\"Value\")", - "Object.Behavior::PropertyFadeOutEasing()", - "1000 * Object.Behavior::PropertyFadeOutDuration()", + "Value", + "FadeOutEasing", + "1000 * FadeOutDuration", "no", "yes" ] @@ -30612,7 +32907,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyIdleColorTint()" + "IdleColorTint" ] } ] @@ -30656,7 +32951,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -30695,7 +32990,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFocusedColorTint()" + "FocusedColorTint" ] } ] @@ -30739,7 +33034,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -30778,7 +33073,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyPressedColorTint()" + "PressedColorTint" ] } ] @@ -30822,7 +33117,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -30861,7 +33156,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeInDuration()" + "FadeInDuration" ] } ] @@ -30905,7 +33200,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -30944,7 +33239,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFadeOutDuration()" + "FadeOutDuration" ] } ] @@ -30988,7 +33283,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -31027,7 +33322,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeInEasing()" + "FadeInEasing" ] } ] @@ -31072,7 +33367,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -31111,7 +33406,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyFadeOutEasing()" + "FadeOutEasing" ] } ] @@ -31156,7 +33451,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -31360,12 +33655,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 +33694,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 +33766,7 @@ "Object", "__ShakeObject_Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -31482,7 +33777,7 @@ "Object", "__ShakeObject_PowerX", "=", - "GetArgumentAsNumber(\"PowerX\")" + "PowerX" ] }, { @@ -31493,7 +33788,7 @@ "Object", "__ShakeObject_PowerY", "=", - "GetArgumentAsNumber(\"PowerY\")" + "PowerY" ] }, { @@ -31504,7 +33799,7 @@ "Object", "__ShakeObject_PowerAngle", "=", - "GetArgumentAsNumber(\"PowerAngle\")" + "PowerAngle" ] }, { @@ -31515,7 +33810,7 @@ "Object", "__ShakeObject_TimeBetweenShakes", "=", - "GetArgumentAsNumber(\"TimeBetweenShakes\")" + "TimeBetweenShakes" ] } ] @@ -33385,10 +35680,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 +35752,7 @@ "Object", "__ShakeObject_Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "Duration" ] }, { @@ -33468,7 +35763,7 @@ "Object", "__ShakeObject_PowerX", "=", - "GetArgumentAsNumber(\"PowerX\")" + "PowerX" ] }, { @@ -33479,7 +35774,7 @@ "Object", "__ShakeObject_PowerY", "=", - "GetArgumentAsNumber(\"PowerY\")" + "PowerY" ] }, { @@ -33490,7 +35785,7 @@ "Object", "__ShakeObject_PowerAngle", "=", - "GetArgumentAsNumber(\"PowerAngle\")" + "PowerAngle" ] }, { @@ -33501,7 +35796,7 @@ "Object", "__ShakeObject_PowerScale", "=", - "GetArgumentAsNumber(\"PowerScale\")" + "PowerScale" ] }, { @@ -33512,7 +35807,7 @@ "Object", "__ShakeObject_TimeBetweenShakes", "=", - "GetArgumentAsNumber(\"TimeBetweenShakes\")" + "TimeBetweenShakes" ] } ] @@ -33759,7 +36054,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -34101,10 +36395,11 @@ "actions": [ { "type": { - "value": "ChangeScale" + "value": "ScalableCapability::ScalableBehavior::SetValue" }, "parameters": [ "Object", + "Scale", "-", "Object.Variable(__ShakeObject_ScaleTravelled)" ] @@ -35009,10 +37304,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 +37586,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 +37847,11 @@ "actions": [ { "type": { - "value": "ChangeScale" + "value": "ScalableCapability::ScalableBehavior::SetValue" }, "parameters": [ "Object", + "Scale", "-", "Object.Variable(__ShakeObject_ScaleTravelled)" ] @@ -35638,7 +37936,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -35690,7 +37987,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -35740,7 +38036,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -35753,7 +38048,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 +38085,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 +38118,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 +38261,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 +38292,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Time", + "Time", "+", "TimeDelta()" ] @@ -35910,298 +38306,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 +38365,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 +38940,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 +39211,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 +39256,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 +39292,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 +39331,10 @@ "actions": [ { "type": { - "value": "VariableClearChildren" + "value": "ClearVariableChildren" }, "parameters": [ - "__CameraShake.Layers" + "Layers" ] }, { @@ -36796,7 +39344,7 @@ "parameters": [ "", "", - "GetArgumentAsString(\"Layer\")", + "Layer", "" ] } @@ -36808,92 +39356,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 +39454,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "GetArgumentAsNumber(\"ShakePeriod\")", + "ShakePeriod", "!=", "0" ] @@ -36915,12 +39463,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultFrequency", + "DefaultFrequency", "=", - "1 / GetArgumentAsNumber(\"ShakePeriod\")" + "1 / ShakePeriod" ] } ] @@ -36933,7 +39481,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "GetArgumentAsNumber(\"ShakePeriod\")", + "ShakePeriod", "=", "0" ] @@ -36942,10 +39490,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultFrequency", + "DefaultFrequency", "=", "1 / 0.08" ] @@ -36981,10 +39529,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Duration", + "Duration", "=", "1234567890" ] @@ -37008,10 +39556,10 @@ "conditions": [ { "type": { - "value": "VarScene" + "value": "NumberVariable" }, "parameters": [ - "__CameraShake.Duration", + "Duration", "=", "0" ] @@ -37020,10 +39568,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Duration", + "Duration", "=", "0.5" ] @@ -37097,30 +39645,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 +39698,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 +39752,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", - "Layer" + "NewLayerName" ] } ] @@ -37222,7 +39770,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "Layer", + "NewLayerName", "=", "\"\"" ] @@ -37231,10 +39779,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", "\"__BaseLayer\"" ] @@ -37257,11 +39805,12 @@ "actions": [ { "type": { - "value": "SetSceneVariableAsBoolean" + "value": "SetBooleanVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].Shakable", - "=" + "Layers[LayerName].Shakable", + "False", + "" ] } ] @@ -37281,11 +39830,12 @@ "actions": [ { "type": { - "value": "SetSceneVariableAsBoolean" + "value": "SetBooleanVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].Shakable", - "True" + "Layers[LayerName].Shakable", + "True", + "" ] } ] @@ -37301,7 +39851,7 @@ }, { "description": "Layer", - "name": "Layer", + "name": "NewLayerName", "type": "layer" } ], @@ -37319,12 +39869,12 @@ "conditions": [ { "type": { - "value": "VarScene" + "value": "NumberVariable" }, "parameters": [ - "__CameraShake.Time", + "Time", "<", - "Variable(__CameraShake.Duration)" + "Duration" ] } ], @@ -37357,12 +39907,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", - "Layer" + "NewLayerName" ] } ] @@ -37375,7 +39925,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "Layer", + "NewLayerName", "=", "\"\"" ] @@ -37384,10 +39934,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", "\"__BaseLayer\"" ] @@ -37400,20 +39950,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 +39984,7 @@ }, { "description": "Layer", - "name": "Layer", + "name": "NewLayerName", "type": "layer" } ], @@ -37454,12 +40004,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", - "Layer" + "NewLayerName" ] } ] @@ -37472,7 +40022,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "Layer", + "NewLayerName", "=", "\"\"" ] @@ -37481,10 +40031,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", "\"__BaseLayer\"" ] @@ -37497,10 +40047,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].AmplitudeAngle", + "Layers[LayerName].AmplitudeAngle", "=", "AmplitudeAngle" ] @@ -37515,8 +40065,8 @@ "type": "expression" }, { - "description": "Layer", - "name": "Layer", + "description": "NewLayerName", + "name": "NewLayerName", "type": "layer" } ], @@ -37536,12 +40086,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", - "GetArgumentAsString(\"Layer\")" + "NewLayerName" ] } ] @@ -37554,7 +40104,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "Layer", + "NewLayerName", "=", "\"\"" ] @@ -37563,10 +40113,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", "\"__BaseLayer\"" ] @@ -37579,12 +40129,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].AmplitudeZoom", + "Layers[LayerName].AmplitudeZoom", "=", - "GetArgumentAsNumber(\"AmplitudeZoom\")" + "AmplitudeZoom" ] } ] @@ -37597,8 +40147,8 @@ "type": "expression" }, { - "description": "Layer", - "name": "Layer", + "description": "NewLayerName", + "name": "NewLayerName", "type": "layer" } ], @@ -37618,12 +40168,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", - "GetArgumentAsString(\"Layer\")" + "NewLayerName" ] } ] @@ -37636,7 +40186,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "Layer", + "NewLayerName", "=", "\"\"" ] @@ -37645,10 +40195,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", "\"__BaseLayer\"" ] @@ -37661,12 +40211,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].Frequency", + "Layers[LayerName].Frequency", "=", - "GetArgumentAsNumber(\"Frequency\")" + "Frequency" ] } ] @@ -37679,8 +40229,8 @@ "type": "expression" }, { - "description": "Layer", - "name": "Layer", + "description": "NewLayerName", + "name": "NewLayerName", "type": "layer" } ], @@ -37700,20 +40250,20 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeX", + "DefaultAmplitudeX", "=", "AmplitudeX" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeY", + "DefaultAmplitudeY", "=", "AmplitudeY" ] @@ -37749,10 +40299,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeAngle", + "DefaultAmplitudeAngle", "=", "AmplitudeAngle" ] @@ -37783,10 +40333,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeZoom", + "DefaultAmplitudeZoom", "=", "AmplitudeZoom" ] @@ -37817,10 +40367,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultFrequency", + "DefaultFrequency", "=", "Frequency" ] @@ -39109,7 +41659,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 +41732,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyHealth()", + "Health", "" ] } @@ -39273,7 +41823,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", ">", - "Object.Behavior::PropertyHealthRegenDelay()" + "HealthRegenDelay" ] } ], @@ -39286,7 +41836,7 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyHealthRegenRate() * TimeDelta()" + "HealthRegenRate * TimeDelta()" ] } ], @@ -39327,7 +41877,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyMaxHealth()" + "MaxHealth" ] } ] @@ -39440,7 +41990,7 @@ "Object", "Behavior", "<", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] }, { @@ -39451,7 +42001,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", ">", - "Object.Behavior::PropertyShieldRegenDelay()" + "ShieldRegenDelay" ] } ], @@ -39497,7 +42047,7 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyShieldRegenRate() * TimeDelta()" + "ShieldRegenRate * TimeDelta()" ] } ] @@ -39525,7 +42075,7 @@ "Object", "Behavior", ">", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ], @@ -39538,7 +42088,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ] @@ -39695,7 +42245,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"DamageValue\")" + "DamageValue" ] } ], @@ -39731,7 +42281,7 @@ "parameters": [ "RandomFloatInRange(0,1)", "<", - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ], @@ -39817,7 +42367,7 @@ "Object", "Behavior", "=", - "max(0,Object.Behavior::PropertyDamageToBeApplied() - Object.Behavior::PropertyFlatDamageReduction())" + "max(0,DamageToBeApplied - FlatDamageReduction)" ] } ] @@ -39869,7 +42419,7 @@ "Object", "Behavior", "*", - "1 - min(1, Object.Behavior::PropertyPercentDamageReduction())" + "1 - min(1, PercentDamageReduction)" ] } ] @@ -39982,7 +42532,7 @@ "Object", "Behavior", "<=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -39995,7 +42545,7 @@ "Object", "Behavior", "-", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { @@ -40006,7 +42556,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { @@ -40045,7 +42595,7 @@ "Object", "Behavior", ">", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -40058,7 +42608,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -40136,7 +42686,7 @@ "Object", "Behavior", "-", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] }, { @@ -40218,7 +42768,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyCurrentHealth() - Object.Behavior::PropertyDamageToBeApplied()", + "CurrentHealth - DamageToBeApplied", "" ] } @@ -40286,7 +42836,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCurrentHealth()" + "CurrentHealth" ] } ] @@ -40330,7 +42880,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -40371,7 +42921,7 @@ "Object", "Behavior", "=", - "min(Object.Behavior::PropertyCurrentHealth(), Object.Behavior::PropertyMaxHealth())" + "min(CurrentHealth, MaxHealth)" ] } ] @@ -40417,7 +42967,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -40497,7 +43047,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"HealValue\")" + "HealValue" ] } ] @@ -40548,7 +43098,7 @@ "Object", "Behavior", "=", - "min(GetArgumentAsNumber(\"HealValue\"),Object.Behavior::PropertyMaxHealth() - Object.Behavior::PropertyCurrentHealth())" + "min(HealValue,MaxHealth - CurrentHealth)" ] } ] @@ -40577,7 +43127,7 @@ "Object", "Behavior", "+", - "Object.Behavior::PropertyHealToBeApplied()" + "HealToBeApplied" ] } ] @@ -40651,7 +43201,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxHealth()" + "MaxHealth" ] } ] @@ -40694,7 +43244,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -40782,7 +43332,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -40826,7 +43376,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenRate()" + "HealthRegenRate" ] } ] @@ -40869,7 +43419,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -40916,7 +43466,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -40960,7 +43510,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDamageCooldown()" + "DamageCooldown" ] } ] @@ -41003,7 +43553,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -41050,7 +43600,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -41094,7 +43644,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenDelay()" + "HealthRegenDelay" ] } ] @@ -41137,7 +43687,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -41184,7 +43734,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -41228,7 +43778,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ] @@ -41271,7 +43821,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -41318,7 +43868,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -41362,7 +43912,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFlatDamageReduction()" + "FlatDamageReduction" ] } ] @@ -41405,7 +43955,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -41452,7 +44002,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -41496,7 +44046,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPercentDamageReduction()" + "PercentDamageReduction" ] } ] @@ -41539,7 +44089,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -41586,7 +44136,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -42157,7 +44707,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", "<", - "Object.Behavior::PropertyDamageCooldown()" + "DamageCooldown" ] } ], @@ -42230,7 +44780,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::PropertyDamageCooldown() - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" + "max(0,DamageCooldown - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" ] } ] @@ -42376,7 +44926,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] } ] @@ -42417,7 +44967,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ] @@ -42460,7 +45010,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -42507,7 +45057,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -42555,7 +45105,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -42599,7 +45149,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ] @@ -42642,7 +45192,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -42689,7 +45239,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -42733,7 +45283,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenRate()" + "ShieldRegenRate" ] } ] @@ -42776,7 +45326,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -42823,7 +45373,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -42867,7 +45417,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenDelay()" + "ShieldRegenDelay" ] } ] @@ -42910,7 +45460,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -42957,7 +45507,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -43001,7 +45551,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDuration()" + "ShieldDuration" ] } ] @@ -43044,7 +45594,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -43091,7 +45641,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -43177,7 +45727,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"ShieldPoints\")" + "ShieldPoints" ] } ] @@ -43206,7 +45756,7 @@ "Object", "Behavior", "=", - "min(GetArgumentAsNumber(\"ShieldPoints\"),Object.Behavior::MaxShield())" + "min(ShieldPoints,Object.Behavior::MaxShield())" ] } ] @@ -43569,7 +46119,7 @@ "Object", "\"__Health.ShieldDuration\"", "<", - "Object.Behavior::PropertyShieldDuration()" + "ShieldDuration" ] } ], @@ -43645,7 +46195,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::PropertyShieldDuration() - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" + "max(0,ShieldDuration - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" ] } ] @@ -43686,7 +46236,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDamageTaken()" + "ShieldDamageTaken" ] } ] @@ -43727,7 +46277,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealToBeApplied()" + "HealToBeApplied" ] } ] @@ -44010,7 +46560,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 +46635,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyStartingAmmo()" + "StartingAmmo" ] }, { @@ -44096,7 +46646,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -44157,56 +46707,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 +46772,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 +46805,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 +46861,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 +46889,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 +46935,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 +46946,7 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Reload gun when needed", + "name": "Reload", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ @@ -44546,7 +46983,7 @@ "Object", "\"__FireBullet.ReloadingTimer\"", ">=", - "Object.Behavior::PropertyReloadDuration()" + "ReloadDuration" ] } ], @@ -44597,7 +47034,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -44638,7 +47075,7 @@ "Object", "Behavior", "=", - "min(Object.Behavior::PropertyShotsPerReload(), Object.Behavior::PropertyAmmoQuantity())" + "min(ShotsPerReload, AmmoQuantity)" ] } ] @@ -44653,7 +47090,7 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Reduce heat level (based on cooling rate)", + "name": "Cooling", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ @@ -44665,7 +47102,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "Object.Behavior::HeatLevel()", + "HeatLevel", ">", "0" ] @@ -44697,7 +47134,7 @@ "Object", "Behavior", "=", - "max(0, Object.Behavior::PropertyHeatLevel() - TimeDelta() * Object.Behavior::PropertyExponentialCoolingRate() * Object.Behavior::PropertyHeatLevel())" + "max(0, HeatLevel - TimeDelta() * ExponentialCoolingRate * HeatLevel)" ] } ] @@ -44726,7 +47163,7 @@ "Object", "Behavior", "=", - "max(0, Object.Behavior::PropertyHeatLevel() - TimeDelta() * Object.Behavior::PropertyLinearCoolingRate())" + "max(0, HeatLevel - TimeDelta() * LinearCoolingRate)" ] } ] @@ -44760,37 +47197,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 +47266,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 +47340,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 +47529,23 @@ ] } ], - "parameters": [] + "variables": [ + { + "folded": true, + "name": "MultiShotAngle", + "type": "number", + "value": 0 + }, + { + "name": "BulletIndex", + "type": "number", + "value": 0 + } + ] } ] } - ], - "parameters": [] + ] } ], "parameters": [ @@ -45259,9 +47629,9 @@ "parameters": [ "", "Bullet", - "GetArgumentAsNumber(\"XPosition\")", - "GetArgumentAsNumber(\"YPosition\")", - "Object.Behavior::PropertyBulletLayer()" + "XPosition", + "YPosition", + "BulletLayer" ] } ], @@ -45290,7 +47660,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Angle\") + RandomInRange(-Object.Behavior::PropertyAngleVariance(), Object.Behavior::PropertyAngleVariance())" + "Angle + RandomInRange(-AngleVariance, AngleVariance)" ] }, { @@ -45299,64 +47669,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 +47709,7 @@ "parameters": [ "Bullet", "=", - "Object.Behavior::PropertyRandomizedAngle()" + "RandomizedAngle" ] } ] @@ -45538,20 +47857,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 +47962,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFiringArc()" + "FiringArc" ] } ] @@ -45700,7 +48005,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -45747,7 +48052,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -45791,7 +48096,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAngleVariance()" + "AngleVariance" ] } ] @@ -45834,7 +48139,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -45881,7 +48186,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -45925,7 +48230,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBulletSpeedVariance()" + "BulletSpeedVariance" ] } ] @@ -45968,7 +48273,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -46015,7 +48320,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -46059,7 +48364,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBulletQuantity()" + "BulletQuantity" ] } ] @@ -46102,7 +48407,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -46149,7 +48454,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -46196,7 +48501,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -46239,7 +48544,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"RotateBullet\"" + "\"Value\"" ] } ], @@ -46264,7 +48569,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"RotateBullet\"" + "\"Value\"" ] } ], @@ -46297,7 +48602,7 @@ { "defaultValue": "yes", "description": "Rotate bullet to match trajetory", - "name": "RotateBullet", + "name": "Value", "optional": true, "type": "yesorno" } @@ -46321,7 +48626,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"UnlimitedAmmo\"" + "\"Value\"" ] } ], @@ -46346,7 +48651,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"UnlimitedAmmo\"" + "\"Value\"" ] } ], @@ -46379,7 +48684,7 @@ { "defaultValue": "yes", "description": "Unlimited ammo", - "name": "UnlimitedAmmo", + "name": "Value", "optional": true, "type": "yesorno" } @@ -46403,7 +48708,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFireCooldown()" + "FireCooldown" ] } ] @@ -46446,7 +48751,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -46493,7 +48798,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"NewCooldown\")", + "Value", "" ] } @@ -46514,7 +48819,7 @@ }, { "description": "Cooldown in seconds", - "name": "NewCooldown", + "name": "Value", "type": "expression" } ], @@ -46537,7 +48842,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyReloadDuration()" + "ReloadDuration" ] } ] @@ -46580,7 +48885,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -46627,7 +48932,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -46671,7 +48976,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyOverheatDuration()" + "OverheatDuration" ] } ] @@ -46714,7 +49019,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -46761,7 +49066,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -46805,7 +49110,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAmmoQuantity()" + "AmmoQuantity" ] } ] @@ -46848,7 +49153,7 @@ "Object", "Behavior", "=", - "max(0,Value)" + "max(0, Value)" ] } ] @@ -46895,7 +49200,7 @@ "Object", "Behavior", "=", - "max(0,Value)", + "max(0, Value)", "" ] } @@ -46939,7 +49244,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHeatIncreasePerShot()" + "HeatIncreasePerShot" ] } ] @@ -46982,7 +49287,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -47029,7 +49334,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -47073,7 +49378,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxAmmo()" + "MaxAmmo" ] } ] @@ -47116,7 +49421,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -47145,7 +49450,7 @@ "Object", "Behavior", "=", - "min(Object.Behavior::MaxAmmo(),Object.Behavior::AmmoQuantity())" + "min(MaxAmmo, AmmoQuantity)" ] } ] @@ -47192,7 +49497,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -47359,7 +49664,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -47402,7 +49707,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -47418,7 +49723,7 @@ "Object", "Behavior", ">", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ], @@ -47431,7 +49736,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -47478,7 +49783,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -47594,7 +49899,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyLinearCoolingRate()" + "LinearCoolingRate" ] } ] @@ -47637,7 +49942,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -47684,7 +49989,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -47728,7 +50033,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyExponentialCoolingRate()" + "ExponentialCoolingRate" ] } ] @@ -47771,7 +50076,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -47819,7 +50124,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -47866,7 +50171,7 @@ "Object", "Behavior", "+", - "GetArgumentAsNumber(\"AmmoGained\")" + "AmmoGained" ] } ] @@ -47907,7 +50212,7 @@ "Object", "Behavior", "=", - "min(Object.Behavior::MaxAmmo(),Object.Behavior::AmmoQuantity())" + "min(MaxAmmo, AmmoQuantity)" ] } ] @@ -47986,7 +50291,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyBulletLayer()" + "BulletLayer" ] } ] @@ -48027,7 +50332,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "min(1,Object.Behavior::PropertyHeatLevel())" + "min(1, HeatLevel)" ] } ] @@ -48068,7 +50373,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTotalShotsFired()" + "TotalShotsFired" ] } ] @@ -48109,7 +50414,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTotalBulletsCreated()" + "TotalBulletsCreated" ] } ] @@ -48150,7 +50455,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTotalReloadsCompleted()" + "TotalReloadsCompleted" ] } ] @@ -48191,7 +50496,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShotsBeforeNextReload()" + "ShotsBeforeNextReload" ] } ] @@ -48232,7 +50537,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::Cooldown() - Object.ObjectTimerElapsedTime(\"__FireBullet.FiringCooldown\"))" + "max(0, FireCooldown - Object.ObjectTimerElapsedTime(\"__FireBullet.FiringCooldown\"))" ] } ] @@ -48285,7 +50590,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0, Object.Behavior::PropertyOverheatDuration() - Object.ObjectTimerElapsedTime(\"__FireBullet.OverheatDuration\"))" + "max(0, OverheatDuration - Object.ObjectTimerElapsedTime(\"__FireBullet.OverheatDuration\"))" ] } ] @@ -48338,7 +50643,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0, Object.Behavior::PropertyReloadDuration() - Object.ObjectTimerElapsedTime(\"__FireBullet.ReloadingTimer\"))" + "max(0, ReloadDuration - Object.ObjectTimerElapsedTime(\"__FireBullet.ReloadingTimer\"))" ] } ] @@ -49271,6 +51576,5 @@ "eventsBasedObjects": [] } ], - "externalLayouts": [], - "externalSourceFiles": [] + "externalLayouts": [] } \ No newline at end of file From cce8fc17f382043c056a1c7e347444b991fa7717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 21 Jan 2025 15:12:00 +0100 Subject: [PATCH 08/15] =?UTF-8?q?[360=C2=B0=20platformer]=20Floating=20joy?= =?UTF-8?q?stick?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../360\302\260-platformer.json" | 13205 +++++++++++----- 1 file changed, 8920 insertions(+), 4285 deletions(-) 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..de7bc743e 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": "", @@ -3256,7 +3232,7 @@ { "adaptCollisionMaskAutomatically": true, "assetStoreId": "9c727020616afdd6ba786b8af206a90481f07db0ca175ed6a4cc5b7e01c66d06", - "name": "TopArrowButton", + "name": "JumpButton", "type": "Sprite", "updateIfNotVisible": false, "variables": [], @@ -3269,7 +3245,8 @@ "ButtonIdentifier": "A", "TouchId": 0, "TouchIndex": 2.0247e-320, - "IsReleased": false + "IsReleased": false, + "Radius": 160 } ], "animations": [ @@ -3325,7 +3302,7 @@ }, { "assetStoreId": "e71bd69f896d6c7531b48c65ceb5da25071d4fbdeb518aeceecba8d21f34ed8d", - "name": "FlatDarkJoystick", + "name": "WalkJoystick", "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "variables": [], "effects": [], @@ -3466,10 +3443,10 @@ "objectName": "Spring" }, { - "objectName": "TopArrowButton" + "objectName": "WalkJoystick" }, { - "objectName": "FlatDarkJoystick" + "objectName": "JumpButton" } ] }, @@ -3505,27 +3482,6 @@ "\"Collision\"" ] } - ], - "events": [ - { - "disabled": true, - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "DebuggerTools::EnableDebugDraw" - }, - "parameters": [ - "", - "", - "yes", - "no", - "no" - ] - } - ] - } ] }, { @@ -3570,6 +3526,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 +3592,11 @@ "subInstructions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "Left" + "\"Left\"" ] }, { @@ -3652,11 +3661,11 @@ "subInstructions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "Right" + "\"Right\"" ] }, { @@ -3721,11 +3730,11 @@ "subInstructions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "Down" + "\"Down\"" ] }, { @@ -3790,20 +3799,20 @@ "subInstructions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "Space" + "\"Space\"" ] }, { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "LShift" + "\"LShift\"" ] }, { @@ -3855,11 +3864,11 @@ "subInstructions": [ { "type": { - "value": "KeyPressed" + "value": "KeyFromTextPressed" }, "parameters": [ "", - "LControl" + "\"LControl\"" ] }, { @@ -4947,7 +4956,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,8 +4991,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", @@ -4996,10 +5455,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Pressed\"" ] @@ -5044,10 +5503,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Released\"" ] @@ -5094,10 +5553,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Buttons[Button].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "ButtonState" ] @@ -5139,10 +5598,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", "=", "DeadZoneRadius" ] @@ -5187,7 +5646,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone" ] } ] @@ -5227,7 +5686,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 4 / 360), 4)" + "mod(round(Angle * 4 / 360), 4)" ] } ] @@ -5262,7 +5721,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 8 / 360), 8)" + "mod(round(Angle * 8 / 360), 8)" ] } ] @@ -5296,7 +5755,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -5309,7 +5768,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5333,7 +5792,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -5346,7 +5805,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5370,7 +5829,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -5383,7 +5842,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5407,7 +5866,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -5420,7 +5879,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5468,7 +5927,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -5481,7 +5940,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5505,7 +5964,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownRight\"" ] @@ -5518,7 +5977,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5542,7 +6001,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -5555,7 +6014,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5579,7 +6038,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownLeft\"" ] @@ -5592,7 +6051,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5616,7 +6075,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -5629,7 +6088,7 @@ "", "=", "4", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5653,7 +6112,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpLeft\"" ] @@ -5666,7 +6125,7 @@ "", "=", "5", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5690,7 +6149,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -5703,7 +6162,7 @@ "", "=", "6", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5727,7 +6186,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpRight\"" ] @@ -5740,7 +6199,7 @@ "", "=", "7", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -5969,6 +6428,11 @@ "name": "JoystickIdentifier", "supplementaryInformation": "[\"Primary\",\"Secondary\"]", "type": "stringWithSelector" + }, + { + "description": "", + "name": "Coucou", + "type": "expression" } ], "objectGroups": [] @@ -5989,7 +6453,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 +6491,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", "=", "Value" ] @@ -6074,7 +6538,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -6114,7 +6578,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle" ] } ] @@ -6152,12 +6616,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 +6662,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 +6702,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::JoystickForce(ControllerIdentifier, JoystickIdentifier) * sin(ToRad(SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)))" + "YFromAngleAndDistance(SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier), SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" ] } ] @@ -6261,352 +6725,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", @@ -6614,18 +6864,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", @@ -6643,10 +6904,8 @@ }, { "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "JoystickForce", - "name": "SetJoystickForce", - "private": true, + "functionType": "Action", + "name": "onDeActivate", "sentence": "", "events": [ { @@ -6655,24 +6914,11 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickForce" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::Reset" }, "parameters": [ "Object", "Behavior", - "=", - "Value" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::SetJoystickForce" - }, - "parameters": [ - "", - "ControllerIdentifier", - "JoystickIdentifier", - "JoystickForce", "" ] } @@ -6694,6 +6940,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", @@ -6754,7 +7340,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -6763,9 +7349,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickAngle()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickAngle", "" ] } @@ -7125,7 +7711,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyControllerIdentifier()" + "ControllerIdentifier" ] } ] @@ -7168,7 +7754,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -7206,7 +7792,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyJoystickIdentifier()" + "JoystickIdentifier" ] } ] @@ -7249,7 +7835,7 @@ "Object", "Behavior", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -7332,6 +7918,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 +7985,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "Touch identifier", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -7521,12 +8164,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 +8201,7 @@ "Object", "Behavior", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] }, { @@ -7595,7 +8257,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -7763,9 +8425,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyButtonIdentifier()", - "GetArgumentAsString(\"ButtonState\")", + "ControllerIdentifier", + "ButtonIdentifier", + "ButtonState", "" ] } @@ -7842,6 +8504,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 +8539,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -7895,8 +8567,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -7923,8 +8595,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -7960,8 +8632,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -7988,8 +8660,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJumpButton()", + "ControllerIdentifier", + "JumpButton", "\"Down\"" ] } @@ -8069,9 +8741,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 +8757,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 +8799,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 +8831,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", + "supplementaryInformation": "SpriteMultitouchJoystick::Platformer3DMultitouchMapper", "type": "behavior" } ], @@ -8585,13 +8842,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 +8862,9 @@ { "value": "Primary", "type": "Choice", - "label": "Joystick name", + "label": "Walk joystick", "description": "", - "group": "", + "group": "Controls", "extraInformation": [ "Primary", "Secondary" @@ -8615,129 +8872,238 @@ "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": [ + "Object", + "PhysicsCharacter3D", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsButtonPressed" }, "parameters": [ "", - "Thumb", - "0", - "0", - "" + "ControllerIdentifier", + "JumpButton", + "\"Down\"" ] - }, + } + ], + "actions": [ { "type": { - "value": "ChangePlan" + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" }, "parameters": [ - "Border", + "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", "=", - "1" + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedZ, SpriteMultitouchJoystick::StickForceX(ControllerIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" ] }, { "type": { - "value": "ChangePlan" + "value": "SetAngle" }, "parameters": [ - "Thumb", - "=", - "2" + "Object", + "+", + "CurrentRotationSpeedZ * TimeDelta()" ] }, { "type": { - "value": "SetCenter" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyCurrentRotationSpeedY" }, "parameters": [ - "Border", - "=", - "0", + "Object", + "Behavior", "=", - "0" + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedY, SpriteMultitouchJoystick::StickForceY(ControllerIdentifier, CameraStick) * VerticalRotationSpeedMax, VerticalRotationSpeedMax, VerticalRotationAcceleration, VerticalRotationDeceleration)" ] }, { "type": { - "value": "SetCenter" + "value": "Scene3D::Base3DBehavior::SetRotationY" }, "parameters": [ - "Thumb", - "=", - "0", - "=", - "0" + "Object", + "Object3D", + "+", + "CurrentRotationSpeedY * TimeDelta()" ] }, { "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + "value": "Scene3D::Base3DBehavior::SetRotationY" }, "parameters": [ "Object", - "" + "Object3D", + "=", + "clamp(Object.Object3D::RotationY(), VerticalAngleMin, VerticalAngleMax)" ] }, { "type": { - "value": "SetIncludedInParentCollisionMask" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::LookFromObjectEyes" }, "parameters": [ - "Thumb", + "Object", + "Behavior", "" ] } @@ -8748,17 +9114,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", @@ -8766,105 +9140,61 @@ "actions": [ { "type": { - "value": "MettreAutour" + "value": "CentreCamera" }, "parameters": [ - "Thumb", - "Border", - "Border.MultitouchJoystick::JoystickForce() * Border.Width() / 2", - "Border.MultitouchJoystick::JoystickAngle()" + "", + "Object", + "", + "Object.Layer()", + "" ] - } - ] - } - ], - "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" + "value": "Scene3D::SetCameraZ" }, "parameters": [ - "Object", + "", + "=", + "Object.Object3D::Z() + Object.Object3D::Depth() + OffsetZ", + "", "" ] - } - ] - } - ], - "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::SetCameraRotationX" }, "parameters": [ - "Border", - "MultitouchJoystick", + "", "=", - "Object.PropertyControllerIdentifier()", + "- Object.Object3D::RotationY() + 90", + "GetArgumentAsString(\"Layer\")", "" ] }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + "value": "Scene3D::SetCameraRotationY" }, "parameters": [ - "Border", - "MultitouchJoystick", + "", "=", - "Object.PropertyJoystickIdentifier()", + "Object.Object3D::RotationX()", + "GetArgumentAsString(\"Layer\")", "" ] }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + "value": "SetCameraAngle" }, "parameters": [ - "Border", - "MultitouchJoystick", + "", "=", - "Object.PropertyDeadZoneRadius()", + "Object.Angle() + 90", + "Object.Layer()", "" ] } @@ -8875,66 +9205,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\"" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "ActivateBehavior" + "value": "SetReturnNumber" }, "parameters": [ - "Border", - "MultitouchJoystick", - "no" + "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": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"ShouldActivate\"" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "ActivateBehavior" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationSpeedMax" }, "parameters": [ - "Border", - "MultitouchJoystick", - "yes" + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -8944,67 +9286,64 @@ { "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", + "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": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsPressed" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "!=" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "HorizontalRotationAcceleration" ] } ] } ], + "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 joystick force (from 0 to 1).", - "fullName": "Joystick force (deprecated)", - "functionType": "ExpressionAndCondition", - "name": "JoystickForce", - "private": true, - "sentence": "the joystick force", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationAcceleration", + "name": "SetHorizontalRotationAcceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -9012,34 +9351,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 strick force (from 0 to 1).", - "fullName": "Stick force", + "description": "the horizontal rotation deceleration of the object.", + "fullName": "Horizontal rotation deceleration", "functionType": "ExpressionAndCondition", - "name": "StickForce", - "sentence": "the stick force", + "group": "First person camera multitouch controller mapper horizontal rotation configuration", + "name": "HorizontalRotationDeceleration", + "sentence": "the horizontal rotation deceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -9050,7 +9395,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::JoystickForce()" + "HorizontalRotationDeceleration" ] } ] @@ -9063,18 +9408,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 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", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationDeceleration", + "name": "SetHorizontalRotationDeceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -9082,34 +9432,40 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyHorizontalRotationDeceleration" }, "parameters": [ - "Border.MultitouchJoystick::StickForceX()" + "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 Y axis (from -1 at the top to 1 at the bottom).", - "fullName": "Stick Y force", + "description": "the maximum vertical rotation speed of the object.", + "fullName": "Maximum vertical rotation speed", "functionType": "ExpressionAndCondition", - "name": "StickForceY", - "sentence": "the stick Y force", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalRotationSpeedMax", + "sentence": "the maximum vertical rotation speed", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -9120,7 +9476,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::StickForceY()" + "VerticalRotationSpeedMax" ] } ] @@ -9133,18 +9489,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 (from -180 to 180).", - "fullName": "Joystick angle (deprecated)", - "functionType": "Expression", - "name": "JoystickAngle", - "private": true, + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationSpeedMax", + "name": "SetVerticalRotationSpeedMax", "sentence": "", "events": [ { @@ -9153,34 +9513,40 @@ "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": "Return the angle the stick is pointing towards (from -180 to 180).", - "fullName": "Stick angle", - "functionType": "Expression", - "name": "StickAngle", - "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", @@ -9191,7 +9557,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::JoystickAngle()" + "VerticalRotationAcceleration" ] } ] @@ -9204,41 +9570,37 @@ { "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_", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationAcceleration", + "name": "SetVerticalRotationAcceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "Direction", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationAcceleration" }, "parameters": [ - "True" + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -9248,47 +9610,78 @@ { "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_", + "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": [ + "conditions": [], + "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed8Way" + "value": "SetReturnNumber" }, "parameters": [ - "Border", - "MultitouchJoystick", - "Direction", - "" + "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": "SetReturnBoolean" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalRotationDeceleration" }, "parameters": [ - "True" + "Object", + "Behavior", + "=", + "Value" ] } ] @@ -9298,25 +9691,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", @@ -9327,7 +9719,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyControllerIdentifier()" + "VerticalAngleMin" ] } ] @@ -9340,8 +9732,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -9349,8 +9746,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "ControllerIdentifier", - "name": "SetControllerIdentifier", + "getterName": "VerticalAngleMin", + "name": "SetVerticalAngleMin", "sentence": "", "events": [ { @@ -9359,14 +9756,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMin" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "Value" ] } ] @@ -9376,19 +9772,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", @@ -9396,24 +9797,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": [] @@ -9421,8 +9827,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "JoystickIdentifier", - "name": "SetJoystickIdentifier", + "getterName": "VerticalAngleMax", + "name": "SetVerticalAngleMax", "sentence": "", "events": [ { @@ -9431,14 +9837,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyVerticalAngleMax" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsString(\"Value\")", - "" + "Value" ] } ] @@ -9448,19 +9853,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", @@ -9471,7 +9881,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyDeadZoneRadius()" + "OffsetZ" ] } ] @@ -9484,8 +9894,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -9493,8 +9908,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "DeadZoneRadius", - "name": "SetDeadZoneRadius", + "getterName": "OffsetZ", + "name": "SetOffsetZ", "sentence": "", "events": [ { @@ -9503,14 +9918,13 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::SetPropertyOffsetZ" }, "parameters": [ - "Border", - "MultitouchJoystick", + "Object", + "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "Value" ] } ] @@ -9520,3013 +9934,7116 @@ { "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 - } - ], - "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": [ + "parameters": [ { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Gamepads::StickAngle(GetArgumentAsNumber(\"player_ID\"), GetArgumentAsString(\"stick\"))" - ] + "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": "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": [ + "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(\"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", - "}" + "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": "player_ID", - "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": "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": [ + "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", - "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": "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" + "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", + "" + ] + } + ] + } + ], + "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", - "" + "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": [ - { - "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": "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": "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": "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": "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": "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": "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 - } - ], - "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": [ + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Touch identifier", + "name": "TouchId", + "type": "expression" + } + ], + "objectGroups": [] + }, { - "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", - "" + "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 - } - ], - "parameters": [ + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Touch identifier", + "name": "TouchId", + "type": "expression" + } + ], + "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", + "description": "the stick force on X axis (from -1 at the left to 1 at the right).", + "fullName": "Stick X force", + "functionType": "ExpressionAndCondition", + "name": "StickForceX", + "sentence": "the stick X force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::StickForceX()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the stick force on Y axis (from -1 at the top to 1 at the bottom).", + "fullName": "Stick Y force", + "functionType": "ExpressionAndCondition", + "name": "StickForceY", + "sentence": "the stick Y force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::StickForceY()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the joystick is pointing towards (from -180 to 180).", + "fullName": "Joystick angle (deprecated)", + "functionType": "Expression", + "name": "JoystickAngle", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the stick is pointing towards (from -180 to 180).", + "fullName": "Stick angle", + "functionType": "Expression", + "name": "StickAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (4-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed4Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (8-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed8Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "the multitouch controller identifier (1, 2, 3, 4...).", + "fullName": "Multitouch controller identifier", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "ControllerIdentifier", + "sentence": "the multitouch controller identifier", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyControllerIdentifier()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ControllerIdentifier", + "name": "SetControllerIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick name of the object.", + "fullName": "Joystick name", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "JoystickIdentifier", + "sentence": "the joystick name", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyJoystickIdentifier()" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JoystickIdentifier", + "name": "SetJoystickIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the dead zone radius of the joystick (range: 0 to 1). The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", + "fullName": "Dead zone radius", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "DeadZoneRadius", + "sentence": "the dead zone radius", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyDeadZoneRadius()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DeadZoneRadius", + "name": "SetDeadZoneRadius", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "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", - " 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", + "\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) {\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", + "if (gamepad == null) return;\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", + "for (let buttonId = 0; buttonId < gamepad.buttons.length; buttonId++) { //For each buttons on current frame.\r", "\r", - " case 'RIGHT':\r", - " if (getNormalizedAxisValue(gamepad.axes[2], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", + "\tif (buttonId === undefined) {\r", + "\t\teventsFunctionContext.returnValue = false;\r", + "\t\treturn;\r", + "\t}\r", "\r", - " case 'UP':\r", - " if (getNormalizedAxisValue(gamepad.axes[3], playerId) < 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\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", - " case 'DOWN':\r", - " if (getNormalizedAxisValue(gamepad.axes[3], playerId) > 0) {\r", - " eventsFunctionContext.returnValue = true;\r", - " return;\r", - " }\r", - " break;\r", + "\t//Get state of the button at previous frame\r", + "\tconst previousStateButtonIsPressed = gdjs._extensionController.players[playerId].previousFrameStateButtons[buttonId].pressed;\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", + "\t//Get the state of the button on the current frame.\r", + "\tconst currentFrameStateButtonIsPressed = gamepad.buttons[buttonId].pressed;\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", + "\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", - " default:\r", - " console.error('The value Stick on the condition: \"Gamepad stick pushed (axis)\" is not valid.');\r", - " eventsFunctionContext.returnValue = false;\r", - " break;\r", + "\tif (currentFrameStateButtonIsPressed) gdjs._extensionController.players[playerId].lastButtonUsed = buttonId;\r", "}\r", - "\r", - "eventsFunctionContext.returnValue = false;\r", "" ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true + "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" + ] + } + ] + } + ] + } + ], + "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": "Stick: \"Left\" or \"Right\"", - "name": "stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" }, { - "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": "true", + "type": "Boolean", + "label": "Use directional pad", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseArrows" + }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] + "value": "true", + "type": "Boolean", + "label": "Use left stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseLeftStick" }, { - "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": "", + "type": "Boolean", + "label": "Use right stick", + "description": "", + "group": "Controls", + "extraInformation": [], + "name": "UseRightStick" + }, { - "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)", - "" + "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" ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "name": "JumpButton" } ], - "objectGroups": [] + "sharedPropertyDescriptors": [] }, { - "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": "Control a 3D physics character with a gamepad.", + "fullName": "3D platformer gamepad mapper", + "name": "Platformer3DGamepadMapper", + "objectType": "", + "eventsFunctions": [ { - "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;", - "}" + "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" + ] + } + ] + } + ] + } ], - "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" + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::Platformer3DGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] } ], - "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": [ + "propertyDescriptors": [ { - "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];" + "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" - } - ], - "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": [ + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" + }, { - "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", - " });", - "}" + "value": "Left", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Left", + "Right" ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Player_ID", - "type": "expression" + "name": "JoystickIdentifier" }, { - "description": "Time of the vibration, in seconds (optional, default value is 1)", - "name": "Duration", - "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": [] }, { - "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": "Control a 3D physics character with a gamepad.", + "fullName": "3D shooter gamepad mapper", + "name": "Shooter3DGamepadMapper", + "objectType": "", + "eventsFunctions": [ { - "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": "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": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Player_ID", - "type": "expression" - }, + "propertyDescriptors": [ { - "description": "Time of the vibration, in seconds (optional, default value is 1)", - "name": "Duration", - "type": "expression" + "value": "", + "type": "Behavior", + "label": "3D physics character", + "description": "", + "group": "", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" }, { - "description": "Strong rumble magnitude (from 0 to 1)", - "name": "StrongMagnitude", - "type": "expression" + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "description": "", + "group": "", + "extraInformation": [], + "name": "GamepadIdentifier" }, { - "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": "Left", + "type": "Choice", + "label": "Walk joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Left", + "Right" ], - "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" + "name": "WalkStick" }, { - "description": "Weak rumble magnitude (from 0 to 1)", - "name": "WeakMagnitude", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onFirstSceneLoaded", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] + "value": "Right", + "type": "Choice", + "label": "Camera joystick", + "description": "", + "group": "Controls", + "extraInformation": [ + "Left", + "Right" + ], + "name": "CameraStick" }, { - "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", - "};" + "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" ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true + "name": "JumpButton" } ], - "parameters": [], - "objectGroups": [] + "sharedPropertyDescriptors": [] }, { - "fullName": "", - "functionType": "Action", - "name": "onScenePostEvents", - "sentence": "", - "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": [ - "//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;", - " }", - "", - "", - "}", - "" + "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" + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "description": "Check if any button is released on a gamepad.", - "fullName": "Any gamepad button released", - "functionType": "Condition", - "name": "C_any_button_released", - "sentence": "Any button of gamepad _PARAM1_ is released", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] + "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": "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" + ] + } + ] + } ], - "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": [ + "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" + ] + } + ] + } ], - "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": [] - }, - { - "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": [ + "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": [] + }, { - "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": "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": "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::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": "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", - "=", - "\"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": "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", - "=", - "\"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": "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", - "=", - "\"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": "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", - "=", - "\"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": "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", - "=", - "\"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": "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", - "=", - "\"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": "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", - "=", - "\"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": "SetReturnNumber" + }, + "parameters": [ + "OffsetZ" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -12536,7 +17053,47 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Gamepads::PlatformerGamepadMapper", + "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" } ], @@ -12547,13 +17104,13 @@ { "value": "", "type": "Behavior", - "label": "Platformer character behavior", + "label": "3D capability", "description": "", "group": "", "extraInformation": [ - "PlatformBehavior::PlatformerObjectBehavior" + "Scene3D::Base3DBehavior" ], - "name": "PlatformerCharacter" + "name": "Object3D" }, { "value": "1", @@ -12565,49 +17122,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": [] @@ -12633,7 +17265,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "" ] } @@ -12645,7 +17277,7 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseArrows" + "value": "Gamepads::TopDownGamepadMapper::PropertyUseArrows" }, "parameters": [ "Object", @@ -12664,7 +17296,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Left\"", "\"Left\"" ] @@ -12691,7 +17323,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Right\"", "\"Left\"" ] @@ -12718,7 +17350,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Up\"", "\"Left\"" ] @@ -12745,7 +17377,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Down\"", "\"Left\"" ] @@ -12770,7 +17402,7 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseLeftStick" + "value": "Gamepads::TopDownGamepadMapper::PropertyUseLeftStick" }, "parameters": [ "Object", @@ -12803,8 +17435,8 @@ "parameters": [ "Object", "TopDownMovement", - "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")", - "Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")" + "Gamepads::StickRotationValue(GamepadIdentifier, \"Left\")", + "Gamepads::StickForce(GamepadIdentifier, \"Left\")" ] } ] @@ -12832,8 +17464,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\"))" ] } ] @@ -12864,7 +17496,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Left\"", "\"Left\"", "" @@ -12892,7 +17524,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Left\"", "\"Right\"", "" @@ -12920,7 +17552,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Left\"", "\"Up\"", "" @@ -12948,7 +17580,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Left\"", "\"Down\"", "" @@ -12976,7 +17608,7 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseRightStick" + "value": "Gamepads::TopDownGamepadMapper::PropertyUseRightStick" }, "parameters": [ "Object", @@ -13009,8 +17641,8 @@ "parameters": [ "Object", "TopDownMovement", - "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Right\")", - "Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Right\")" + "Gamepads::StickRotationValue(GamepadIdentifier, \"Right\")", + "Gamepads::StickForce(GamepadIdentifier, \"Right\")" ] } ] @@ -13038,7 +17670,7 @@ "parameters": [ "Object", "TopDownMovement", - "sign(Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Right\"))", + "sign(Gamepads::StickForce(GamepadIdentifier, \"Right\"))", "1" ] } @@ -13070,7 +17702,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Right\"", "\"Left\"", "" @@ -13098,7 +17730,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Right\"", "\"Right\"", "" @@ -13126,7 +17758,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Right\"", "\"Up\"", "" @@ -13154,7 +17786,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Right\"", "\"Down\"", "" @@ -13273,7 +17905,7 @@ "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", + "version": "1.0.1", "description": [ "Useful when multiple layers need to use the same camera values.", "", @@ -13330,9 +17962,9 @@ "parameters": [ "", "=", - "CameraX(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", - "GetArgumentAsString(\"DestinationLayer\")", - "GetArgumentAsNumber(\"DestinationCamera\")" + "CameraX(SourceLayer,SourceCamera)", + "DestinationLayer", + "DestinationCamera" ] } ] @@ -13357,9 +17989,9 @@ "parameters": [ "", "=", - "CameraY(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", - "GetArgumentAsString(\"DestinationLayer\")", - "GetArgumentAsNumber(\"DestinationCamera\")" + "CameraY(SourceLayer,SourceCamera)", + "DestinationLayer", + "DestinationCamera" ] } ] @@ -13383,9 +18015,9 @@ }, "parameters": [ "", - "CameraZoom(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", - "GetArgumentAsString(\"DestinationLayer\")", - "GetArgumentAsNumber(\"DestinationCamera\")" + "CameraZoom(SourceLayer,SourceCamera)", + "DestinationLayer", + "DestinationCamera" ] } ] @@ -13410,9 +18042,9 @@ "parameters": [ "", "=", - "CameraAngle(GetArgumentAsString(\"SourceLayer\"),GetArgumentAsNumber(\"SourceCamera\"))", - "GetArgumentAsString(\"DestinationLayer\")", - "GetArgumentAsNumber(\"DestinationCamera\")" + "CameraAngle(SourceLayer,SourceCamera)", + "DestinationLayer", + "DestinationCamera" ] } ] @@ -13484,7 +18116,7 @@ "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", + "version": "1.0.3", "description": [ "It allows objects to move:", "- on an ellipsis or arcs", @@ -13624,7 +18256,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyInitialDirectionAngle() + 90" + "InitialDirectionAngle + 90" ] } ] @@ -13653,7 +18285,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyInitialDirectionAngle() - 90" + "InitialDirectionAngle - 90" ] } ] @@ -13732,7 +18364,7 @@ "Object", "Behavior", "+", - "Object.X() - Object.Behavior::PropertyOldX()" + "Object.X() - OldX" ] }, { @@ -13743,7 +18375,7 @@ "Object", "Behavior", "+", - "Object.Y() - Object.Behavior::PropertyOldY()" + "Object.Y() - OldY" ] } ] @@ -13783,7 +18415,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyCenterX() + Object.Behavior::DeltaX()" + "CenterX + Object.Behavior::DeltaX()" ] } ] @@ -13811,7 +18443,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyCenterY() + Object.Behavior::DeltaY()" + "CenterY + Object.Behavior::DeltaY()" ] } ] @@ -13837,7 +18469,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::DirectionAngle() + Object.Behavior::PropertyRotationOffset()" + "Object.Behavior::DirectionAngle() + RotationOffset" ] } ] @@ -13928,7 +18560,7 @@ "Object", "Behavior", "+", - "360 * TimeDelta() / Object.Behavior::PropertyLoopDuration()" + "360 * TimeDelta() / LoopDuration" ] } ] @@ -14195,7 +18827,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMovementAngle()" + "MovementAngle" ] } ] @@ -14236,7 +18868,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "abs(Object.Behavior::PropertyLoopDuration())" + "abs(LoopDuration)" ] } ] @@ -14277,7 +18909,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyRadiusX()" + "RadiusX" ] } ] @@ -14318,7 +18950,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyRadiusY()" + "RadiusY" ] } ] @@ -14359,7 +18991,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCenterX()" + "CenterX" ] } ] @@ -14400,7 +19032,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCenterY()" + "CenterY" ] } ] @@ -14444,7 +19076,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -14490,7 +19122,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -14547,7 +19179,7 @@ "Object", "Behavior", "=", - "-GetArgumentAsNumber(\"Value\")" + "-Value" ] } ] @@ -14576,7 +19208,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -14621,7 +19253,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -14663,7 +19295,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "cos(ToRad(Object.Behavior::PropertyMovementAngle())) * Object.Behavior::PropertyRadiusX()" + "cos(ToRad(MovementAngle)) * RadiusX" ] } ] @@ -14703,7 +19335,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "sin(ToRad(Object.Behavior::PropertyMovementAngle())) * Object.Behavior::PropertyRadiusY()" + "sin(ToRad(MovementAngle)) * RadiusY" ] } ] @@ -14755,7 +19387,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMovementAngle() + 90" + "MovementAngle + 90" ] } ] @@ -14781,7 +19413,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMovementAngle() - 90" + "MovementAngle - 90" ] } ] @@ -14941,7 +19573,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", @@ -15008,7 +19640,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyLeftwardSpeed()", + "LeftwardSpeed", "log(1 - )" ] }, @@ -15019,7 +19651,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyRightwardSpeed()", + "RightwardSpeed", "log(1 - )" ] }, @@ -15030,7 +19662,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyUpwardSpeed()", + "UpwardSpeed", "log(1 - )" ] }, @@ -15041,7 +19673,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyDownwardSpeed()", + "DownwardSpeed", "log(1 - )" ] }, @@ -15052,7 +19684,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyLeftwardSpeedMax()", + "LeftwardSpeedMax", "log(1 - )" ] }, @@ -15063,7 +19695,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyRightwardSpeedMax()", + "RightwardSpeedMax", "log(1 - )" ] }, @@ -15074,7 +19706,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyUpwardSpeedMax()", + "UpwardSpeedMax", "log(1 - )" ] }, @@ -15085,7 +19717,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyDownwardSpeedMax()", + "DownwardSpeedMax", "log(1 - )" ] }, @@ -15096,7 +19728,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaLeft()", + "FollowFreeAreaLeft", "log(1 - )" ] }, @@ -15107,7 +19739,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaRight()", + "FollowFreeAreaRight", "log(1 - )" ] }, @@ -15118,7 +19750,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaTop()", + "FollowFreeAreaTop", "log(1 - )" ] }, @@ -15129,7 +19761,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyFollowFreeAreaBottom()", + "FollowFreeAreaBottom", "log(1 - )" ] }, @@ -15141,7 +19773,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyCameraDelay()" + "CameraDelay" ] } ] @@ -15381,7 +20013,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" ] @@ -15398,7 +20030,7 @@ "parameters": [ "", "<", - "Object.Behavior::PropertyOldX() - Object.Behavior::PropertyLeftwardSpeedMax() * TimeDelta()", + "OldX - LeftwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -15412,7 +20044,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldX() - Object.Behavior::PropertyLeftwardSpeedMax() * TimeDelta()", + "OldX - LeftwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -15445,7 +20077,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" ] @@ -15462,7 +20094,7 @@ "parameters": [ "", ">", - "Object.Behavior::PropertyOldX() + Object.Behavior::PropertyRightwardSpeedMax() * TimeDelta()", + "OldX + RightwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -15476,7 +20108,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldX() + Object.Behavior::PropertyRightwardSpeedMax() * TimeDelta()", + "OldX + RightwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -15538,7 +20170,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" ] @@ -15555,7 +20187,7 @@ "parameters": [ "", "<", - "Object.Behavior::PropertyOldY() - Object.Behavior::PropertyUpwardSpeedMax() * TimeDelta()", + "OldY - UpwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -15569,7 +20201,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldY() - Object.Behavior::PropertyUpwardSpeedMax() * TimeDelta()", + "OldY - UpwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -15602,7 +20234,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" ] @@ -15619,7 +20251,7 @@ "parameters": [ "", ">", - "Object.Behavior::PropertyOldY() + Object.Behavior::PropertyDownwardSpeedMax() * TimeDelta()", + "OldY + DownwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -15633,7 +20265,7 @@ "parameters": [ "", "=", - "Object.Behavior::PropertyOldY() + Object.Behavior::PropertyDownwardSpeedMax() * TimeDelta()", + "OldY + DownwardSpeedMax * TimeDelta()", "Object.Layer()", "0" ] @@ -15691,7 +20323,7 @@ "Object", "Behavior", "=", - "TimeFromStart() + GetArgumentAsNumber(\"WaitingDuration\")" + "TimeFromStart() + NewWaitingDuration" ] }, { @@ -15702,7 +20334,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"WaitingSpeedXMax\")" + "NewWaitingSpeedXMax" ] }, { @@ -15713,7 +20345,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"WaitingSpeedYMax\")" + "NewWaitingSpeedYMax" ] }, { @@ -15724,7 +20356,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"CatchUpDuration\")" + "NewCatchUpDuration" ] } ] @@ -15761,22 +20393,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" } ], @@ -15872,8 +20504,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])" ] }, { @@ -16028,10 +20660,10 @@ }, "parameters": [ "ShapePainter", - "Object.Behavior::PropertyProjectedOldestX()", - "Object.Behavior::PropertyProjectedOldestY()", - "Object.Behavior::PropertyProjectedNewestX()", - "Object.Behavior::PropertyProjectedNewestY()", + "ProjectedOldestX", + "ProjectedOldestY", + "ProjectedNewestX", + "ProjectedNewestY", "1" ] } @@ -16059,8 +20691,8 @@ }, "parameters": [ "ShapePainter", - "Object.Behavior::PropertyForecastedX()", - "Object.Behavior::PropertyForecastedY()", + "ForecastedX", + "ForecastedY", "3" ] }, @@ -16149,7 +20781,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"FollowOnX\"" + "\"Value\"" ] } ], @@ -16181,7 +20813,7 @@ }, { "description": "Follow on X axis", - "name": "FollowOnX", + "name": "Value", "type": "yesorno" } ], @@ -16219,7 +20851,7 @@ "value": "GetArgumentAsBoolean" }, "parameters": [ - "\"FollowOnY\"" + "\"Value\"" ] } ], @@ -16251,7 +20883,7 @@ }, { "description": "Follow on Y axis", - "name": "FollowOnY", + "name": "Value", "type": "yesorno" } ], @@ -16277,7 +20909,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaRight\"))" + "max(0, Value)" ] } ] @@ -16297,7 +20929,7 @@ }, { "description": "Follow free area right border", - "name": "SetFollowFreeAreaRight", + "name": "Value", "type": "expression" } ], @@ -16323,7 +20955,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaLeft\"))" + "max(0, Value)" ] } ] @@ -16343,7 +20975,7 @@ }, { "description": "Follow free area left border", - "name": "SetFollowFreeAreaLeft", + "name": "Value", "type": "expression" } ], @@ -16369,7 +21001,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"FollowFreeAreaTop\"))" + "max(0, Value)" ] } ] @@ -16389,7 +21021,7 @@ }, { "description": "Follow free area top border", - "name": "FollowFreeAreaTop", + "name": "Value", "type": "expression" } ], @@ -16415,7 +21047,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"SetFollowFreeAreaBottom\"))" + "max(0, Value)" ] } ] @@ -16435,7 +21067,7 @@ }, { "description": "Follow free area bottom border", - "name": "SetFollowFreeAreaBottom", + "name": "Value", "type": "expression" } ], @@ -16461,7 +21093,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -16481,7 +21113,7 @@ }, { "description": "Leftward maximum speed (in ratio per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -16507,7 +21139,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -16527,7 +21159,7 @@ }, { "description": "Rightward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -16553,7 +21185,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -16573,7 +21205,7 @@ }, { "description": "Upward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -16599,7 +21231,7 @@ "Object", "Behavior", "=", - "max(0, GetArgumentAsNumber(\"Speed\"))" + "max(0, Value)" ] } ] @@ -16619,7 +21251,7 @@ }, { "description": "Downward maximum speed (in pixels per second)", - "name": "Speed", + "name": "Value", "type": "expression" } ], @@ -16645,7 +21277,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"LeftwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -16656,7 +21288,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyLeftwardSpeed())" + "log(1 - Value)" ] } ] @@ -16676,7 +21308,7 @@ }, { "description": "Leftward catch-up speed (in ratio per second)", - "name": "LeftwardSpeed", + "name": "Value", "type": "expression" } ], @@ -16702,7 +21334,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"RightwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -16713,7 +21345,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyRightwardSpeed())" + "log(1 - Value)" ] } ] @@ -16733,7 +21365,7 @@ }, { "description": "Rightward catch-up speed (in ratio per second)", - "name": "RightwardSpeed", + "name": "Value", "type": "expression" } ], @@ -16759,7 +21391,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"DownwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -16770,7 +21402,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyDownwardSpeed())" + "log(1 - Value)" ] } ] @@ -16790,7 +21422,7 @@ }, { "description": "Downward catch-up speed (in ratio per second)", - "name": "DownwardSpeed", + "name": "Value", "type": "expression" } ], @@ -16816,7 +21448,7 @@ "Object", "Behavior", "=", - "clamp(0, 1, GetArgumentAsNumber(\"UpwardSpeed\"))" + "clamp(0, 1, Value)" ] }, { @@ -16827,7 +21459,7 @@ "Object", "Behavior", "=", - "log(1 - Object.Behavior::PropertyUpwardSpeed())" + "log(1 - Value)" ] } ] @@ -16847,7 +21479,7 @@ }, { "description": "Upward catch-up speed (in ratio per second)", - "name": "UpwardSpeed", + "name": "Value", "type": "expression" } ], @@ -16870,7 +21502,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCameraOffsetX()" + "CameraOffsetX" ] } ] @@ -16913,7 +21545,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -16967,7 +21599,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"CameraOffsetX\")", + "Value", "" ] } @@ -16988,7 +21620,7 @@ }, { "description": "Camera offset X", - "name": "CameraOffsetX", + "name": "Value", "type": "expression" } ], @@ -17011,7 +21643,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCameraOffsetY()" + "CameraOffsetY" ] } ] @@ -17066,7 +21698,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -17108,7 +21740,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"CameraOffsetY\")", + "CameraOffsetY", "" ] } @@ -17155,7 +21787,7 @@ "Object", "Behavior", "=", - "min(0, GetArgumentAsNumber(\"ForecastTime\"))" + "min(0, Value)" ] } ] @@ -17175,7 +21807,7 @@ }, { "description": "Forecast time", - "name": "ForecastTime", + "name": "Value", "type": "expression" } ], @@ -17201,7 +21833,7 @@ "Object", "Behavior", "=", - "min(0, GetArgumentAsNumber(\"CameraDelay\"))" + "min(0, Value)" ] } ] @@ -17221,7 +21853,7 @@ }, { "description": "Camera delay", - "name": "CameraDelay", + "name": "Value", "type": "expression" } ], @@ -17245,7 +21877,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedX() + Object.Behavior::PropertyCameraOffsetX() - Object.Behavior::PropertyFollowFreeAreaLeft()" + "ForecastedX + CameraOffsetX - FollowFreeAreaLeft" ] } ] @@ -17287,7 +21919,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedX() + Object.Behavior::PropertyCameraOffsetX() + Object.Behavior::PropertyFollowFreeAreaRight()" + "ForecastedX + CameraOffsetX + FollowFreeAreaRight" ] } ] @@ -17329,7 +21961,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedY() + Object.Behavior::PropertyCameraOffsetY() + Object.Behavior::PropertyFollowFreeAreaBottom()" + "ForecastedY + CameraOffsetY + FollowFreeAreaBottom" ] } ] @@ -17371,7 +22003,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyForecastedY() + Object.Behavior::PropertyCameraOffsetY() - Object.Behavior::PropertyFollowFreeAreaTop()" + "ForecastedY + CameraOffsetY - FollowFreeAreaTop" ] } ] @@ -17458,7 +22090,7 @@ "parameters": [ "Object", "__SmoothCamera.ObjectX", - "Object.Behavior::PropertyDelayedCenterX()" + "DelayedCenterX" ] }, { @@ -17468,7 +22100,7 @@ "parameters": [ "Object", "__SmoothCamera.ObjectY", - "Object.Behavior::PropertyDelayedCenterY()" + "DelayedCenterY" ] } ] @@ -17796,7 +22428,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]))))" ] } ], @@ -17811,7 +22443,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Extra delay: \" + ToString(Object.Behavior::PropertyCameraExtraDelay())", + "\"Extra delay: \" + ToString(CameraExtraDelay)", "\"info\"", "\"SmoothCamera\"" ] @@ -17950,7 +22582,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyCameraExtraDelay() / Object.Behavior::PropertyCameraDelayCatchUpDuration()" + "CameraExtraDelay / CameraDelayCatchUpDuration" ] } ], @@ -18009,7 +22641,7 @@ "Object", "Behavior", "=", - "max(0, Object.Behavior::PropertyCameraExtraDelay() -Object.Behavior::PropertyCameraDelayCatchUpSpeed() * TimeDelta())" + "max(0, CameraExtraDelay -CameraDelayCatchUpSpeed * TimeDelta())" ] } ], @@ -18024,7 +22656,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Catching up delay: \" + ToString(Object.Behavior::PropertyCameraExtraDelay())", + "\"Catching up delay: \" + ToString(CameraExtraDelay)", "\"info\"", "\"SmoothCamera\"" ] @@ -18115,7 +22747,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCameraDelay() + Object.Behavior::PropertyCameraExtraDelay()" + "CameraDelay + CameraExtraDelay" ] } ] @@ -18240,7 +22872,7 @@ "parameters": [ "Object", "__SmoothCamera.ForecastHistoryTime", - "GetArgumentAsNumber(\"Time\")" + "Time" ] }, { @@ -18250,7 +22882,7 @@ "parameters": [ "Object", "__SmoothCamera.ForecastHistoryX", - "GetArgumentAsNumber(\"ObjectX\")" + "ObjectX" ] }, { @@ -18260,7 +22892,7 @@ "parameters": [ "Object", "__SmoothCamera.ForecastHistoryY", - "GetArgumentAsNumber(\"ObjectY\")" + "ObjectY" ] } ], @@ -18299,7 +22931,7 @@ "Object", "__SmoothCamera.ForecastHistoryTime[0]", "<", - "TimeFromStart() - Object.Behavior::PropertyCameraDelay() - Object.Behavior::PropertyCameraExtraDelay() - Object.Behavior::PropertyForecastHistoryDuration()" + "TimeFromStart() - CameraDelay - CameraExtraDelay - ForecastHistoryDuration" ] } ], @@ -18391,7 +23023,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterX()" + "DelayedCenterX" ] }, { @@ -18402,7 +23034,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterY()" + "DelayedCenterY" ] } ] @@ -18515,7 +23147,7 @@ "Object", "Behavior", "+", - "Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()])" + "Object.Variable(__SmoothCamera.ForecastHistoryX[Index])" ] }, { @@ -18601,7 +23233,7 @@ "Object", "Behavior", "+", - "Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()])" + "Object.Variable(__SmoothCamera.ForecastHistoryY[Index])" ] }, { @@ -18644,7 +23276,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Mean: \" + ToString(Object.Behavior::PropertyForecastHistoryMeanX()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryMeanY())", + "\"Mean: \" + ToString(ForecastHistoryMeanX) + \" \" + ToString(ForecastHistoryMeanY)", "", "" ] @@ -18738,7 +23370,7 @@ "Object", "Behavior", "+", - "pow(Object.Variable(__SmoothCamera.ForecastHistoryX[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanX(), 2)" + "pow(Object.Variable(__SmoothCamera.ForecastHistoryX[Index]) - ForecastHistoryMeanX, 2)" ] }, { @@ -18749,7 +23381,7 @@ "Object", "Behavior", "+", - "pow(Object.Variable(__SmoothCamera.ForecastHistoryY[Object.Behavior::PropertyIndex()]) - Object.Behavior::PropertyForecastHistoryMeanY(), 2)" + "pow(Object.Variable(__SmoothCamera.ForecastHistoryY[Index]) - ForecastHistoryMeanY, 2)" ] }, { @@ -18760,7 +23392,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)" ] }, { @@ -18786,7 +23418,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\"" ] @@ -18801,7 +23433,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", "<", "1" ] @@ -18811,7 +23443,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())", + "abs(ForecastHistoryVarianceY)", "<", "1" ] @@ -18826,7 +23458,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterX()" + "DelayedCenterX" ] }, { @@ -18837,7 +23469,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyDelayedCenterY()" + "DelayedCenterY" ] } ] @@ -18856,7 +23488,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", ">=", "1" ] @@ -18866,7 +23498,7 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())", + "abs(ForecastHistoryVarianceY)", ">=", "1" ] @@ -18905,9 +23537,9 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", ">=", - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())" + "abs(ForecastHistoryVarianceY)" ] } ], @@ -18920,7 +23552,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryCovariance() / Object.Behavior::PropertyForecastHistoryVarianceX()" + "ForecastHistoryCovariance / ForecastHistoryVarianceX" ] }, { @@ -18931,7 +23563,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryMeanY() - Object.Behavior::PropertyForecastHistoryLinearA() * Object.Behavior::PropertyForecastHistoryMeanX()" + "ForecastHistoryMeanY - ForecastHistoryLinearA * ForecastHistoryMeanX" ] } ], @@ -18946,7 +23578,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Linear: \" + ToString(Object.Behavior::PropertyForecastHistoryLinearA()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryLinearB())", + "\"Linear: \" + ToString(ForecastHistoryLinearA) + \" \" + ToString(ForecastHistoryLinearB)", "\"info\"", "\"SmoothCamera\"" ] @@ -19007,9 +23639,9 @@ "value": "Egal" }, "parameters": [ - "abs(Object.Behavior::PropertyForecastHistoryVarianceX())", + "abs(ForecastHistoryVarianceX)", "<", - "abs(Object.Behavior::PropertyForecastHistoryVarianceY())" + "abs(ForecastHistoryVarianceY)" ] } ], @@ -19022,7 +23654,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryCovariance() / Object.Behavior::PropertyForecastHistoryVarianceY()" + "ForecastHistoryCovariance / ForecastHistoryVarianceY" ] }, { @@ -19033,7 +23665,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyForecastHistoryMeanX() - Object.Behavior::PropertyForecastHistoryLinearA() * Object.Behavior::PropertyForecastHistoryMeanY()" + "ForecastHistoryMeanX - ForecastHistoryLinearA * ForecastHistoryMeanY" ] } ], @@ -19048,7 +23680,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Linear: \" + ToString(Object.Behavior::PropertyForecastHistoryLinearA()) + \" \" + ToString(Object.Behavior::PropertyForecastHistoryLinearB())", + "\"Linear: \" + ToString(ForecastHistoryLinearA) + \" \" + ToString(ForecastHistoryLinearB)", "\"info\"", "\"SmoothCamera\"" ] @@ -19108,7 +23740,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedOldestX()" + "ProjectedOldestX" ] }, { @@ -19119,7 +23751,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedOldestY()" + "ProjectedOldestY" ] }, { @@ -19130,7 +23762,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyIndex()" + "Index" ] } ] @@ -19147,7 +23779,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestX()" + "ProjectedNewestX" ] }, { @@ -19158,7 +23790,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestY()" + "ProjectedNewestY" ] }, { @@ -19169,7 +23801,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyIndex()" + "Index" ] } ] @@ -19187,7 +23819,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Oldest: \" + ToString(Object.Behavior::PropertyProjectedOldestX()) + \" \" + ToString(Object.Behavior::PropertyProjectedOldestY())", + "\"Oldest: \" + ToString(ProjectedOldestX) + \" \" + ToString(ProjectedOldestY)", "\"info\"", "\"SmoothCamera\"" ] @@ -19204,7 +23836,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Newest: \" + ToString(Object.Behavior::PropertyProjectedNewestX()) + \" \" + ToString(Object.Behavior::PropertyProjectedNewestY())", + "\"Newest: \" + ToString(ProjectedNewestX) + \" \" + ToString(ProjectedNewestY)", "\"info\"", "\"SmoothCamera\"" ] @@ -19234,7 +23866,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestX() + ( Object.Behavior::PropertyProjectedNewestX() - Object.Behavior::PropertyProjectedOldestX()) * Object.Behavior::ForecastTimeRatio()" + "ProjectedNewestX + ( ProjectedNewestX - ProjectedOldestX) * Object.Behavior::ForecastTimeRatio()" ] }, { @@ -19245,7 +23877,7 @@ "Object", "Behavior", "=", - "Object.Behavior::PropertyProjectedNewestY() + ( Object.Behavior::PropertyProjectedNewestY() - Object.Behavior::PropertyProjectedOldestY()) * Object.Behavior::ForecastTimeRatio()" + "ProjectedNewestY + ( ProjectedNewestY - ProjectedOldestY) * Object.Behavior::ForecastTimeRatio()" ] } ] @@ -19260,7 +23892,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Forecasted: \" + ToString(Object.Behavior::PropertyForecastedX()) + \" \" + ToString(Object.Behavior::PropertyForecastedY())", + "\"Forecasted: \" + ToString(ForecastedX) + \" \" + ToString(ForecastedY)", "\"info\"", "\"SmoothCamera\"" ] @@ -19329,7 +23961,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))" ] }, { @@ -19340,7 +23972,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))" ] } ] @@ -19357,7 +23989,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))" ] }, { @@ -19368,7 +24000,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))" ] } ] @@ -19427,7 +24059,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]))" ] } ] @@ -19987,7 +24619,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorFollowFreeAreaTop()", + "FloorFollowFreeAreaTop", "" ] }, @@ -19998,7 +24630,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorFollowFreeAreaBottom()", + "FloorFollowFreeAreaBottom", "" ] }, @@ -20009,7 +24641,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorUpwardSpeed()", + "FloorUpwardSpeed", "" ] }, @@ -20020,7 +24652,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorDownwardSpeed()", + "FloorDownwardSpeed", "" ] }, @@ -20031,7 +24663,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorUpwardSpeedMax()", + "FloorUpwardSpeedMax", "" ] }, @@ -20042,7 +24674,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyFloorDownwardSpeedMax()", + "FloorDownwardSpeedMax", "" ] } @@ -20086,7 +24718,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirFollowFreeAreaTop()", + "AirFollowFreeAreaTop", "" ] }, @@ -20097,7 +24729,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirFollowFreeAreaBottom()", + "AirFollowFreeAreaBottom", "" ] }, @@ -20108,7 +24740,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirUpwardSpeed()", + "AirUpwardSpeed", "" ] }, @@ -20119,7 +24751,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirDownwardSpeed()", + "AirDownwardSpeed", "" ] }, @@ -20130,7 +24762,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirUpwardSpeedMax()", + "AirUpwardSpeedMax", "" ] }, @@ -20141,7 +24773,7 @@ "parameters": [ "Object", "SmoothCamera", - "Object.Behavior::PropertyAirDownwardSpeedMax()", + "AirDownwardSpeedMax", "" ] } @@ -20335,6 +24967,10 @@ "", "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" @@ -35503,7 +40139,7 @@ "height": 160, "keepRatio": true, "layer": "TouchControls", - "name": "TopArrowButton", + "name": "JumpButton", "persistentUuid": "781da2a6-e2cd-4270-b845-6b4de5eebb68", "width": 160, "x": 1080, @@ -35520,7 +40156,7 @@ "height": 240, "keepRatio": true, "layer": "TouchControls", - "name": "FlatDarkJoystick", + "name": "WalkJoystick", "persistentUuid": "18990dd3-deb2-43d4-bc2c-5fd03ccb3445", "width": 240, "x": 200, @@ -35545,6 +40181,5 @@ "windowMask": false } } - ], - "externalSourceFiles": [] + ] } \ No newline at end of file From 6d72f42e5fcb2a96de1ccbc10ddede085bc19706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 21 Jan 2025 17:25:57 +0100 Subject: [PATCH 09/15] [Multiplayer platformer arrow fight] Floating joystick --- .../multiplayer-platformer-arrow-fight.json | 13242 +++++++++++----- 1 file changed, 8966 insertions(+), 4276 deletions(-) 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 From 7fa3c1d2bcb2e7787c24f260d2c94a9e9a02584a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Wed, 22 Jan 2025 12:22:54 +0100 Subject: [PATCH 10/15] Add screen orientation checker. --- .../360\302\260-platformer.json" | 1161 +++++++++++- .../assets/rotate-screen-icon.png" | Bin 0 -> 1165 bytes .../3d-car-coin-hunt/3d-car-coin-hunt.json | 673 ++++--- .../assets/rotate-screen-icon2.png | Bin 0 -> 1165 bytes .../assets/rotate-screen-icon.png | Bin 0 -> 1165 bytes .../conviction-of-gun-dude-mobile.json | 1378 ++++++++++++-- .../platformer/assets/rotate-screen-icon.png | Bin 0 -> 1165 bytes examples/platformer/platformer.json | 1316 ++++++++++++- .../assets/rotate-screen-icon.png | Bin 0 -> 1165 bytes .../wave-defense-shooter.json | 1635 ++++++++++++++++- 10 files changed, 5647 insertions(+), 516 deletions(-) create mode 100644 "examples/360\302\260-platformer/assets/rotate-screen-icon.png" create mode 100644 examples/3d-car-coin-hunt/assets/rotate-screen-icon2.png create mode 100644 examples/conviction-of-gun-dude-mobile/assets/rotate-screen-icon.png create mode 100644 examples/platformer/assets/rotate-screen-icon.png create mode 100644 examples/wave-defense-shooter/assets/rotate-screen-icon.png 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 de7bc743e..cb93421a7 100644 --- "a/examples/360\302\260-platformer/360\302\260-platformer.json" +++ "b/examples/360\302\260-platformer/360\302\260-platformer.json" @@ -322,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": [] @@ -3238,6 +3250,16 @@ "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", @@ -3246,7 +3268,7 @@ "TouchId": 0, "TouchIndex": 2.0247e-320, "IsReleased": false, - "Radius": 160 + "Radius": 200 } ], "animations": [ @@ -3380,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" }, @@ -3441,12 +3612,6 @@ }, { "objectName": "Spring" - }, - { - "objectName": "WalkJoystick" - }, - { - "objectName": "JumpButton" } ] }, @@ -40125,6 +40290,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": [ @@ -40165,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": { 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 0000000000000000000000000000000000000000..a7726dee34eba34b401b26b73b5bf128ff7c26d7 GIT binary patch literal 1165 zcmV;81akX{P)*hJd< ze~Sxnj4ne+r5`VhE<;eS3Zu&alJoBuM%PA2S3kY{L|4HUOoP<=d8K0)xGv1@{yE)0 z{Y;=UTXDTi?zjNPhrg}an(IVO_oCt79f#PxCB%8aoWs8<-T=BVNl1s&#Zu@OY50My zx<1Y$YMN(}Fp`El&WZGJijb*I#u?OcVS2r8^u)TVX37}y=+c;8r;DCh5fD}nm|iOa zRgvga*5YUmcf7|0vi#q!c*I(ogbVKXj!WbtPaQpC|t;`*$ z0UbAGITFauxcL)7eRfchWg0}F+i+Pabb;3_pdyo0RG?zy-(H}hB0n}OAb6{6tj)2ns6PZWxyOQ-ENgL^s!d8jyLY!O;`*-Q1c$rlCX> zHJ=P*5=ur9feb>4D5?o$3`%5ljz9*X#Js2_kU=Q1bYBt37?e0n>*hJd< ze~Sxnj4ne+r5`VhE<;eS3Zu&alJoBuM%PA2S3kY{L|4HUOoP<=d8K0)xGv1@{yE)0 z{Y;=UTXDTi?zjNPhrg}an(IVO_oCt79f#PxCB%8aoWs8<-T=BVNl1s&#Zu@OY50My zx<1Y$YMN(}Fp`El&WZGJijb*I#u?OcVS2r8^u)TVX37}y=+c;8r;DCh5fD}nm|iOa zRgvga*5YUmcf7|0vi#q!c*I(ogbVKXj!WbtPaQpC|t;`*$ z0UbAGITFauxcL)7eRfchWg0}F+i+Pabb;3_pdyo0RG?zy-(H}hB0n}OAb6{6tj)2ns6PZWxyOQ-ENgL^s!d8jyLY!O;`*-Q1c$rlCX> zHJ=P*5=ur9feb>4D5?o$3`%5ljz9*X#Js2_kU=Q1bYBt37?e0n>*hJd< ze~Sxnj4ne+r5`VhE<;eS3Zu&alJoBuM%PA2S3kY{L|4HUOoP<=d8K0)xGv1@{yE)0 z{Y;=UTXDTi?zjNPhrg}an(IVO_oCt79f#PxCB%8aoWs8<-T=BVNl1s&#Zu@OY50My zx<1Y$YMN(}Fp`El&WZGJijb*I#u?OcVS2r8^u)TVX37}y=+c;8r;DCh5fD}nm|iOa zRgvga*5YUmcf7|0vi#q!c*I(ogbVKXj!WbtPaQpC|t;`*$ z0UbAGITFauxcL)7eRfchWg0}F+i+Pabb;3_pdyo0RG?zy-(H}hB0n}OAb6{6tj)2ns6PZWxyOQ-ENgL^s!d8jyLY!O;`*-Q1c$rlCX> zHJ=P*5=ur9feb>4D5?o$3`%5ljz9*X#Js2_kU=Q1bYBt37?e0n>", + "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": [] diff --git a/examples/platformer/assets/rotate-screen-icon.png b/examples/platformer/assets/rotate-screen-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a7726dee34eba34b401b26b73b5bf128ff7c26d7 GIT binary patch literal 1165 zcmV;81akX{P)*hJd< ze~Sxnj4ne+r5`VhE<;eS3Zu&alJoBuM%PA2S3kY{L|4HUOoP<=d8K0)xGv1@{yE)0 z{Y;=UTXDTi?zjNPhrg}an(IVO_oCt79f#PxCB%8aoWs8<-T=BVNl1s&#Zu@OY50My zx<1Y$YMN(}Fp`El&WZGJijb*I#u?OcVS2r8^u)TVX37}y=+c;8r;DCh5fD}nm|iOa zRgvga*5YUmcf7|0vi#q!c*I(ogbVKXj!WbtPaQpC|t;`*$ z0UbAGITFauxcL)7eRfchWg0}F+i+Pabb;3_pdyo0RG?zy-(H}hB0n}OAb6{6tj)2ns6PZWxyOQ-ENgL^s!d8jyLY!O;`*-Q1c$rlCX> zHJ=P*5=ur9feb>4D5?o$3`%5ljz9*X#Js2_kU=Q1bYBt37?e0n>", + "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": "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 0000000000000000000000000000000000000000..a7726dee34eba34b401b26b73b5bf128ff7c26d7 GIT binary patch literal 1165 zcmV;81akX{P)*hJd< ze~Sxnj4ne+r5`VhE<;eS3Zu&alJoBuM%PA2S3kY{L|4HUOoP<=d8K0)xGv1@{yE)0 z{Y;=UTXDTi?zjNPhrg}an(IVO_oCt79f#PxCB%8aoWs8<-T=BVNl1s&#Zu@OY50My zx<1Y$YMN(}Fp`El&WZGJijb*I#u?OcVS2r8^u)TVX37}y=+c;8r;DCh5fD}nm|iOa zRgvga*5YUmcf7|0vi#q!c*I(ogbVKXj!WbtPaQpC|t;`*$ z0UbAGITFauxcL)7eRfchWg0}F+i+Pabb;3_pdyo0RG?zy-(H}hB0n}OAb6{6tj)2ns6PZWxyOQ-ENgL^s!d8jyLY!O;`*-Q1c$rlCX> zHJ=P*5=ur9feb>4D5?o$3`%5ljz9*X#Js2_kU=Q1bYBt37?e0n>", + "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": [] + "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 From 57768a960c03c47f3499010d9eb031225ad572bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Wed, 22 Jan 2025 16:14:33 +0100 Subject: [PATCH 11/15] Add more screen orientation checker. --- examples/3d-first-person/3d-first-person.json | 1237 ++++++++++++++- .../assets/rotate-screen-icon.png | Bin 0 -> 1165 bytes examples/3d-platformer/3d-platformer.json | 1178 +++++++++++++- .../assets/rotate-screen-icon.png | Bin 0 -> 1165 bytes .../3d-shooting-gallery.json | 1364 +++++++++++++++-- .../assets/rotate-screen-icon.png | Bin 0 -> 1165 bytes 6 files changed, 3589 insertions(+), 190 deletions(-) create mode 100644 examples/3d-first-person/assets/rotate-screen-icon.png create mode 100644 examples/3d-platformer/assets/rotate-screen-icon.png create mode 100644 examples/3d-shooting-gallery/assets/rotate-screen-icon.png 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 0000000000000000000000000000000000000000..a7726dee34eba34b401b26b73b5bf128ff7c26d7 GIT binary patch literal 1165 zcmV;81akX{P)*hJd< ze~Sxnj4ne+r5`VhE<;eS3Zu&alJoBuM%PA2S3kY{L|4HUOoP<=d8K0)xGv1@{yE)0 z{Y;=UTXDTi?zjNPhrg}an(IVO_oCt79f#PxCB%8aoWs8<-T=BVNl1s&#Zu@OY50My zx<1Y$YMN(}Fp`El&WZGJijb*I#u?OcVS2r8^u)TVX37}y=+c;8r;DCh5fD}nm|iOa zRgvga*5YUmcf7|0vi#q!c*I(ogbVKXj!WbtPaQpC|t;`*$ z0UbAGITFauxcL)7eRfchWg0}F+i+Pabb;3_pdyo0RG?zy-(H}hB0n}OAb6{6tj)2ns6PZWxyOQ-ENgL^s!d8jyLY!O;`*-Q1c$rlCX> zHJ=P*5=ur9feb>4D5?o$3`%5ljz9*X#Js2_kU=Q1bYBt37?e0n>", + "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 0000000000000000000000000000000000000000..a7726dee34eba34b401b26b73b5bf128ff7c26d7 GIT binary patch literal 1165 zcmV;81akX{P)*hJd< ze~Sxnj4ne+r5`VhE<;eS3Zu&alJoBuM%PA2S3kY{L|4HUOoP<=d8K0)xGv1@{yE)0 z{Y;=UTXDTi?zjNPhrg}an(IVO_oCt79f#PxCB%8aoWs8<-T=BVNl1s&#Zu@OY50My zx<1Y$YMN(}Fp`El&WZGJijb*I#u?OcVS2r8^u)TVX37}y=+c;8r;DCh5fD}nm|iOa zRgvga*5YUmcf7|0vi#q!c*I(ogbVKXj!WbtPaQpC|t;`*$ z0UbAGITFauxcL)7eRfchWg0}F+i+Pabb;3_pdyo0RG?zy-(H}hB0n}OAb6{6tj)2ns6PZWxyOQ-ENgL^s!d8jyLY!O;`*-Q1c$rlCX> zHJ=P*5=ur9feb>4D5?o$3`%5ljz9*X#Js2_kU=Q1bYBt37?e0n>", + "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": "Ceiling", + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 2, + "height": 850, + "layer": "", + "name": "FloorCeiling", + "persistentUuid": "aaaa7338-1f86-4d03-9168-2b2609a3dc3d", + "width": 1475, + "x": -100, + "y": -75, + "z": 300, + "zOrder": 21, + "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": "UI", + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "UI", + "name": "Accuracy", + "persistentUuid": "b5019c11-87d3-4ed4-8676-2ace82562779", + "width": 0, + "x": 0, + "y": 675, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "layer": "UI", + "name": "ScoreLabel", + "persistentUuid": "657c444c-c35a-495d-9339-706719b40aa5", + "width": 0, + "x": 0, + "y": 625, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 114, + "layer": "UI", + "name": "Restart", + "persistentUuid": "aeda810d-fff4-4b92-96c4-d39161c38bd8", + "width": 700, + "x": 325, + "y": 285, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 100, + "layer": "UI", + "name": "TimeLimit", + "persistentUuid": "58a58131-ea97-4da4-8348-6f675f44ada2", + "width": 125, + "x": 575, + "y": 25, + "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": [] 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 0000000000000000000000000000000000000000..a7726dee34eba34b401b26b73b5bf128ff7c26d7 GIT binary patch literal 1165 zcmV;81akX{P)*hJd< ze~Sxnj4ne+r5`VhE<;eS3Zu&alJoBuM%PA2S3kY{L|4HUOoP<=d8K0)xGv1@{yE)0 z{Y;=UTXDTi?zjNPhrg}an(IVO_oCt79f#PxCB%8aoWs8<-T=BVNl1s&#Zu@OY50My zx<1Y$YMN(}Fp`El&WZGJijb*I#u?OcVS2r8^u)TVX37}y=+c;8r;DCh5fD}nm|iOa zRgvga*5YUmcf7|0vi#q!c*I(ogbVKXj!WbtPaQpC|t;`*$ z0UbAGITFauxcL)7eRfchWg0}F+i+Pabb;3_pdyo0RG?zy-(H}hB0n}OAb6{6tj)2ns6PZWxyOQ-ENgL^s!d8jyLY!O;`*-Q1c$rlCX> zHJ=P*5=ur9feb>4D5?o$3`%5ljz9*X#Js2_kU=Q1bYBt37?e0n> Date: Wed, 22 Jan 2025 16:44:39 +0100 Subject: [PATCH 12/15] [Multiplayer platformer pickup] Floating joystick. --- .../multiplayer-platformer-pickup.json | 3759 +++++++++++++---- 1 file changed, 2994 insertions(+), 765 deletions(-) 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 From f16b911470864a08256b05a18ad9c91f65012aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Wed, 22 Jan 2025 16:59:39 +0100 Subject: [PATCH 13/15] Fix window adaptation. --- .../wave-defense-shooter.json | 54 ++++++++++--------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/examples/wave-defense-shooter/wave-defense-shooter.json b/examples/wave-defense-shooter/wave-defense-shooter.json index 0db23b23e..816f6751c 100644 --- a/examples/wave-defense-shooter/wave-defense-shooter.json +++ b/examples/wave-defense-shooter/wave-defense-shooter.json @@ -1961,26 +1961,6 @@ "\"transition\"", "" ] - }, - { - "type": { - "value": "SetCenterX" - }, - "parameters": [ - "MainMenuElement", - "=", - "CameraCenterX()" - ] - }, - { - "type": { - "value": "SetCenterX" - }, - "parameters": [ - "SettingsElement", - "=", - "CameraCenterX() + CameraWidth()" - ] } ], "events": [ @@ -2008,6 +1988,32 @@ } ] }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetCenterX" + }, + "parameters": [ + "MainMenuElement", + "=", + "0.5 * CameraWidth()" + ] + }, + { + "type": { + "value": "SetCenterX" + }, + "parameters": [ + "SettingsElement", + "=", + "1.5 * CameraWidth()" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -4987,13 +4993,13 @@ "effects": [], "behaviors": [ { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", "bottomEdgeAnchor": 0, "leftEdgeAnchor": 1, - "name": "Anchor", "relativeToOriginalWindowSize": true, "rightEdgeAnchor": 2, "topEdgeAnchor": 0, - "type": "AnchorBehavior::AnchorBehavior", "useLegacyBottomAndRightAnchors": false } ], @@ -5830,13 +5836,13 @@ "effects": [], "behaviors": [ { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", "bottomEdgeAnchor": 2, "leftEdgeAnchor": 1, - "name": "Anchor", "relativeToOriginalWindowSize": true, "rightEdgeAnchor": 2, "topEdgeAnchor": 1, - "type": "AnchorBehavior::AnchorBehavior", "useLegacyBottomAndRightAnchors": false } ], From 7eca7039022a7347248618ca687c05469e5ea8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Thu, 23 Jan 2025 14:36:16 +0100 Subject: [PATCH 14/15] Update snapshots. --- .../__snapshots__/exampleShortHeaders.json.spec.js.snap | 5 ++--- scripts/generate-database.js | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) 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/scripts/generate-database.js b/scripts/generate-database.js index 2356f7217..f0106e30b 100644 --- a/scripts/generate-database.js +++ b/scripts/generate-database.js @@ -318,8 +318,7 @@ const extractExamples = async ( ? 'big' : 'huge'; /** @type {ExampleUsedExtension[]} */ - const usedExtensions = gd.UsedExtensionsFinder.scanProject(project) - .getUsedExtensions() + const usedExtensions = gd.ExampleExtensionUsagesFinder.getUsedExtensions(project) .toNewVectorString() .toJSArray() .map( From 33008a9d7f9e8a218b545f5853a170e73601b981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 24 Jan 2025 16:07:49 +0100 Subject: [PATCH 15/15] Format --- scripts/generate-database.js | 43 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/scripts/generate-database.js b/scripts/generate-database.js index f0106e30b..7dfb09418 100644 --- a/scripts/generate-database.js +++ b/scripts/generate-database.js @@ -318,28 +318,29 @@ const extractExamples = async ( ? 'big' : 'huge'; /** @type {ExampleUsedExtension[]} */ - const usedExtensions = gd.ExampleExtensionUsagesFinder.getUsedExtensions(project) - .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) {