From 21f2e2174ad167f2239e192defbdba2deed905ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 15 Jul 2025 17:56:59 +0200 Subject: [PATCH 1/9] Update extensions --- examples/space-asteroids/space-asteroids.json | 13648 +++++++++------- 1 file changed, 7882 insertions(+), 5766 deletions(-) diff --git a/examples/space-asteroids/space-asteroids.json b/examples/space-asteroids/space-asteroids.json index b6071f1e8..4c4e02cff 100644 --- a/examples/space-asteroids/space-asteroids.json +++ b/examples/space-asteroids/space-asteroids.json @@ -1,9 +1,9 @@ { "firstLayout": "", "gdVersion": { - "build": 99, - "major": 4, - "minor": 0, + "build": 236, + "major": 5, + "minor": 5, "revision": 0 }, "properties": { @@ -18,7 +18,6 @@ "scaleMode": "linear", "sizeOnStartupMode": "", "templateSlug": "", - "useExternalSourceFiles": false, "version": "1.0.0", "name": "Asteroids - GDevelop Example", "description": "", @@ -67,7 +66,6 @@ "resources": { "resources": [ { - "alwaysLoaded": false, "file": "assets/playerShip3_red.png", "kind": "image", "metadata": "", @@ -76,7 +74,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/laserBlue06.png", "kind": "image", "metadata": "", @@ -85,7 +82,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/meteorBrown_big1.png", "kind": "image", "metadata": "", @@ -94,7 +90,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/meteorBrown_big2.png", "kind": "image", "metadata": "", @@ -103,7 +98,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/meteorBrown_big3.png", "kind": "image", "metadata": "", @@ -112,7 +106,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/meteorBrown_big4.png", "kind": "image", "metadata": "", @@ -121,7 +114,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/meteorBrown_med1.png", "kind": "image", "metadata": "", @@ -130,7 +122,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/meteorBrown_med3.png", "kind": "image", "metadata": "", @@ -139,7 +130,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/meteorBrown_small1.png", "kind": "image", "metadata": "", @@ -148,7 +138,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/meteorBrown_small2.png", "kind": "image", "metadata": "", @@ -157,7 +146,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/playerLife3_red.png", "kind": "image", "metadata": "", @@ -173,7 +161,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/star1.png", "kind": "image", "metadata": "", @@ -222,7 +209,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Left arrow round button.png", "kind": "image", "metadata": "", @@ -235,7 +221,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Top arrow round button.png", "kind": "image", "metadata": "", @@ -248,7 +233,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Fire round button2.png", "kind": "image", "metadata": "", @@ -261,7 +245,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/playerLife3_red.png", "kind": "image", "metadata": "", @@ -270,7 +253,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/playerLife3_empty.png", "kind": "image", "metadata": "", @@ -1704,6 +1686,7 @@ "assetStoreId": "", "name": "LifeBar", "type": "TiledUnitsBar::TiledUnitsBar", + "variant": "", "variables": [], "effects": [], "behaviors": [ @@ -1804,6 +1787,7 @@ "text": "Game Over", "font": "PTSans-Bold.ttf", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 120, "color": "255;255;255" } @@ -1830,6 +1814,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 255, "particleBlue2": 255, + "particleColor1": "255;255;255", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": 0, "particleGreen1": 255, @@ -1875,6 +1861,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 255, "particleBlue2": 100, + "particleColor1": "255;255;255", + "particleColor2": "100;100;100", "particleGravityX": 0, "particleGravityY": 0, "particleGreen1": 255, @@ -1920,6 +1908,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 255, "particleBlue2": 255, + "particleColor1": "255;255;255", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": 0, "particleGreen1": 255, @@ -1965,6 +1955,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 255, "particleBlue2": 255, + "particleColor1": "255;255;255", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": 0, "particleGreen1": 255, @@ -2010,6 +2002,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 255, "particleBlue2": 255, + "particleColor1": "255;255;255", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": 0, "particleGreen1": 255, @@ -2055,6 +2049,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 245, "particleBlue2": 129, + "particleColor1": "113;231;245", + "particleColor2": "129;129;129", "particleGravityX": 0, "particleGravityY": 0, "particleGreen1": 231, @@ -2100,6 +2096,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 245, "particleBlue2": 129, + "particleColor1": "113;231;245", + "particleColor2": "129;129;129", "particleGravityX": 0, "particleGravityY": 0, "particleGreen1": 231, @@ -2145,6 +2143,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 255, "particleBlue2": 255, + "particleColor1": "255;255;255", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": 0, "particleGreen1": 255, @@ -2190,6 +2190,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 255, "particleBlue2": 255, + "particleColor1": "255;255;255", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": 0, "particleGreen1": 255, @@ -2250,6 +2252,7 @@ "text": "A/W/D or Arrows To Move. Space To Shoot.", "font": "PTSans-Bold.ttf", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 30, "color": "143;143;143" } @@ -2291,6 +2294,7 @@ "text": "Press any key to continue", "font": "PTSans-Bold.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 30, "color": "143;143;143" } @@ -4319,16 +4323,17 @@ "category": "Game mechanic", "extensionNamespace": "", "fullName": "Fire bullets", + "gdevelopVersion": ">=5.5.222", "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.7.0", + "version": "0.9.1", "description": [ - "This extension allows objects to fire bullets.", + "This extension allows objects to fire bullets. To use it, add the behavior to the object that will shoot, then use the provided action to launch another object as the bullet.", "", - "It handles:", + "The properties of the behavior can be used to customize:", "- Cooldown between shots", "- Firing multiple bullets at a time ([open the project online](https://editor.gdevelop.io/?project=example://fire-bullet))", "- Ammo management", @@ -4367,7 +4372,7 @@ "eventsFunctions": [], "eventsBasedBehaviors": [ { - "description": "Fire bullets, manage ammo, reloading, and overheating.", + "description": "Fire bullets, manage ammo, reloading, and overheating. Once added to your object that must shoot, use the behavior action in your events to fire another object as a bullet.", "fullName": "Fire bullets", "name": "FireBullet", "objectType": "", @@ -4393,24 +4398,22 @@ }, { "type": { - "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AmmoQuantity", "=", - "Object.Behavior::PropertyStartingAmmo()" + "StartingAmmo" ] }, { "type": { - "value": "FireBullet::FireBullet::SetPropertyShotsBeforeNextReload" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsBeforeNextReload", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -4463,114 +4466,93 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyHasJustFired" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HasJustFired", + "True", + "" ] } ], - "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": "SetBooleanVariable" + }, + "parameters": [ + "HasJustFired", + "False", + "" + ] + }, + { + "type": { + "value": "ResetObjectTimer" + }, + "parameters": [ + "Object", + "\"__FireBullet.FiringCooldown\"" + ] }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TotalShotsFired", + "+", + "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": [ { "type": { "inverted": true, - "value": "FireBullet::FireBullet::PropertyUnlimitedAmmo" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "UnlimitedAmmo", + "True", + "" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AmmoQuantity", "=", - "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": [ { "type": { - "value": "FireBullet::FireBullet::PropertyShotsPerReload" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsPerReload", ">", "0" ] @@ -4579,39 +4561,27 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyShotsBeforeNextReload" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsBeforeNextReload", "-", "1" ] } ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Automatically reload gun when needed", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyAutomaticReloading" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "AutomaticReloading", + "True", + "" ] }, { @@ -4657,32 +4627,19 @@ "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": [ { "type": { - "value": "FireBullet::FireBullet::PropertyHeatIncreasePerShot" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HeatIncreasePerShot", ">", "0" ] @@ -4691,39 +4648,25 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyHeatLevel" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HeatLevel", "+", - "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": [ { "type": { - "value": "FireBullet::FireBullet::PropertyOverheatDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "OverheatDuration", ">", "0" ] @@ -4755,63 +4698,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": [] } ] } @@ -4823,7 +4709,7 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Reload gun when needed", + "name": "Reload", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ @@ -4860,30 +4746,29 @@ "Object", "\"__FireBullet.ReloadingTimer\"", ">=", - "Object.Behavior::PropertyReloadDuration()" + "ReloadDuration" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyTotalReloadsCompleted" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TotalReloadsCompleted", "+", "1" ] }, { "type": { - "value": "FireBullet::FireBullet::SetPropertyReloadInProgress" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "ReloadInProgress", + "False", + "" ] } ], @@ -4905,13 +4790,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyShotsBeforeNextReload" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsBeforeNextReload", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -4946,13 +4830,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyShotsBeforeNextReload" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsBeforeNextReload", "=", - "min(Object.Behavior::PropertyShotsPerReload(), Object.Behavior::PropertyAmmoQuantity())" + "min(ShotsPerReload, AmmoQuantity)" ] } ] @@ -4967,7 +4850,7 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Reduce heat level (based on cooling rate)", + "name": "Cooling", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ @@ -4979,7 +4862,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "Object.Behavior::HeatLevel()", + "HeatLevel", ">", "0" ] @@ -4992,11 +4875,10 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyExponentialCoolingRate" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ExponentialCoolingRate", ">", "0" ] @@ -5005,13 +4887,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyHeatLevel" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HeatLevel", "=", - "max(0, Object.Behavior::PropertyHeatLevel() - TimeDelta() * Object.Behavior::PropertyExponentialCoolingRate() * Object.Behavior::PropertyHeatLevel())" + "max(0, HeatLevel - TimeDelta() * ExponentialCoolingRate * HeatLevel)" ] } ] @@ -5021,11 +4902,10 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyLinearCoolingRate" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "LinearCoolingRate", ">", "0" ] @@ -5034,13 +4914,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyHeatLevel" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HeatLevel", "=", - "max(0, Object.Behavior::PropertyHeatLevel() - TimeDelta() * Object.Behavior::PropertyLinearCoolingRate())" + "max(0, HeatLevel - TimeDelta() * LinearCoolingRate)" ] } ] @@ -5074,37 +4953,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": [ @@ -5155,37 +5022,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": [ @@ -5241,242 +5096,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": "SetBooleanVariable" + }, + "parameters": [ + "HasJustFired", + "True", + "" + ] + } + ], "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" ] } ] @@ -5484,12 +5285,23 @@ ] } ], - "parameters": [] + "variables": [ + { + "folded": true, + "name": "MultiShotAngle", + "type": "number", + "value": 0 + }, + { + "name": "BulletIndex", + "type": "number", + "value": 0 + } + ] } ] } - ], - "parameters": [] + ] } ], "parameters": [ @@ -5573,9 +5385,9 @@ "parameters": [ "", "Bullet", - "GetArgumentAsNumber(\"XPosition\")", - "GetArgumentAsNumber(\"YPosition\")", - "Object.Behavior::PropertyBulletLayer()" + "XPosition", + "YPosition", + "BulletLayer" ] } ], @@ -5598,13 +5410,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyRandomizedAngle" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "RandomizedAngle", "=", - "GetArgumentAsNumber(\"Angle\") + RandomInRange(-Object.Behavior::PropertyAngleVariance(), Object.Behavior::PropertyAngleVariance())" + "Angle + RandomInRange(-AngleVariance, AngleVariance)" ] }, { @@ -5613,64 +5424,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": { @@ -5688,11 +5448,12 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyRotateBullet" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "RotateBullet", + "True", + "" ] } ], @@ -5704,7 +5465,7 @@ "parameters": [ "Bullet", "=", - "Object.Behavior::PropertyRandomizedAngle()" + "RandomizedAngle" ] } ] @@ -5729,11 +5490,10 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyTotalBulletsCreated" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TotalBulletsCreated", "+", "1" ] @@ -5809,12 +5569,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyReloadInProgress" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "ReloadInProgress", + "True", + "" ] }, { @@ -5852,30 +5612,17 @@ "name": "HasJustFired", "sentence": "_PARAM0_ has just fired", "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "False" - ] - } - ] - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyHasJustFired" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HasJustFired", + "True", + "" ] } ], @@ -5919,11 +5666,12 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyRotateBullet" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "RotateBullet", + "True", + "" ] } ], @@ -5971,7 +5719,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFiringArc()" + "FiringArc" ] } ] @@ -6008,13 +5756,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyFiringArc" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FiringArc", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6061,7 +5808,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -6105,7 +5852,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAngleVariance()" + "AngleVariance" ] } ] @@ -6142,13 +5889,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAngleVariance" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AngleVariance", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6195,7 +5941,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -6239,7 +5985,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBulletSpeedVariance()" + "BulletSpeedVariance" ] } ] @@ -6276,13 +6022,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyBulletSpeedVariance" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BulletSpeedVariance", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6329,7 +6074,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -6373,7 +6118,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBulletQuantity()" + "BulletQuantity" ] } ] @@ -6410,13 +6155,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyBulletQuantity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BulletQuantity", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6463,7 +6207,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -6504,13 +6248,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyBulletLayer" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "BulletLayer", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -6550,22 +6293,24 @@ { "type": { "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"RotateBullet\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyRotateBullet" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "RotateBullet", + "False", + "" ] } ] @@ -6575,22 +6320,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"RotateBullet\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyRotateBullet" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "RotateBullet", + "True", + "" ] } ] @@ -6611,7 +6358,7 @@ { "defaultValue": "yes", "description": "Rotate bullet to match trajetory", - "name": "RotateBullet", + "name": "Value", "optional": true, "type": "yesorno" } @@ -6632,22 +6379,24 @@ { "type": { "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"UnlimitedAmmo\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyUnlimitedAmmo" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "UnlimitedAmmo", + "False", + "" ] } ] @@ -6657,22 +6406,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"UnlimitedAmmo\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyUnlimitedAmmo" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "UnlimitedAmmo", + "True", + "" ] } ] @@ -6693,7 +6444,7 @@ { "defaultValue": "yes", "description": "Unlimited ammo", - "name": "UnlimitedAmmo", + "name": "Value", "optional": true, "type": "yesorno" } @@ -6717,7 +6468,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFireCooldown()" + "FireCooldown" ] } ] @@ -6754,13 +6505,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyFireCooldown" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FireCooldown", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6807,7 +6557,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"NewCooldown\")", + "Value", "" ] } @@ -6828,7 +6578,7 @@ }, { "description": "Cooldown in seconds", - "name": "NewCooldown", + "name": "Value", "type": "expression" } ], @@ -6851,7 +6601,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyReloadDuration()" + "ReloadDuration" ] } ] @@ -6888,13 +6638,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyReloadDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ReloadDuration", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6941,7 +6690,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -6985,7 +6734,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyOverheatDuration()" + "OverheatDuration" ] } ] @@ -7022,13 +6771,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyOverheatDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "OverheatDuration", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -7075,7 +6823,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -7119,7 +6867,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAmmoQuantity()" + "AmmoQuantity" ] } ] @@ -7156,13 +6904,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AmmoQuantity", "=", - "max(0,Value)" + "max(0, Value)" ] } ] @@ -7209,7 +6956,7 @@ "Object", "Behavior", "=", - "max(0,Value)", + "max(0, Value)", "" ] } @@ -7253,7 +7000,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHeatIncreasePerShot()" + "HeatIncreasePerShot" ] } ] @@ -7290,13 +7037,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyHeatIncreasePerShot" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HeatIncreasePerShot", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -7343,7 +7089,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -7387,7 +7133,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxAmmo()" + "MaxAmmo" ] } ] @@ -7424,13 +7170,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyMaxAmmo" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxAmmo", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -7440,11 +7185,10 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyMaxAmmo" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxAmmo", ">", "0" ] @@ -7453,13 +7197,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AmmoQuantity", "=", - "min(Object.Behavior::MaxAmmo(),Object.Behavior::AmmoQuantity())" + "min(MaxAmmo, AmmoQuantity)" ] } ] @@ -7506,7 +7249,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -7547,11 +7290,10 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyTotalShotsFired" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TotalShotsFired", "=", "0" ] @@ -7588,11 +7330,10 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyTotalBulletsCreated" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TotalBulletsCreated", "=", "0" ] @@ -7629,11 +7370,10 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyTotalReloadsCompleted" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TotalReloadsCompleted", "=", "0" ] @@ -7673,7 +7413,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -7710,13 +7450,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyShotsPerReload" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsPerReload", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -7726,26 +7465,24 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyShotsBeforeNextReload" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsBeforeNextReload", ">", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyShotsBeforeNextReload" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsBeforeNextReload", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -7792,7 +7529,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -7833,12 +7570,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAutomaticReloading" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "=" + "AutomaticReloading", + "False", + "" ] } ] @@ -7848,22 +7585,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Value\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAutomaticReloading" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "AutomaticReloading", + "True", + "" ] } ] @@ -7908,7 +7647,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyLinearCoolingRate()" + "LinearCoolingRate" ] } ] @@ -7945,13 +7684,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyLinearCoolingRate" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "LinearCoolingRate", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -7998,7 +7736,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -8042,7 +7780,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyExponentialCoolingRate()" + "ExponentialCoolingRate" ] } ] @@ -8079,13 +7817,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyExponentialCoolingRate" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ExponentialCoolingRate", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -8133,7 +7870,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -8174,13 +7911,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AmmoQuantity", "+", - "GetArgumentAsNumber(\"AmmoGained\")" + "AmmoGained" ] } ] @@ -8202,11 +7938,10 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyMaxAmmo" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxAmmo", ">", "0" ] @@ -8215,13 +7950,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AmmoQuantity", "=", - "min(Object.Behavior::MaxAmmo(),Object.Behavior::AmmoQuantity())" + "min(MaxAmmo, AmmoQuantity)" ] } ] @@ -8241,11 +7975,12 @@ }, { "type": { - "value": "FireBullet::FireBullet::PropertyAutomaticReloading" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "AutomaticReloading", + "True", + "" ] } ], @@ -8300,7 +8035,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyBulletLayer()" + "BulletLayer" ] } ] @@ -8341,7 +8076,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "min(1,Object.Behavior::PropertyHeatLevel())" + "min(1, HeatLevel)" ] } ] @@ -8382,7 +8117,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTotalShotsFired()" + "TotalShotsFired" ] } ] @@ -8423,7 +8158,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTotalBulletsCreated()" + "TotalBulletsCreated" ] } ] @@ -8464,7 +8199,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTotalReloadsCompleted()" + "TotalReloadsCompleted" ] } ] @@ -8505,7 +8240,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShotsBeforeNextReload()" + "ShotsBeforeNextReload" ] } ] @@ -8546,7 +8281,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::Cooldown() - Object.ObjectTimerElapsedTime(\"__FireBullet.FiringCooldown\"))" + "max(0, FireCooldown - Object.ObjectTimerElapsedTime(\"__FireBullet.FiringCooldown\"))" ] } ] @@ -8599,7 +8334,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0, Object.Behavior::PropertyOverheatDuration() - Object.ObjectTimerElapsedTime(\"__FireBullet.OverheatDuration\"))" + "max(0, OverheatDuration - Object.ObjectTimerElapsedTime(\"__FireBullet.OverheatDuration\"))" ] } ] @@ -8652,7 +8387,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0, Object.Behavior::PropertyReloadDuration() - Object.ObjectTimerElapsedTime(\"__FireBullet.ReloadingTimer\"))" + "max(0, ReloadDuration - Object.ObjectTimerElapsedTime(\"__FireBullet.ReloadingTimer\"))" ] } ] @@ -8703,11 +8438,12 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyReloadInProgress" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "ReloadInProgress", + "True", + "" ] } ], @@ -8771,11 +8507,12 @@ "subInstructions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyHasJustFired" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HasJustFired", + "True", + "" ] }, { @@ -8907,11 +8644,12 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyAutomaticReloading" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "AutomaticReloading", + "True", + "" ] } ], @@ -8969,11 +8707,12 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyUnlimitedAmmo" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "UnlimitedAmmo", + "True", + "" ] } ], @@ -9042,11 +8781,10 @@ }, { "type": { - "value": "FireBullet::FireBullet::PropertyAmmoQuantity" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AmmoQuantity", "<=", "0" ] @@ -9118,22 +8856,20 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyShotsPerReload" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsPerReload", ">", "0" ] }, { "type": { - "value": "FireBullet::FireBullet::PropertyShotsBeforeNextReload" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsBeforeNextReload", "=", "0" ] @@ -9199,11 +8935,10 @@ "subInstructions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyHeatLevel" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HeatLevel", ">=", "1" ] @@ -9319,17 +9054,12 @@ "unit": "Second", "label": "Firing cooldown", "description": "Objects cannot shoot while firing cooldown is active.", - "group": "", - "extraInformation": [], "name": "FireCooldown" }, { "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "HasJustFired" }, @@ -9337,9 +9067,6 @@ "value": "true", "type": "Boolean", "label": "Rotate bullets to match their trajectory", - "description": "", - "group": "", - "extraInformation": [], "name": "RotateBullet" }, { @@ -9349,7 +9076,6 @@ "label": "Firing arc", "description": "Multi-Fire bullets will be evenly spaced inside the firing arc", "group": "Multi-Fire", - "extraInformation": [], "name": "FiringArc" }, { @@ -9358,7 +9084,6 @@ "label": "Number of bullets created at once", "description": "Multi-Fire bullets will be evenly spaced inside the firing arc", "group": "Multi-Fire", - "extraInformation": [], "name": "BulletQuantity" }, { @@ -9368,7 +9093,6 @@ "label": "Angle variance", "description": "Make imperfect aim (between 0 and 180 degrees).", "group": "Firing variance", - "extraInformation": [], "advanced": true, "name": "AngleVariance" }, @@ -9379,7 +9103,6 @@ "label": "Bullet speed variance", "description": "Bullet speed will be adjusted by a random value within this range.", "group": "Firing variance", - "extraInformation": [], "advanced": true, "name": "BulletSpeedVariance" }, @@ -9387,9 +9110,6 @@ "value": "0", "type": "Number", "label": "Ammo quantity (current)", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "AmmoQuantity" }, @@ -9399,7 +9119,6 @@ "label": "Shots per reload ", "description": "Use 0 to disable reloading.", "group": "Reload", - "extraInformation": [], "advanced": true, "name": "ShotsPerReload" }, @@ -9410,7 +9129,6 @@ "label": "Reloading duration", "description": "Objects cannot shoot while reloading is in progress.", "group": "Reload", - "extraInformation": [], "advanced": true, "name": "ReloadDuration" }, @@ -9418,9 +9136,7 @@ "value": "0", "type": "Number", "label": "Max ammo ", - "description": "", "group": "Ammo", - "extraInformation": [], "advanced": true, "name": "MaxAmmo" }, @@ -9428,9 +9144,6 @@ "value": "0", "type": "Number", "label": "Shots before next reload", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "ShotsBeforeNextReload" }, @@ -9439,8 +9152,6 @@ "type": "Number", "label": "Total shots fired", "description": "Regardless of how many bullets are created, only 1 shot will be counted per frame", - "group": "", - "extraInformation": [], "hidden": true, "name": "TotalShotsFired" }, @@ -9448,9 +9159,6 @@ "value": "0", "type": "Number", "label": "Total bullets created", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TotalBulletsCreated" }, @@ -9458,9 +9166,7 @@ "value": "0", "type": "Number", "label": "Starting ammo", - "description": "", "group": "Ammo", - "extraInformation": [], "advanced": true, "name": "StartingAmmo" }, @@ -9468,9 +9174,6 @@ "value": "0", "type": "Number", "label": "Total reloads completed", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TotalReloadsCompleted" }, @@ -9478,9 +9181,7 @@ "value": "true", "type": "Boolean", "label": "Unlimited ammo", - "description": "", "group": "Ammo", - "extraInformation": [], "advanced": true, "name": "UnlimitedAmmo" }, @@ -9488,9 +9189,6 @@ "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "ReloadInProgress" }, @@ -9500,7 +9198,6 @@ "label": "Heat increase per shot (between 0 and 1)", "description": " Object is overheated when Heat reaches 1.", "group": "Overheat", - "extraInformation": [], "advanced": true, "name": "HeatIncreasePerShot" }, @@ -9508,9 +9205,6 @@ "value": "0", "type": "Number", "label": "Heat level (Range: 0 to 1)", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "HeatLevel" }, @@ -9518,9 +9212,7 @@ "value": "true", "type": "Boolean", "label": "Reload automatically", - "description": "", "group": "Reload", - "extraInformation": [], "advanced": true, "name": "AutomaticReloading" }, @@ -9531,7 +9223,6 @@ "label": "Overheat duration", "description": "Object cannot shoot while overheat duration is active.", "group": "Overheat", - "extraInformation": [], "advanced": true, "name": "OverheatDuration" }, @@ -9539,9 +9230,7 @@ "value": "0.1", "type": "Number", "label": "Linear cooling rate (per second)", - "description": "", "group": "Overheat", - "extraInformation": [], "advanced": true, "name": "LinearCoolingRate" }, @@ -9564,7 +9253,6 @@ "label": "Layer the bullets are created on", "description": "Base layer by default.", "group": "Shooting configuration", - "extraInformation": [], "hidden": true, "name": "BulletLayer" }, @@ -9572,9 +9260,6 @@ "value": "0", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "RandomizedAngle" } @@ -9589,6 +9274,7 @@ "category": "User interface", "extensionNamespace": "", "fullName": "Resource bar (separated units)", + "gdevelopVersion": "", "helpPath": "/objects/resource-bar", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWRvdHMtaG9yaXpvbnRhbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNiwxMkEyLDIgMCAwLDEgMTgsMTBBMiwyIDAgMCwxIDIwLDEyQTIsMiAwIDAsMSAxOCwxNEEyLDIgMCAwLDEgMTYsMTJNMTAsMTJBMiwyIDAgMCwxIDEyLDEwQTIsMiAwIDAsMSAxNCwxMkEyLDIgMCAwLDEgMTIsMTRBMiwyIDAgMCwxIDEwLDEyTTQsMTJBMiwyIDAgMCwxIDYsMTBBMiwyIDAgMCwxIDgsMTJBMiwyIDAgMCwxIDYsMTRBMiwyIDAgMCwxIDQsMTJaIiAvPjwvc3ZnPg==", "name": "TiledUnitsBar", @@ -10236,27 +9922,18 @@ "value": "1", "type": "Number", "label": "Value", - "description": "", - "group": "", - "extraInformation": [], "name": "Value" }, { "value": "3", "type": "Number", "label": "Maximum value", - "description": "", - "group": "", - "extraInformation": [], "name": "MaxValue" }, { "value": "", "type": "Number", "label": "Previous high value", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "PreviousHighValue" }, @@ -10264,9 +9941,6 @@ "value": "1", "type": "Number", "label": "Previous high value conservation duration (in seconds)", - "description": "", - "group": "", - "extraInformation": [], "name": "PreviousHighValueDuration" } ], @@ -10275,36 +9949,137 @@ ], "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 (separated units)", + "isUsingLegacyInstancesRenderer": true, "name": "TiledUnitsBar", - "eventsFunctions": [ + "objects": [ { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "This allows to detect a change of \"intial value\" on hot reload." - }, + "assetStoreId": "", + "height": 32, + "name": "FillBar", + "texture": "", + "type": "TiledSpriteObject::TiledSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "TiledUnitsBar::TiledUnitsBar::SetPropertyPreviousInitialValue" + "name": "ResourceBar", + "type": "TiledUnitsBar::ResourceBar", + "Value": 1, + "MaxValue": 3, + "PreviousValue": 0 + } + ] + }, + { + "assetStoreId": "", + "height": 32, + "name": "Bar", + "texture": "", + "type": "TiledSpriteObject::TiledSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [] + }, + { + "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": "FillBar" + }, + { + "objectName": "Bar" + }, + { + "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": [], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "This allows to detect a change of \"intial value\" on hot reload." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TiledUnitsBar::TiledUnitsBar::SetPropertyPreviousInitialValue" }, "parameters": [ "Object", @@ -11050,18 +10825,12 @@ "value": "3", "type": "Number", "label": "Maximum value", - "description": "", - "group": "", - "extraInformation": [], "name": "MaxValue" }, { "value": "3", "type": "Number", "label": "Initial value", - "description": "", - "group": "", - "extraInformation": [], "name": "InitialValue" }, { @@ -11069,8 +10838,6 @@ "type": "Number", "label": "", "description": "It's used to detect a change at hot reload.", - "group": "", - "extraInformation": [], "hidden": true, "name": "PreviousInitialValue" }, @@ -11079,16 +10846,12 @@ "type": "Number", "label": "Unit width", "description": "How much pixels to show for a value of 1.", - "group": "", - "extraInformation": [], "name": "UnitWidth" }, { "value": "true", "type": "Boolean", "label": "Show the background", - "description": "", - "group": "", "extraInformation": [ "Background" ], @@ -11098,8 +10861,6 @@ "value": "0", "type": "Number", "label": "Bar left margin", - "description": "", - "group": "", "extraInformation": [ "FillBar", "Bar" @@ -11110,8 +10871,6 @@ "value": "0", "type": "Number", "label": "Bar right margin", - "description": "", - "group": "", "extraInformation": [ "FillBar", "Bar" @@ -11123,7 +10882,6 @@ "type": "String", "label": "", "description": "Only used by the scene editor.", - "group": "", "extraInformation": [ "FillBar", "Bar" @@ -11136,7 +10894,6 @@ "type": "String", "label": "", "description": "Only used by the scene editor.", - "group": "", "extraInformation": [ "Background" ], @@ -11144,68 +10901,7 @@ "name": "BarVerticalAnchorTarget" } ], - "objects": [ - { - "assetStoreId": "", - "height": 32, - "name": "FillBar", - "texture": "", - "type": "TiledSpriteObject::TiledSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "ResourceBar", - "type": "TiledUnitsBar::ResourceBar", - "Value": 1, - "MaxValue": 3, - "PreviousValue": 0 - } - ] - }, - { - "assetStoreId": "", - "height": 32, - "name": "Bar", - "texture": "", - "type": "TiledSpriteObject::TiledSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [] - }, - { - "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": "FillBar" - }, - { - "objectName": "Bar" - }, - { - "objectName": "Background" - } - ] - } + "variants": [] } ] }, @@ -11214,12 +10910,13 @@ "category": "Input", "extensionNamespace": "", "fullName": "Multitouch joystick and buttons (sprite)", + "gdevelopVersion": ">=5.5.222", "helpPath": "/objects/multitouch-joystick", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMTYiIGN5PSIxNiIgcj0iMTMiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjI4LjQsMTIgMjAsMTIgMjAsMy42ICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMjAsMjguNCAyMCwyMCAyOC40LDIwICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMy42LDIwIDEyLDIwIDEyLDI4LjQgIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIxMiwzLjYgMTIsMTIgMy42LDEyICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIxNiw2IDE2LjcsNyAxNS4zLDcgIi8+DQo8cG9seWdvbiBjbGFzcz0ic3QwIiBwb2ludHM9IjE2LDI2IDE1LjMsMjUgMTYuNywyNSAiLz4NCjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iNiwxNiA3LDE1LjMgNywxNi43ICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIyNiwxNiAyNSwxNi43IDI1LDE1LjMgIi8+DQo8L3N2Zz4NCg==", "name": "SpriteMultitouchJoystick", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Videogames/Videogames_controller_joystick_arrows_direction.svg", "shortDescription": "Joysticks or buttons for touchscreens.", - "version": "1.2.2", + "version": "1.8.3", "description": [ "Multitouch joysticks can be used the same way as physical gamepads:", "- 4 or 8 directions", @@ -11254,111 +10951,47 @@ ], "dependencies": [], "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Check if a button is pressed on a gamepad.", - "fullName": "Multitouch controller button pressed", - "functionType": "Condition", - "name": "IsButtonPressed", - "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is pressed", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarSceneTxt" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", - "=", - "\"Pressed\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Button name", - "name": "Button", - "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", - "type": "string" - } - ], - "objectGroups": [] - }, + "sceneVariables": [ { - "description": "Check if a button is released on a gamepad.", - "fullName": "Multitouch controller button released", - "functionType": "Condition", - "name": "IsButtonReleased", - "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is released", - "events": [ + "name": "Controllers", + "type": "array", + "children": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "type": "structure", + "children": [ { - "type": { - "value": "VarSceneTxt" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", - "=", - "\"Released\"" + "name": "Buttons", + "type": "array", + "children": [ + { + "type": "structure", + "children": [ + { + "name": "State", + "type": "string", + "value": "Idle" + } + ] + } ] - } - ], - "actions": [ + }, { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] + "name": "Joystick", + "type": "structure", + "children": [] } ] } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Button name", - "name": "Button", - "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", - "type": "string" - } - ], - "objectGroups": [] - }, + ] + } + ], + "eventsFunctions": [ { - "description": "Change a button state for a multitouch controller.", - "fullName": "Button state", - "functionType": "Action", - "name": "SetButtonState", + "fullName": "Accelerated speed", + "functionType": "Expression", + "name": "AcceleratedSpeed", "private": true, - "sentence": "Mark _PARAM2_ button as _PARAM3_ for multitouch controller _PARAM1_", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -11366,177 +10999,375 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "AcceleratedSpeed", "=", - "GetArgumentAsString(\"ButtonState\")" + "CurrentSpeed" ] } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Button name", - "name": "Button", - "type": "string" - }, - { - "description": "Button state", - "name": "ButtonState", - "supplementaryInformation": "[\"Idle\",\"Pressed\",\"Released\"]", - "type": "stringWithSelector" - } - ], - "objectGroups": [] - }, - { - "description": "Change the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", - "fullName": "Dead zone radius", - "functionType": "Action", - "name": "SetDeadZone", - "private": true, - "sentence": "Change the dead zone of multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone", - "=", - "GetArgumentAsNumber(\"DeadZoneRadius\")" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", - "type": "expression" - }, - { - "description": "Joystick name", - "name": "JoystickIdentifier", - "type": "string" - }, - { - "description": "Dead zone radius", - "name": "DeadZoneRadius", - "supplementaryInformation": "[]", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Return the dead zone radius of a joystick. The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", - "fullName": "Dead zone radius", - "functionType": "Expression", - "name": "DeadZone", - "private": true, - "sentence": "Change multitouch joystick _PARAM2_ of multitouch controller _PARAM1_ dead zone to _PARAM3_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Variable(__MultitouchJoystick.Controllers[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": [ + ], + "events": [ { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 4 / 360), 4)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TargetedSpeed", + "<", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Reduce the speed to match the stick force." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "-", + "Acceleration * TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Turn back at least as fast as it would stop." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Angle", - "name": "Angle", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "the direction index (left = 1, bottom-left = 1... top-left = 7) for an angle (in degrees).", - "fullName": "Angle to 8-way index", - "functionType": "ExpressionAndCondition", - "name": "AngleTo8Way", - "private": true, - "sentence": "The angle _PARAM1_ 8-way index", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + }, { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 8 / 360), 8)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TargetedSpeed", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Reduce the speed to match the stick force." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "+", + "Acceleration * TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Turn back at least as fast as it would stop." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TargetedSpeed", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(0, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(0, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "clamp(AcceleratedSpeed, -SpeedMax, SpeedMax)" + ] + } ] } + ], + "variables": [ + { + "name": "AcceleratedSpeed", + "type": "number", + "value": 0 + } ] } ], @@ -11545,44 +11376,51 @@ }, "parameters": [ { - "description": "Angle", - "name": "Angle", + "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 angle is in a given direction.", - "fullName": "Angle 4-way direction", + "description": "Check if a button is pressed on a gamepad.", + "fullName": "Multitouch controller button pressed", "functionType": "Condition", - "name": "IsAngleIn4WayDirection", - "private": true, - "sentence": "The angle _PARAM1_ is the 4-way direction _PARAM2_", + "name": "IsButtonPressed", + "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is pressed", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "GetArgumentAsString(\"Direction\")", - "=", - "\"Right\"" - ] - }, - { - "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" + "value": "StringVariable" }, "parameters": [ - "", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", - "0", - "GetArgumentAsNumber(\"Angle\")", - "" + "\"Pressed\"" ] } ], @@ -11596,141 +11434,278 @@ ] } ] + } + ], + "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" + "value": "StringVariable" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", - "\"Down\"" + "\"Released\"" ] - }, + } + ], + "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" - }, - "parameters": [ - "", - "=", - "1", - "GetArgumentAsNumber(\"Angle\")", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" + "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": [ + "conditions": [], + "actions": [ { "type": { - "value": "BuiltinCommonInstructions::CompareStrings" + "value": "SetStringVariable" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", - "\"Left\"" + "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": "SpriteMultitouchJoystick::AngleTo4Way" + "value": "SetNumberVariable" }, "parameters": [ - "", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", "=", - "2", - "GetArgumentAsNumber(\"Angle\")", - "" + "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": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "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": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareStrings" - }, - "parameters": [ - "GetArgumentAsString(\"Direction\")", - "=", - "\"Up\"" - ] - }, + "conditions": [], + "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::AngleTo4Way" + "value": "SetReturnNumber" }, "parameters": [ - "", - "=", - "3", - "GetArgumentAsNumber(\"Angle\")", - "" + "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": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "mod(round(Angle * 8 / 360), 8)" ] } ] } ], + "expressionType": { + "type": "expression" + }, "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", + "fullName": "Angle 4-way direction", "functionType": "Condition", - "name": "IsAngleIn8WayDirection", + "name": "IsAngleIn4WayDirection", "private": true, - "sentence": "The angle _PARAM1_ is the 8-way direction _PARAM2_", + "sentence": "The angle _PARAM1_ is the 4-way direction _PARAM2_", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -11740,20 +11715,20 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] }, { "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" + "value": "SpriteMultitouchJoystick::AngleTo4Way" }, "parameters": [ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -11777,20 +11752,20 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", - "\"DownRight\"" + "\"Down\"" ] }, { "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" + "value": "SpriteMultitouchJoystick::AngleTo4Way" }, "parameters": [ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -11814,20 +11789,20 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", - "\"Down\"" + "\"Left\"" ] }, { "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" + "value": "SpriteMultitouchJoystick::AngleTo4Way" }, "parameters": [ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -11851,20 +11826,20 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", - "\"DownLeft\"" + "\"Up\"" ] }, { "type": { - "value": "SpriteMultitouchJoystick::AngleTo8Way" + "value": "SpriteMultitouchJoystick::AngleTo4Way" }, "parameters": [ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -11879,7 +11854,31 @@ ] } ] + } + ], + "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": [ @@ -11888,9 +11887,9 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", - "\"Left\"" + "\"Right\"" ] }, { @@ -11900,8 +11899,8 @@ "parameters": [ "", "=", - "4", - "GetArgumentAsNumber(\"Angle\")", + "0", + "Angle", "" ] } @@ -11925,9 +11924,9 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", - "\"UpLeft\"" + "\"DownRight\"" ] }, { @@ -11937,8 +11936,156 @@ "parameters": [ "", "=", - "5", - "GetArgumentAsNumber(\"Angle\")", + "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", "" ] } @@ -11962,7 +12109,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -11975,7 +12122,7 @@ "", "=", "6", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -11999,7 +12146,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpRight\"" ] @@ -12012,7 +12159,7 @@ "", "=", "7", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -12073,9 +12220,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -12085,8 +12232,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -12153,9 +12300,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -12165,8 +12312,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -12221,7 +12368,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -12241,6 +12388,11 @@ "name": "JoystickIdentifier", "supplementaryInformation": "[\"Primary\",\"Secondary\"]", "type": "stringWithSelector" + }, + { + "description": "", + "name": "Coucou", + "type": "expression" } ], "objectGroups": [] @@ -12261,7 +12413,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))" ] } ] @@ -12299,12 +12451,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Force", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -12346,7 +12498,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -12386,7 +12538,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle" ] } ] @@ -12424,12 +12576,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -12470,7 +12622,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))" ] } ] @@ -12510,7 +12662,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))" ] } ] @@ -12533,6 +12685,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": "StringVariable" + }, + "parameters": [ + "Side", + "=", + "\"Left\"" + ] + }, + { + "type": { + "value": "TouchX" + }, + "parameters": [ + "", + "StartedTouchOrMouseId(0)", + "<", + "CameraCenterX(Object.Layer())", + "Object.Layer()", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Side", + "=", + "\"Right\"" + ] + }, + { + "type": { + "value": "TouchX" + }, + "parameters": [ + "", + "StartedTouchOrMouseId(0)", + ">=", + "CameraCenterX(Object.Layer())", + "Object.Layer()", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch joystick", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "objectList" + }, + { + "description": "Screen side", + "name": "Side", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] } ], "eventsBasedBehaviors": [ @@ -12559,9 +12828,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyDeadZoneRadius()", + "ControllerIdentifier", + "JoystickIdentifier", + "DeadZoneRadius", "" ] }, @@ -12686,11 +12955,10 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchIndex", "=", "0" ] @@ -12708,11 +12976,10 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", "0" ] @@ -12723,21 +12990,20 @@ }, "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)" ] } ], "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] } ] @@ -12748,11 +13014,10 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchIndex", "+", "1" ] @@ -12784,7 +13049,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -12818,11 +13083,10 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "!=", "0" ] @@ -12836,8 +13100,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))" ] }, { @@ -12848,7 +13112,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)", "" ] } @@ -12889,7 +13153,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickForce()" + "max(0, JoystickForce - DeadZoneRadius) / (1 - DeadZoneRadius)" ] } ] @@ -12927,13 +13191,12 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickForce" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "JoystickForce", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -12942,9 +13205,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickForce()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickForce", "" ] } @@ -12962,6 +13225,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "", + "name": "Parameter", + "type": "objectList" } ], "objectGroups": [] @@ -12982,7 +13250,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickAngle()" + "JoystickAngle" ] } ] @@ -13020,13 +13288,12 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickAngle" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "JoystickAngle", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -13035,9 +13302,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickAngle()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickAngle", "" ] } @@ -13156,13 +13423,14 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyJoystickForce" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" }, "parameters": [ "Object", "Behavior", ">", - "Object.Behavior::PropertyDeadZoneRadius()" + "0", + "" ] }, { @@ -13171,8 +13439,8 @@ }, "parameters": [ "", - "Object.Behavior::JoystickAngle()", - "GetArgumentAsString(\"Direction\")", + "JoystickAngle", + "Direction", "" ] } @@ -13222,13 +13490,14 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyJoystickForce" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" }, "parameters": [ "Object", "Behavior", ">", - "Object.Behavior::PropertyDeadZoneRadius()" + "0", + "" ] }, { @@ -13237,8 +13506,8 @@ }, "parameters": [ "", - "Object.Behavior::JoystickAngle()", - "GetArgumentAsString(\"Direction\")", + "JoystickAngle", + "Direction", "" ] } @@ -13288,11 +13557,10 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "!=", "0" ] @@ -13351,11 +13619,10 @@ }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", "0" ] @@ -13395,7 +13662,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyControllerIdentifier()" + "ControllerIdentifier" ] } ] @@ -13432,13 +13699,12 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyControllerIdentifier" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ControllerIdentifier", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -13476,7 +13742,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyJoystickIdentifier()" + "JoystickIdentifier" ] } ] @@ -13513,13 +13779,12 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickIdentifier" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "JoystickIdentifier", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -13557,7 +13822,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDeadZoneRadius()" + "DeadZoneRadius" ] } ] @@ -13594,13 +13859,63 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyDeadZoneRadius" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DeadZoneRadius", + "=", + "Value" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SetDeadZone" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Force the joystick into the pressing state.", + "fullName": "Force start pressing", + "functionType": "Action", + "name": "ForceStartPressing", + "sentence": "Force start pressing _PARAM0_ with touch identifier: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchId", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -13617,6 +13932,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "Touch identifier", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -13627,18 +13947,12 @@ "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" }, { @@ -13646,17 +13960,12 @@ "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" }, @@ -13664,9 +13973,6 @@ "value": "0", "type": "Number", "label": "Joystick force (range: 0 to 1)", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "JoystickForce" }, @@ -13674,9 +13980,6 @@ "value": "0", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TouchId" }, @@ -13684,9 +13987,6 @@ "value": "", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TouchIndex" } @@ -13722,12 +14022,12 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyIsReleased" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsReleased", + "False", + "" ] }, { @@ -13769,11 +14069,10 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchIndex" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchIndex", "=", "0" ] @@ -13791,25 +14090,42 @@ "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": "NumberVariable" + }, + "parameters": [ + "Radius", + ">", + "DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer()), TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer()))" + ] + } ] } ], "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] }, { @@ -13831,11 +14147,10 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchIndex" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchIndex", "+", "1" ] @@ -13865,7 +14180,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -13883,21 +14198,20 @@ }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyIsReleased" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsReleased", + "True", + "" ] }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", "0" ] @@ -13932,11 +14246,12 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyIsReleased" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsReleased", + "True", + "" ] } ], @@ -13979,11 +14294,10 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyTouchId" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "!=", "0" ] @@ -14033,9 +14347,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyButtonIdentifier()", - "GetArgumentAsString(\"ButtonState\")", + "ControllerIdentifier", + "ButtonIdentifier", + "ButtonState", "" ] } @@ -14069,27 +14383,18 @@ "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" }, @@ -14097,9 +14402,6 @@ "value": "", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TouchIndex" }, @@ -14107,11 +14409,16 @@ "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.", + "name": "Radius" } ], "sharedPropertyDescriptors": [] @@ -14121,6 +14428,7 @@ "fullName": "Platformer multitouch controller mapper", "name": "PlatformerMultitouchMapper", "objectType": "", + "quickCustomizationVisibility": "hidden", "eventsFunctions": [ { "fullName": "", @@ -14137,8 +14445,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -14165,8 +14473,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -14193,8 +14501,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -14230,8 +14538,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -14258,8 +14566,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJumpButton()", + "ControllerIdentifier", + "JumpButton", "\"Down\"" ] } @@ -14298,8 +14606,6 @@ "value": "", "type": "Behavior", "label": "Platform character behavior", - "description": "", - "group": "", "extraInformation": [ "PlatformBehavior::PlatformerObjectBehavior" ], @@ -14309,16 +14615,12 @@ "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", @@ -14330,19 +14632,18 @@ "value": "A", "type": "String", "label": "Jump button name", - "description": "", "group": "Controls", - "extraInformation": [], "name": "JumpButton" } ], "sharedPropertyDescriptors": [] }, { - "description": "Control a top-down character with a multitouch controller.", - "fullName": "Top-down multitouch controller mapper", - "name": "TopDownMultitouchMapper", + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D platformer multitouch controller mapper", + "name": "Platformer3DMultitouchMapper", "objectType": "", + "quickCustomizationVisibility": "hidden", "eventsFunctions": [ { "fullName": "", @@ -14355,55 +14656,164 @@ "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", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "group": "Controls", + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D shooter multitouch controller mapper", + "name": "Shooter3DMultitouchMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::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)" ] } ] @@ -14413,423 +14823,171 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::TopDownMultitouchMapper::PropertyStickMode" + "value": "SpriteMultitouchJoystick::IsButtonPressed" }, "parameters": [ - "Object", - "Behavior", - "=", - "\"8 Directions\"" + "", + "ControllerIdentifier", + "JumpButton", + "\"Down\"" ] } ], - "actions": [], - "events": [ + "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": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::Shooter3DMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D physics character", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "group": "Controls", + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control camera rotations with a multitouch controller.", + "fullName": "First person camera multitouch controller mapper", + "name": "FirstPersonMultitouchMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "TODO It's probably a bad idea to rotate the object around Y." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CurrentRotationSpeedZ", + "=", + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedZ, SpriteMultitouchJoystick::StickForceX(ControllerIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" ] }, { - "type": "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": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "CurrentRotationSpeedZ * TimeDelta()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CurrentRotationSpeedY", + "=", + "SpriteMultitouchJoystick::AcceleratedSpeed(CurrentRotationSpeedY, SpriteMultitouchJoystick::StickForceY(ControllerIdentifier, CameraStick) * VerticalRotationSpeedMax, VerticalRotationSpeedMax, VerticalRotationAcceleration, VerticalRotationDeceleration)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "CurrentRotationSpeedY * TimeDelta()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "clamp(Object.Object3D::RotationY(), VerticalAngleMin, VerticalAngleMax)" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper::LookFromObjectEyes" + }, + "parameters": [ + "Object", + "Behavior", + "" ] } ] @@ -14844,75 +15002,20 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", "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": "", + "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": "onCreated", - "sentence": "", + "group": "Layers and cameras", + "name": "LookFromObjectEyes", + "private": true, + "sentence": "Move the camera to look though _PARAM0_ eyes", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -14920,87 +15023,61 @@ "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()", "" ] } @@ -15011,17 +15088,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", @@ -15029,32 +15113,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": [ { @@ -15063,11 +15153,12 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "" + "HorizontalRotationSpeedMax", + "=", + "Value" ] } ] @@ -15077,19 +15168,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", @@ -15097,155 +15193,132 @@ "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": [ - { - "type": { - "inverted": true, - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"ShouldActivate\"" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "ActivateBehavior" + "value": "SetNumberVariable" }, "parameters": [ - "Border", - "MultitouchJoystick", - "no" + "HorizontalRotationAcceleration", + "=", + "Value" ] } ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the horizontal rotation deceleration of the object.", + "fullName": "Horizontal rotation deceleration", + "functionType": "ExpressionAndCondition", + "group": "First person camera multitouch controller mapper horizontal rotation configuration", + "name": "HorizontalRotationDeceleration", + "sentence": "the horizontal rotation deceleration", + "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"ShouldActivate\"" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "ActivateBehavior" + "value": "SetReturnNumber" }, "parameters": [ - "Border", - "MultitouchJoystick", - "yes" + "HorizontalRotationDeceleration" ] } ] } ], + "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": "HorizontalRotationDeceleration", + "name": "SetHorizontalRotationDeceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsPressed" + "value": "SetNumberVariable" }, "parameters": [ - "Border", - "MultitouchJoystick", - "!=" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "HorizontalRotationDeceleration", + "=", + "Value" ] } ] @@ -15255,19 +15328,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 maximum vertical rotation speed of the object.", + "fullName": "Maximum vertical rotation speed", "functionType": "ExpressionAndCondition", - "name": "JoystickForce", - "private": true, - "sentence": "the joystick force", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalRotationSpeedMax", + "sentence": "the maximum vertical rotation speed", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -15278,7 +15356,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::JoystickForce()" + "VerticalRotationSpeedMax" ] } ] @@ -15291,18 +15369,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": "VerticalRotationSpeedMax", + "name": "SetVerticalRotationSpeedMax", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -15310,34 +15393,39 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetNumberVariable" }, "parameters": [ - "Border.MultitouchJoystick::JoystickForce()" + "VerticalRotationSpeedMax", + "=", + "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 vertical rotation acceleration of the object.", + "fullName": "Vertical rotation acceleration", "functionType": "ExpressionAndCondition", - "name": "StickForceX", - "sentence": "the stick X force", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalRotationAcceleration", + "sentence": "the vertical rotation acceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -15348,7 +15436,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::StickForceX()" + "VerticalRotationAcceleration" ] } ] @@ -15361,18 +15449,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": "VerticalRotationAcceleration", + "name": "SetVerticalRotationAcceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -15380,35 +15473,39 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetNumberVariable" }, "parameters": [ - "Border.MultitouchJoystick::StickForceY()" + "VerticalRotationAcceleration", + "=", + "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 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", @@ -15419,7 +15516,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::JoystickAngle()" + "VerticalRotationDeceleration" ] } ] @@ -15432,17 +15529,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": "VerticalRotationDeceleration", + "name": "SetVerticalRotationDeceleration", "sentence": "", "events": [ { @@ -15451,107 +15553,92 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetNumberVariable" }, "parameters": [ - "Border.MultitouchJoystick::JoystickAngle()" + "VerticalRotationDeceleration", + "=", + "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 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::MultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "GetArgumentAsString(\"Direction\")", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "VerticalAngleMin" ] } ] } ], + "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": "VerticalAngleMin", + "name": "SetVerticalAngleMin", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "GetArgumentAsString(\"Direction\")", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetNumberVariable" }, "parameters": [ - "True" + "VerticalAngleMin", + "=", + "Value" ] } ] @@ -15561,25 +15648,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 maximum vertical camera angle of the object.", + "fullName": "Maximum 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": "VerticalAngleMax", + "sentence": "the maximum vertical camera angle", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -15590,7 +15676,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyControllerIdentifier()" + "VerticalAngleMax" ] } ] @@ -15603,8 +15689,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -15612,8 +15703,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "ControllerIdentifier", - "name": "SetControllerIdentifier", + "getterName": "VerticalAngleMax", + "name": "SetVerticalAngleMax", "sentence": "", "events": [ { @@ -15622,14 +15713,12 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + "value": "SetNumberVariable" }, "parameters": [ - "Border", - "MultitouchJoystick", + "VerticalAngleMax", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "Value" ] } ] @@ -15639,19 +15728,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 z position offset of the object.", + "fullName": "Z position offset", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "JoystickIdentifier", - "sentence": "the joystick name", + "group": "First person camera multitouch controller mapper position configuration", + "name": "OffsetZ", + "sentence": "the z position offset", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -15659,24 +15753,29 @@ "actions": [ { "type": { - "value": "SetReturnString" + "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyJoystickIdentifier()" + "OffsetZ" ] } ] } ], "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": [] @@ -15684,8 +15783,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "JoystickIdentifier", - "name": "SetJoystickIdentifier", + "getterName": "OffsetZ", + "name": "SetOffsetZ", "sentence": "", "events": [ { @@ -15694,14 +15793,12 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + "value": "SetNumberVariable" }, "parameters": [ - "Border", - "MultitouchJoystick", + "OffsetZ", "=", - "GetArgumentAsString(\"Value\")", - "" + "Value" ] } ] @@ -15711,69 +15808,228 @@ { "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", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "name": "Object3D" }, { - "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": [], + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "Secondary", + "type": "Choice", + "label": "Camera joystick", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "CameraStick" + }, + { + "value": "180", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "group": "Horizontal rotation", + "name": "HorizontalRotationSpeedMax" + }, + { + "value": "360", + "type": "Number", + "label": "Rotation acceleration", + "group": "Horizontal rotation", + "name": "HorizontalRotationAcceleration" + }, + { + "value": "720", + "type": "Number", + "label": "Rotation deceleration", + "group": "Horizontal rotation", + "name": "HorizontalRotationDeceleration" + }, + { + "value": "120", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "group": "Vertical rotation", + "name": "VerticalRotationSpeedMax" + }, + { + "value": "240", + "type": "Number", + "label": "Rotation acceleration", + "group": "Vertical rotation", + "name": "VerticalRotationAcceleration" + }, + { + "value": "480", + "type": "Number", + "label": "Rotation deceleration", + "group": "Vertical rotation", + "name": "VerticalRotationDeceleration" + }, + { + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Minimum angle", + "group": "Vertical rotation", + "name": "VerticalAngleMin" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Maximum angle", + "group": "Vertical rotation", + "name": "VerticalAngleMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z position offset", + "group": "Position", + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Z", + "hidden": true, + "name": "CurrentRotationSpeedZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Y", + "hidden": true, + "name": "CurrentRotationSpeedY" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a 3D physics car with a multitouch controller.", + "fullName": "3D car multitouch controller mapper", + "name": "PhysicsCar3DMultitouchMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "SteerJoystickIdentifier", + "" + ] + } + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "Physics3D::PhysicsCar3D::SimulateSteeringStick" }, "parameters": [ - "Border.MultitouchJoystick::PropertyDeadZoneRadius()" + "Object", + "PhysicsCar3D", + "SpriteMultitouchJoystick::StickForceX(ControllerIdentifier, \"Primary\")" ] } ] - } - ], - "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": [ + { + "type": { + "value": "SpriteMultitouchJoystick::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "SpeedJoystickIdentifier", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateAcceleratorStick" + }, + "parameters": [ + "Object", + "PhysicsCar3D", + "-SpriteMultitouchJoystick::StickForceY(ControllerIdentifier, \"Secondary\")" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsButtonPressed" + }, + "parameters": [ + "", + "ControllerIdentifier", + "HandBrakeButton", + "\"Down\"" + ] + } + ], "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + "value": "Physics3D::PhysicsCar3D::SimulateHandBrakeKey" }, "parameters": [ - "Border", - "MultitouchJoystick", - "=", - "GetArgumentAsNumber(\"Value\")", - "" + "Object", + "PhysicsCar3D" ] } ] @@ -15783,335 +16039,162 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::PhysicsCar3DMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] } ], "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D physics car", + "extraInformation": [ + "Physics3D::PhysicsCar3D" + ], + "name": "PhysicsCar3D" + }, { "value": "1", "type": "Number", - "label": "Multitouch controller identifier (1, 2, 3, 4...)", - "description": "", - "group": "", - "extraInformation": [], + "label": "Controller identifier (1, 2, 3, 4...)", "name": "ControllerIdentifier" }, { "value": "Primary", "type": "Choice", - "label": "Joystick name", - "description": "", - "group": "", + "label": "Steer joystick", + "group": "Controls", "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" + "name": "SteerJoystickIdentifier" }, { - "value": "true", - "type": "Boolean", - "label": "", - "description": "Only used by the scene editor.", - "group": "", + "value": "Secondary", + "type": "Choice", + "label": "Speed joystick", + "group": "Controls", "extraInformation": [ - "Thumb" + "Primary", + "Secondary" ], - "hidden": true, - "name": "ThumbIsScaledProportionally" + "name": "SpeedJoystickIdentifier" }, { - "value": "Center-center", + "value": "B", "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ParentOrigin" + "label": "Hand brake button name", + "group": "Controls", + "name": "HandBrakeButton" } ], - "objects": [ + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a top-down character with a multitouch controller.", + "fullName": "Top-down multitouch controller mapper", + "name": "TopDownMultitouchMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "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": "StringVariable" + }, + "parameters": [ + "StickMode", + "=", + "\"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": "StringVariable" + }, + "parameters": [ + "StickMode", + "=", + "\"360°\"" + ] } - ] - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Thumb" - }, - { - "objectName": "Border" - } - ] - } - } - ] - }, - { - "author": "Tristan Rhodes (tristan@victrisgames.com), Entropy", - "category": "Movement", - "extensionNamespace": "", - "fullName": "Screen wrap", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLW1vbml0b3Itc2NyZWVuc2hvdCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik05LDZINVYxMEg3VjhIOU0xOSwxMEgxN1YxMkgxNVYxNEgxOU0yMSwxNkgzVjRIMjFNMjEsMkgzQzEuODksMiAxLDIuODkgMSw0VjE2QTIsMiAwIDAsMCAzLDE4SDEwVjIwSDhWMjJIMTZWMjBIMTRWMThIMjFBMiwyIDAgMCwwIDIzLDE2VjRDMjMsMi44OSAyMi4xLDIgMjEsMiIgLz48L3N2Zz4=", - "name": "ScreenWrap", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/monitor-screenshot.svg", - "shortDescription": "Teleport object when it moves off the screen and immediately appear on the opposite side while maintaining speed and trajectory.", - "version": "0.2.4", - "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.", - "", - "The Asteroid-like example uses this extension ([open the project online](https://editor.gdevelop.io/?project=example://space-asteroid))." - ], - "origin": { - "identifier": "ScreenWrap", - "name": "gdevelop-extension-store" - }, - "tags": [ - "screen", - "wrap", - "teleport", - "asteroids" - ], - "authorIds": [ - "q8ubdigLvIRXLxsJDDTaokO41mc2", - "gqDaZjCfevOOxBYkK6zlhtZnXCg1", - "1OgYzWp5UeVPbiWGJwI6vqfgZLC3" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [], - "eventsBasedBehaviors": [ - { - "description": "Teleport the object when leaving one side of the screen so that it immediately reappears on the opposite side, maintaining speed and trajectory.", - "fullName": "Screen Wrap", - "name": "ScreenWrap", - "objectType": "", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Initialize variables (if needed)", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrap::PropertyBorderBottom" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrap::SetBottomBorder" - }, - "parameters": [ - "Object", - "Behavior", - "SceneWindowHeight()", - "" - ] - } + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "sign(SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrap::PropertyBorderRight" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrap::SetRightBorder" - }, - "parameters": [ - "Object", - "Behavior", - "SceneWindowWidth()", - "" - ] - } + "type": { + "value": "StringVariable" + }, + "parameters": [ + "StickMode", + "=", + "\"8 Directions\"" ] } ], - "parameters": [] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "colorB": 5, - "colorG": 117, - "colorR": 65, - "creationTime": 0, - "name": "ScreenWrap", - "source": "", - "type": "BuiltinCommonInstructions::Group", + "actions": [], "events": [ - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Move object to opposite side (if needed)", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [], - "parameters": [] - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::PropertyHorizontalWrapping" + "inverted": true, + "value": "TopDownMovementBehavior::DiagonalsAllowed" }, "parameters": [ "Object", - "Behavior" + "TopDownMovement" ] } ], @@ -16122,24 +16205,25 @@ "conditions": [ { "type": { - "value": "PosX" + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" }, "parameters": [ - "Object", - "<", - "Object.Behavior::PropertyBorderLeft() - (Object.Width()/2) - Object.Behavior::PropertyTriggerOffset()" + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Left\"", + "" ] } ], "actions": [ { "type": { - "value": "MettreX" + "value": "TopDownMovementBehavior::SimulateLeftKey" }, "parameters": [ "Object", - "=", - "Object.Behavior::PropertyBorderRight() - (Object.Width()/2) + Object.Behavior::PropertyTriggerOffset()" + "TopDownMovement" ] } ] @@ -16149,40 +16233,97 @@ "conditions": [ { "type": { - "value": "PosX" + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" }, "parameters": [ - "Object", - ">", - "Object.Behavior::PropertyBorderRight() - (Object.Width()/2) + Object.Behavior::PropertyTriggerOffset()" + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Right\"", + "" ] } ], "actions": [ { "type": { - "value": "MettreX" + "value": "TopDownMovementBehavior::SimulateRightKey" }, "parameters": [ "Object", - "=", - "Object.Behavior::PropertyBorderLeft() - (Object.Width()/2) - Object.Behavior::PropertyTriggerOffset()" + "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": "ScreenWrap::ScreenWrap::PropertyVerticalWrapping" + "value": "TopDownMovementBehavior::DiagonalsAllowed" }, "parameters": [ "Object", - "Behavior" + "TopDownMovement" ] } ], @@ -16193,24 +16334,53 @@ "conditions": [ { "type": { - "value": "PosY" + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" }, "parameters": [ "Object", - "<", - "Object.Behavior::PropertyBorderTop() - (Object.Height()/2) - Object.Behavior::PropertyTriggerOffset()" + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Right\"", + "" ] } ], "actions": [ { "type": { - "value": "MettreY" + "value": "TopDownMovementBehavior::SimulateRightKey" }, "parameters": [ "Object", - "=", - "Object.Behavior::PropertyBorderBottom() - (Object.Height()/2) + Object.Behavior::PropertyTriggerOffset()" + "TopDownMovement" ] } ] @@ -16220,173 +16390,205 @@ "conditions": [ { "type": { - "value": "PosY" + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" }, "parameters": [ "Object", - ">", - "Object.Behavior::PropertyBorderBottom() - (Object.Height()/2) + Object.Behavior::PropertyTriggerOffset()" + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Down\"", + "" ] } ], "actions": [ { "type": { - "value": "MettreY" + "value": "TopDownMovementBehavior::SimulateDownKey" }, "parameters": [ "Object", - "=", - "Object.Behavior::PropertyBorderTop() - (Object.Height()/2) - Object.Behavior::PropertyTriggerOffset()" + "TopDownMovement" ] } ] - } - ] - } - ], - "parameters": [] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the object is wrapping on the left and right borders.", - "fullName": "Is horizontal wrapping", - "functionType": "Condition", - "name": "IsHorizontalWrapping", - "sentence": "_PARAM0_ is horizontal wrapping", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "ScreenWrap::ScreenWrap::PropertyHorizontalWrapping" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrap::PropertyHorizontalWrapping" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the object is wrapping on the top and bottom borders.", - "fullName": "Is vertical wrapping", - "functionType": "Condition", - "name": "IsVerticalWrapping", - "sentence": "_PARAM0_ is vertical wrapping", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "ScreenWrap::ScreenWrap::PropertyVerticalWrapping" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrap::PropertyVerticalWrapping" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + }, + { + "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" + ] + } + ] + } ] } ] @@ -16401,66 +16603,267 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", + "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", "type": "behavior" } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Top-down movement behavior", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" + ], + "name": "TopDownMovement" }, { - "description": "Enable wrapping on the left and right borders.", - "fullName": "Enable horizontal wrapping", - "functionType": "Action", - "name": "EnableHorizontalWrapping", - "sentence": "Enable _PARAM0_ horizontal wrapping: _PARAM2_", - "events": [ + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "Analog", + "type": "Choice", + "label": "Stick mode", + "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", + "objects": [ + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Thumb", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"EnableHorizontalWrapping\"" - ] - } - ], - "actions": [ + "name": "Idle", + "useMultipleDirections": false, + "directions": [ { - "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyHorizontalWrapping" - }, - "parameters": [ - "Object", - "Behavior", - "no" - ] + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] } ] - }, + } + ] + }, + { + "adaptCollisionMaskAutomatically": false, + "assetStoreId": "", + "name": "Border", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { + "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": [], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { "type": { - "value": "GetArgumentAsBoolean" + "value": "Create" }, "parameters": [ - "\"EnableHorizontalWrapping\"" + "", + "Border", + "0", + "0", + "" ] - } - ], - "actions": [ + }, + { + "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": "ScreenWrap::ScreenWrap::SetPropertyHorizontalWrapping" + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" }, "parameters": [ "Object", - "Behavior", - "yes" + "" + ] + }, + { + "type": { + "value": "SetIncludedInParentCollisionMask" + }, + "parameters": [ + "Thumb", + "" ] } ] @@ -16470,51 +16873,31 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - }, - { - "description": "Value", - "name": "EnableHorizontalWrapping", - "type": "yesorno" } ], "objectGroups": [] }, { - "description": "Enable wrapping on the top and bottom borders.", - "fullName": "Enable vertical wrapping", + "fullName": "", "functionType": "Action", - "name": "EnableVerticalWrapping", - "sentence": "Enable _PARAM0_ vertical wrapping: _PARAM2_", + "name": "doStepPostEvents", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"EnableVerticalWrapping\"" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyVerticalWrapping" + "value": "MettreAutour" }, "parameters": [ - "Object", - "Behavior", - "no" + "Thumb", + "Border", + "Border.MultitouchJoystick::JoystickForce() * Border.Width() / 2", + "Border.MultitouchJoystick::JoystickAngle()" ] } ] @@ -16524,22 +16907,52 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" + }, + "parameters": [ + "ShouldBeHiddenWhenReleased", + "True", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" }, "parameters": [ - "\"EnableVerticalWrapping\"" + "Object", + "" ] } ], "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyVerticalWrapping" + "value": "Cache" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" }, "parameters": [ "Object", - "Behavior", - "yes" + "no", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "ShouldBeHiddenWhenReleased", + "False", + "" ] } ] @@ -16549,27 +16962,16 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - }, - { - "description": "Value", - "name": "EnableVerticalWrapping", - "type": "yesorno" } ], "objectGroups": [] }, { - "description": "Top border (Y position).", - "fullName": "Top border", - "functionType": "Expression", - "name": "BorderTop", + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", "sentence": "", "events": [ { @@ -16578,39 +16980,33 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" }, "parameters": [ - "Object.Behavior::PropertyBorderTop()" + "Object", + "" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "Left border (X position).", - "fullName": "Left border", - "functionType": "Expression", - "name": "BorderLeft", - "sentence": "", + "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", @@ -16618,93 +17014,161 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" }, "parameters": [ - "Object.Behavior::PropertyBorderLeft()" + "Border", + "MultitouchJoystick", + "=", + "ControllerIdentifier", + "" ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, + }, + { + "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" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "Right border (X position).", - "fullName": "Right border", - "functionType": "Expression", - "name": "BorderRight", - "sentence": "", + "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": [], + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "MettreXY" + }, + "parameters": [ + "Object", + "=", + "Object.ParentTouchX(StartedTouchOrMouseId(0))", + "=", + "Object.ParentTouchY(StartedTouchOrMouseId(0))" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Object", + "yes", + "" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" }, "parameters": [ - "Object.Behavior::PropertyBorderRight()" + "ShouldBeHiddenWhenReleased", + "True", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::ForceStartPressing" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "StartedTouchOrMouseId(0)", + "" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "Bottom border (Y position).", - "fullName": "Bottom border", + "description": "Return the X position of a specified touch", + "fullName": "Touch X position (on parent)", "functionType": "Expression", - "name": "BorderBottom", + "name": "ParentTouchX", + "private": true, "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyBorderBottom()" - ] - } - ] + "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": { @@ -16714,37 +17178,40 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" + "description": "Touch identifier", + "name": "TouchId", + "type": "expression" } ], "objectGroups": [] }, { - "description": "Number of pixels past the center where the object teleports and appears.", - "fullName": "Trigger offset", + "description": "Return the X position of a specified touch", + "fullName": "Touch X position (on parent)", "functionType": "Expression", - "name": "TriggerOffset", + "name": "ParentTouchY", + "private": true, "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Object.Behavior::PropertyTriggerOffset()" - ] - } - ] + "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": { @@ -16754,82 +17221,75 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" + "description": "Touch identifier", + "name": "TouchId", + "type": "expression" } ], "objectGroups": [] }, { - "description": "Set top border (Y position).", - "fullName": "Set top border", + "description": "De/activate control of the joystick.", + "fullName": "De/activate control", "functionType": "Action", - "name": "SetTopBorder", - "sentence": "Set _PARAM0_ top border to _PARAM2_", + "name": "ActivateControl", + "sentence": "Activate control of _PARAM0_: _PARAM1_", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "ShouldActivate", + "True", + "" + ] + } + ], "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyBorderTop" + "value": "ActivateBehavior" }, "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "Border", + "MultitouchJoystick", + "no" ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" }, - { - "description": "Top border value", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] - }, - { - "description": "Set left border (X position).", - "fullName": "Set left border", - "functionType": "Action", - "name": "SetLeftBorder", - "sentence": "Set _PARAM0_ left border to _PARAM2_", - "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "ShouldActivate", + "True", + "" + ] + } + ], "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyBorderLeft" + "value": "ActivateBehavior" }, "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "Border", + "MultitouchJoystick", + "yes" ] } ] @@ -16839,42 +17299,45 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - }, - { - "description": "Left border value", - "name": "Value", - "type": "expression" + "description": "Activate", + "name": "ShouldActivate", + "type": "yesorno" } ], "objectGroups": [] }, { - "description": "Set bottom border (Y position).", - "fullName": "Set bottom border", - "functionType": "Action", - "name": "SetBottomBorder", - "sentence": "Set _PARAM0_ bottom border to _PARAM2_", + "description": "Check if a stick is pressed.", + "fullName": "Stick pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Stick _PARAM0_ is pressed", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsPressed" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "!=" + ] + } + ], "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyBorderBottom" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "True" ] } ] @@ -16884,28 +17347,19 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - }, - { - "description": "Bottom border value", - "name": "Value", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Set right border (X position).", - "fullName": "Set right border", - "functionType": "Action", - "name": "SetRightBorder", - "sentence": "Set _PARAM0_ right border to _PARAM2_", + "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", @@ -16913,44 +17367,34 @@ "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyBorderRight" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "Border.MultitouchJoystick::JoystickForce()" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - }, - { - "description": "Right border value", - "name": "Value", - "type": "expression" } ], "objectGroups": [] }, { - "description": "Set trigger offset (pixels).", - "fullName": "Set trigger offset", - "functionType": "Action", - "name": "SetTriggerOffset", - "sentence": "Set _PARAM0_ trigger offset to _PARAM2_ pixels", + "description": "the strick force (from 0 to 1).", + "fullName": "Stick force", + "functionType": "ExpressionAndCondition", + "name": "StickForce", + "sentence": "the stick force", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -16958,688 +17402,198 @@ "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyTriggerOffset" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "Border.MultitouchJoystick::JoystickForce()" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrap", - "type": "behavior" - }, - { - "description": "SetScreen Offset Leaving Value", - "name": "Value", - "type": "expression" } ], "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "true", - "type": "Boolean", - "label": "Horizontal wrapping", - "description": "", - "group": "", - "extraInformation": [], - "name": "HorizontalWrapping" - }, - { - "value": "true", - "type": "Boolean", - "label": "Vertical wrapping", - "description": "", - "group": "", - "extraInformation": [], - "name": "VerticalWrapping" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Top border of wrapped area (Y)", - "description": "", - "group": "", - "extraInformation": [], - "name": "BorderTop" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Left border of wrapped area (X)", - "description": "", - "group": "", - "extraInformation": [], - "name": "BorderLeft" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Right border of wrapped area (X)", - "description": "If blank, the value will be the scene width.", - "group": "", - "extraInformation": [], - "name": "BorderRight" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Bottom border of wrapped area (Y)", - "description": "If blank, the value will be scene height.", - "group": "", - "extraInformation": [], - "name": "BorderBottom" }, { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Number of pixels past the center where the object teleports and appears", - "description": "", - "group": "", - "extraInformation": [], - "name": "TriggerOffset" - } - ], - "sharedPropertyDescriptors": [] - }, - { - "description": "Teleport the object when leaving one side of the screen so that it immediately reappears on the opposite side, maintaining speed and trajectory.", - "fullName": "Screen Wrap (physics objects)", - "name": "ScreenWrapPhysics", - "objectType": "", - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", + "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": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Initialize variables (if needed)", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::PropertyBorderBottom" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetBottomBorder" - }, - "parameters": [ - "Object", - "Behavior", - "SceneWindowHeight()", - "" - ] - } - ] - }, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::PropertyBorderRight" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetRightBorder" - }, - "parameters": [ - "Object", - "Behavior", - "SceneWindowWidth()", - "" - ] - } + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::StickForceX()" ] } - ], - "parameters": [] + ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" } ], "objectGroups": [] }, { - "fullName": "", - "functionType": "Action", - "name": "doStepPreEvents", - "sentence": "", + "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": [ { - "colorB": 5, - "colorG": 117, - "colorR": 65, - "creationTime": 0, - "name": "ScreenWrap", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Move object to opposite side (if needed)", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [], - "parameters": [] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::IsHorizontalWrapping" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Velocity is saved because Physics2 resets objects velocities when they are moved from the outside of the extension." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PosX" - }, - "parameters": [ - "Object", - "<", - "Object.Behavior::PropertyBorderLeft() - (Object.Width()/2) - Object.Behavior::PropertyTriggerOffset()" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Object", - "=", - "Object.Behavior::PropertyBorderRight() - (Object.Width()/2) + Object.Behavior::PropertyTriggerOffset()" - ] - }, - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PosX" - }, - "parameters": [ - "Object", - ">", - "Object.Behavior::PropertyBorderRight() - (Object.Width()/2) + Object.Behavior::PropertyTriggerOffset()" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Object", - "=", - "Object.Behavior::PropertyBorderLeft() - (Object.Width()/2) - Object.Behavior::PropertyTriggerOffset()" - ] - }, - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::IsVerticalWrapping" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PosY" - }, - "parameters": [ - "Object", - "<", - "Object.Behavior::PropertyBorderTop() - (Object.Height()/2) - Object.Behavior::PropertyTriggerOffset()" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Object", - "=", - "Object.Behavior::PropertyBorderBottom() - (Object.Height()/2) + Object.Behavior::PropertyTriggerOffset()" - ] - }, - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PosY" - }, - "parameters": [ - "Object", - ">", - "Object.Behavior::PropertyBorderBottom() - (Object.Height()/2) + Object.Behavior::PropertyTriggerOffset()" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - }, - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Object", - "=", - "Object.Behavior::PropertyBorderTop() - (Object.Height()/2) - Object.Behavior::PropertyTriggerOffset()" - ] - }, - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ] - } + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::StickForceY()" ] } - ], - "parameters": [] + ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if the object is wrapping on the left and right borders.", - "fullName": "Is horizontal wrapping", - "functionType": "Condition", - "name": "IsHorizontalWrapping", - "sentence": "_PARAM0_ is horizontal wrapping", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "ScreenWrap::ScreenWrapPhysics::PropertyHorizontalWrapping" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "" - ] - } - ] - }, + "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": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::PropertyHorizontalWrapping" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "Border.MultitouchJoystick::JoystickAngle()" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if the object is wrapping on the top and bottom borders.", - "fullName": "Is vertical wrapping", - "functionType": "Condition", - "name": "IsVerticalWrapping", - "sentence": "_PARAM0_ is vertical wrapping", + "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": [ - { - "type": { - "inverted": true, - "value": "ScreenWrap::ScreenWrapPhysics::PropertyVerticalWrapping" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::PropertyVerticalWrapping" - }, - "parameters": [ - "Object", - "Behavior" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "Border.MultitouchJoystick::JoystickAngle()" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "Enable wrapping on the left and right borders.", - "fullName": "Enable horizontal wrapping", - "functionType": "Action", - "name": "EnableHorizontalWrapping", - "sentence": "Enable _PARAM0_ horizontal wrapping: _PARAM2_", + "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": { - "inverted": true, - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"EnableHorizontalWrapping\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyHorizontalWrapping" - }, - "parameters": [ - "Object", - "Behavior", - "no" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed4Way" }, "parameters": [ - "\"EnableHorizontalWrapping\"" + "Border", + "MultitouchJoystick", + "Direction", + "" ] } ], "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyHorizontalWrapping" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "Behavior", - "yes" + "True" ] } ] @@ -17649,76 +17603,47 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - }, - { - "description": "Value", - "name": "EnableHorizontalWrapping", - "type": "yesorno" + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" } ], "objectGroups": [] }, { - "description": "Enable wrapping on the top and bottom borders.", - "fullName": "Enable vertical wrapping", - "functionType": "Action", - "name": "EnableVerticalWrapping", - "sentence": "Enable _PARAM0_ vertical wrapping: _PARAM2_", + "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": { - "inverted": true, - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"EnableVerticalWrapping\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyVerticalWrapping" - }, - "parameters": [ - "Object", - "Behavior", - "no" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed8Way" }, "parameters": [ - "\"EnableVerticalWrapping\"" + "Border", + "MultitouchJoystick", + "Direction", + "" ] } ], "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyVerticalWrapping" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "Behavior", - "yes" + "True" ] } ] @@ -17728,28 +17653,25 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - }, - { - "description": "Value", - "name": "EnableVerticalWrapping", - "type": "yesorno" + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" } ], "objectGroups": [] }, { - "description": "Top border (Y position).", - "fullName": "Top border", - "functionType": "Expression", - "name": "BorderTop", - "sentence": "", + "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", @@ -17760,7 +17682,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderTop()" + "Border.MultitouchJoystick::PropertyControllerIdentifier()" ] } ] @@ -17773,22 +17695,17 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "Left border (X position).", - "fullName": "Left border", - "functionType": "Expression", - "name": "BorderLeft", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ControllerIdentifier", + "name": "SetControllerIdentifier", "sentence": "", "events": [ { @@ -17797,39 +17714,36 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" }, "parameters": [ - "Object.Behavior::PropertyBorderLeft()" + "Border", + "MultitouchJoystick", + "=", + "Value", + "" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "Right border (X position).", - "fullName": "Right border", - "functionType": "Expression", - "name": "BorderRight", - "sentence": "", + "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", @@ -17837,38 +17751,33 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyBorderRight()" + "Border.MultitouchJoystick::PropertyJoystickIdentifier()" ] } ] } ], "expressionType": { - "type": "expression" + "type": "string" }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "Bottom border (Y position).", - "fullName": "Bottom border", - "functionType": "Expression", - "name": "BorderBottom", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JoystickIdentifier", + "name": "SetJoystickIdentifier", "sentence": "", "events": [ { @@ -17877,39 +17786,36 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" }, "parameters": [ - "Object.Behavior::PropertyBorderBottom()" + "Border", + "MultitouchJoystick", + "=", + "Value", + "" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "Number of pixels past the center where the object teleports and appears.", - "fullName": "Trigger offset", - "functionType": "Expression", - "name": "TriggerOffset", - "sentence": "", + "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", @@ -17920,7 +17826,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTriggerOffset()" + "Border.MultitouchJoystick::PropertyDeadZoneRadius()" ] } ] @@ -17933,23 +17839,18 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "Set top border (Y position).", - "fullName": "Set top border", - "functionType": "Action", - "name": "SetTopBorder", - "sentence": "Set _PARAM0_ top border to _PARAM2_", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DeadZoneRadius", + "name": "SetDeadZoneRadius", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -17957,13 +17858,14 @@ "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyBorderTop" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" }, "parameters": [ - "Object", - "Behavior", + "Border", + "MultitouchJoystick", "=", - "GetArgumentAsNumber(\"Value\")" + "Value", + "" ] } ] @@ -17973,247 +17875,205 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - }, - { - "description": "Top border value", - "name": "Value", - "type": "expression" } ], "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" }, { - "description": "Set left border (X position).", - "fullName": "Set left border", - "functionType": "Action", - "name": "SetLeftBorder", - "sentence": "Set _PARAM0_ left border to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyBorderLeft" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - }, - { - "description": "Left border value", - "name": "Value", - "type": "expression" - } + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "extraInformation": [ + "Primary", + "Secondary" ], - "objectGroups": [] + "name": "JoystickIdentifier" }, { - "description": "Set bottom border (Y position).", - "fullName": "Set bottom border", - "functionType": "Action", - "name": "SetBottomBorder", - "sentence": "Set _PARAM0_ bottom border to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyBorderBottom" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - }, - { - "description": "Bottom border value", - "name": "Value", - "type": "expression" - } - ], - "objectGroups": [] + "value": "0.4", + "type": "Number", + "label": "Dead zone radius (range: 0 to 1)", + "description": "The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved)", + "name": "DeadZoneRadius" }, { - "description": "Set right border (X position).", - "fullName": "Set right border", - "functionType": "Action", - "name": "SetRightBorder", - "sentence": "Set _PARAM0_ right border to _PARAM2_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyBorderRight" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - }, - { - "description": "Right border value", - "name": "Value", - "type": "expression" - } + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "extraInformation": [ + "Thumb" ], - "objectGroups": [] + "hidden": true, + "name": "ThumbAnchorOrigin" }, { - "description": "Set trigger offset (pixels).", - "fullName": "Set trigger offset", - "functionType": "Action", - "name": "SetTriggerOffset", - "sentence": "Set _PARAM0_ trigger offset to _PARAM2_ pixels", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyTriggerOffset" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", - "type": "behavior" - }, - { - "description": "SetScreen Offset Leaving Value", - "name": "Value", - "type": "expression" - } + "value": "Center-center", + "type": "Number", + "label": "", + "description": "Only used by the scene editor.", + "hidden": true, + "name": "ThumbAnchorTarget" + }, + { + "value": "true", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "extraInformation": [ + "Thumb" ], - "objectGroups": [] + "hidden": true, + "name": "ThumbIsScaledProportionally" }, { - "description": "Save current velocity values.", - "fullName": "Save current velocity values", + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "hidden": true, + "name": "ParentOrigin" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "hidden": true, + "name": "ShouldBeHiddenWhenReleased" + } + ], + "variants": [] + } + ] + }, + { + "author": "Tristan Rhodes (tristan@victrisgames.com), Entropy", + "category": "Movement", + "extensionNamespace": "", + "fullName": "Screen wrap", + "gdevelopVersion": ">=5.5.222", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLW1vbml0b3Itc2NyZWVuc2hvdCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik05LDZINVYxMEg3VjhIOU0xOSwxMEgxN1YxMkgxNVYxNEgxOU0yMSwxNkgzVjRIMjFNMjEsMkgzQzEuODksMiAxLDIuODkgMSw0VjE2QTIsMiAwIDAsMCAzLDE4SDEwVjIwSDhWMjJIMTZWMjBIMTRWMThIMjFBMiwyIDAgMCwwIDIzLDE2VjRDMjMsMi44OSAyMi4xLDIgMjEsMiIgLz48L3N2Zz4=", + "name": "ScreenWrap", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/monitor-screenshot.svg", + "shortDescription": "Teleport object when it moves off the screen and immediately appear on the opposite side while maintaining speed and trajectory.", + "version": "0.3.2", + "description": [ + "The teleport happens when the center point of the object crosses a border (this can be adjusted with an offset).", + "By default, the borders of the wrapping area match the screen size, but they can also be changed.", + "", + "The Asteroid-like example uses this extension ([open the project online](https://editor.gdevelop.io/?project=example://space-asteroids))." + ], + "origin": { + "identifier": "ScreenWrap", + "name": "gdevelop-extension-store" + }, + "tags": [ + "screen", + "wrap", + "teleport", + "asteroids" + ], + "authorIds": [ + "q8ubdigLvIRXLxsJDDTaokO41mc2", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1", + "1OgYzWp5UeVPbiWGJwI6vqfgZLC3" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Teleport the object when leaving one side of the screen so that it immediately reappears on the opposite side, maintaining speed and trajectory.", + "fullName": "Screen Wrap", + "name": "ScreenWrap", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", "functionType": "Action", - "name": "SaveCurrentVelocities", - "sentence": "Save current velocity values of _PARAM0_", + "name": "onCreated", + "sentence": "", "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyAngularVelocity" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.RequiredPhysicsBehavior::AngularVelocity()" - ] - }, + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Initialize variables (if needed)", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyLinearVelocityX" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.RequiredPhysicsBehavior::LinearVelocityX()" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "BorderBottom", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::SetBottomBorder" + }, + "parameters": [ + "Object", + "Behavior", + "SceneWindowHeight()", + "" + ] + } ] }, { - "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyLinearVelocityY" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "Object.RequiredPhysicsBehavior::LinearVelocityY()" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "BorderRight", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrap::SetRightBorder" + }, + "parameters": [ + "Object", + "Behavior", + "SceneWindowWidth()", + "" + ] + } ] } - ] + ], + "parameters": [] } ], "parameters": [ @@ -18225,57 +18085,184 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "supplementaryInformation": "ScreenWrap::ScreenWrap", "type": "behavior" } ], "objectGroups": [] }, { - "description": "Apply saved velocity values.", - "fullName": "Apply saved velocity values", + "fullName": "", "functionType": "Action", - "name": "ApplySavedVelocities", - "sentence": "Apply saved velocity values of _PARAM0_", + "name": "doStepPostEvents", + "sentence": "", "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Physics2::AngularVelocity" - }, - "parameters": [ - "Object", - "RequiredPhysicsBehavior", - "=", - "Object.Behavior::PropertyAngularVelocity()" - ] - }, + "colorB": 5, + "colorG": 117, + "colorR": 65, + "creationTime": 0, + "name": "ScreenWrap", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ { - "type": { - "value": "Physics2::LinearVelocityX" - }, - "parameters": [ - "Object", - "RequiredPhysicsBehavior", - "=", - "Object.Behavior::PropertyLinearVelocityX()" - ] + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Move object to opposite side (if needed)", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [], + "parameters": [] }, { - "type": { - "value": "Physics2::LinearVelocityY" - }, - "parameters": [ - "Object", - "RequiredPhysicsBehavior", - "=", - "Object.Behavior::PropertyLinearVelocityY()" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object", + "<", + "BorderLeft - (Object.Width()/2) - TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "=", + "BorderRight - (Object.Width()/2) + TriggerOffset" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object", + ">", + "BorderRight - (Object.Width()/2) + TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "=", + "BorderLeft - (Object.Width()/2) - TriggerOffset" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object", + "<", + "BorderTop - (Object.Height()/2) - TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "=", + "BorderBottom - (Object.Height()/2) + TriggerOffset" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object", + ">", + "BorderBottom - (Object.Height()/2) + TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "=", + "BorderTop - (Object.Height()/2) - TriggerOffset" + ] + } + ] + } ] } - ] + ], + "parameters": [] } ], "parameters": [ @@ -18287,336 +18274,115 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "supplementaryInformation": "ScreenWrap::ScreenWrap", "type": "behavior" } ], "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "", - "type": "Behavior", - "label": "Physics Behavior", - "description": "", - "group": "", - "extraInformation": [ - "Physics2::Physics2Behavior" - ], - "name": "RequiredPhysicsBehavior" - }, - { - "value": "true", - "type": "Boolean", - "label": "Horizontal wrapping", - "description": "", - "group": "", - "extraInformation": [], - "name": "HorizontalWrapping" - }, - { - "value": "true", - "type": "Boolean", - "label": "Vertical wrapping", - "description": "", - "group": "", - "extraInformation": [], - "name": "VerticalWrapping" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Top border of wrapped area (Y)", - "description": "", - "group": "", - "extraInformation": [], - "name": "BorderTop" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Left border of wrapped area (X)", - "description": "", - "group": "", - "extraInformation": [], - "name": "BorderLeft" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Right border of wrapped area (X)", - "description": "If blank, the value will be the scene width.", - "group": "", - "extraInformation": [], - "name": "BorderRight" }, { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Bottom border of wrapped area (Y)", - "description": "If blank, the value will be scene height.", - "group": "", - "extraInformation": [], - "name": "BorderBottom" + "description": "Check if the object is wrapping on the left and right borders.", + "fullName": "Is horizontal wrapping", + "functionType": "Condition", + "name": "IsHorizontalWrapping", + "sentence": "_PARAM0_ is horizontal wrapping", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Number of pixels past the center where the object teleports and appears", - "description": "", - "group": "", - "extraInformation": [], - "name": "TriggerOffset" - }, - { - "value": "0", - "type": "Number", - "label": "Angular Velocity", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "AngularVelocity" - }, - { - "value": "0", - "type": "Number", - "label": "Linear Velocity X", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "LinearVelocityX" - }, - { - "value": "0", - "type": "Number", - "label": "Linear Velocity Y", - "description": "", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "LinearVelocityY" - } - ], - "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.0.3", - "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": [], - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "onSceneLoaded", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "CameraShake::SetLayerShakable" - }, - "parameters": [ - "", - "", - "\"\"", - "" - ] - }, - { - "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", - "" - ] - } - ] - } - ], - "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": "ModVarScene" - }, - "parameters": [ - "__CameraShake.Time", - "+", - "TimeDelta()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "CameraShake::IsShaking" - }, - "parameters": [ - "", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.EaseFactor", - "=", - "1" - ] - } - ], + "description": "Check if the object is wrapping on the top and bottom borders.", + "fullName": "Is vertical wrapping", + "functionType": "Condition", + "name": "IsVerticalWrapping", + "sentence": "_PARAM0_ is vertical wrapping", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ - { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__CameraShake.Time", - "<", - "Variable(__CameraShake.StartEaseDuration)" - ] - }, { "type": { "inverted": true, - "value": "VarScene" + "value": "BooleanVariable" }, "parameters": [ - "__CameraShake.Time", - ">", - "Variable(__CameraShake.Duration) - Variable(__CameraShake.StopEaseDuration)" + "VerticalWrapping", + "True", + "" ] } ], "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetReturnBoolean" }, "parameters": [ - "__CameraShake.EaseFactor", - "=", - "clamp(0, 1, Variable(__CameraShake.Time) / Variable(__CameraShake.StartEaseDuration))" + "" ] } ] @@ -18626,455 +18392,2825 @@ "conditions": [ { "type": { - "value": "VarScene" + "value": "BooleanVariable" }, "parameters": [ - "__CameraShake.Time", - ">", - "Variable(__CameraShake.Duration) - Variable(__CameraShake.StopEaseDuration)" + "VerticalWrapping", + "True", + "" ] } ], "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetReturnBoolean" }, "parameters": [ - "__CameraShake.EaseFactor", - "=", - "clamp(0, 1, (Variable(__CameraShake.Duration) - Variable(__CameraShake.Time)) / Variable(__CameraShake.StopEaseDuration))" + "True" ] } ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" }, { - "type": "BuiltinCommonInstructions::ForEachChildVariable", - "iterableVariableName": "__CameraShake.Layers", - "valueIteratorVariableName": "__CameraShake.Layer", - "keyIteratorVariableName": "__CameraShake.LayerName", + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Enable wrapping on the left and right borders.", + "fullName": "Enable horizontal wrapping", + "functionType": "Action", + "name": "EnableHorizontalWrapping", + "sentence": "Enable _PARAM0_ horizontal wrapping: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "SceneVariableAsBoolean" + "inverted": true, + "value": "BooleanVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].Shakable", - "True" + "EnableHorizontalWrapping", + "True", + "" ] } ], - "actions": [], - "events": [ + "actions": [ { - "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": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "False", + "" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + "type": { + "value": "BooleanVariable" }, - "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)" - ] - } + "parameters": [ + "EnableHorizontalWrapping", + "True", + "" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VariableChildExists" - }, - "parameters": [ - "__CameraShake.Layer", - "\"Frequency\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "CameraShake::SetFrequency" - }, - "parameters": [ - "", - "Variable(__CameraShake.Layer.Frequency)", - "\"\"", - "" - ] - } + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "True", + "" ] - }, + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "description": "Value", + "name": "EnableHorizontalWrapping", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Enable wrapping on the top and bottom borders.", + "fullName": "Enable vertical wrapping", + "functionType": "Action", + "name": "EnableVerticalWrapping", + "sentence": "Enable _PARAM0_ vertical wrapping: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VariableChildExists" - }, - "parameters": [ - "__CameraShake.Layer", - "\"AmplitudeX\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeX", - "=", - "Variable(__CameraShake.Layer.AmplitudeX)" - ] - } + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "EnableVerticalWrapping", + "True", + "" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VariableChildExists" - }, - "parameters": [ - "__CameraShake.Layer", - "\"AmplitudeY\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeY", - "=", - "Variable(__CameraShake.Layer.AmplitudeY)" - ] - } + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "False", + "" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VariableChildExists" - }, - "parameters": [ - "__CameraShake.Layer", - "\"AmplitudeAngle\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeAngle", - "=", - "Variable(__CameraShake.Layer.AmplitudeAngle)" - ] - } + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "EnableVerticalWrapping", + "True", + "" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VariableChildExists" - }, - "parameters": [ - "__CameraShake.Layer", - "\"AmplitudeZoom\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeZoom", - "=", - "Variable(__CameraShake.Layer.AmplitudeZoom)" - ] - } + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "True", + "" ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "description": "Value", + "name": "EnableVerticalWrapping", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Top border (Y position).", + "fullName": "Top border", + "functionType": "Expression", + "name": "BorderTop", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" }, - "comment": "Shake the layer camera.\nSave the camera displacement to revert it in onScenePostEvents." - }, + "parameters": [ + "BorderTop" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Left border (X position).", + "fullName": "Left border", + "functionType": "Expression", + "name": "BorderLeft", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeX", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarScene" - }, - "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaX", - "=", - "CameraShake::Noise2d(\"\", TimeFromStart(), 1000) * Variable(__CameraShake.AmplitudeX) * Variable(__CameraShake.EaseFactor)" - ] - }, - { - "type": { - "value": "SetCameraCenterX" - }, - "parameters": [ - "", - "+", - "Variable(__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaX)", - "VariableString(__CameraShake.ActualLayerName)", - "0" + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BorderLeft" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Right border (X position).", + "fullName": "Right border", + "functionType": "Expression", + "name": "BorderRight", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BorderRight" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Bottom border (Y position).", + "fullName": "Bottom border", + "functionType": "Expression", + "name": "BorderBottom", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BorderBottom" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Number of pixels past the center where the object teleports and appears.", + "fullName": "Trigger offset", + "functionType": "Expression", + "name": "TriggerOffset", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TriggerOffset" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Set top border (Y position).", + "fullName": "Set top border", + "functionType": "Action", + "name": "SetTopBorder", + "sentence": "Set _PARAM0_ top border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderTop", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "description": "Top border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set left border (X position).", + "fullName": "Set left border", + "functionType": "Action", + "name": "SetLeftBorder", + "sentence": "Set _PARAM0_ left border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderLeft", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "description": "Left border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set bottom border (Y position).", + "fullName": "Set bottom border", + "functionType": "Action", + "name": "SetBottomBorder", + "sentence": "Set _PARAM0_ bottom border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderBottom", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "description": "Bottom border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set right border (X position).", + "fullName": "Set right border", + "functionType": "Action", + "name": "SetRightBorder", + "sentence": "Set _PARAM0_ right border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderRight", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "description": "Right border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set trigger offset (pixels).", + "fullName": "Set trigger offset", + "functionType": "Action", + "name": "SetTriggerOffset", + "sentence": "Set _PARAM0_ trigger offset to _PARAM2_ pixels", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TriggerOffset", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrap", + "type": "behavior" + }, + { + "description": "SetScreen Offset Leaving Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "true", + "type": "Boolean", + "label": "Horizontal wrapping", + "name": "HorizontalWrapping" + }, + { + "value": "true", + "type": "Boolean", + "label": "Vertical wrapping", + "name": "VerticalWrapping" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Top border of wrapped area (Y)", + "name": "BorderTop" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Left border of wrapped area (X)", + "name": "BorderLeft" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Right border of wrapped area (X)", + "description": "If blank, the value will be the scene width.", + "name": "BorderRight" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Bottom border of wrapped area (Y)", + "description": "If blank, the value will be scene height.", + "name": "BorderBottom" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Number of pixels past the center where the object teleports and appears", + "name": "TriggerOffset" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Teleport the object when leaving one side of the screen so that it immediately reappears on the opposite side, maintaining speed and trajectory.", + "fullName": "Screen Wrap (physics objects)", + "name": "ScreenWrapPhysics", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Initialize variables (if needed)", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "BorderBottom", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::SetBottomBorder" + }, + "parameters": [ + "Object", + "Behavior", + "SceneWindowHeight()", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "BorderRight", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::SetRightBorder" + }, + "parameters": [ + "Object", + "Behavior", + "SceneWindowWidth()", + "" + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 5, + "colorG": 117, + "colorR": 65, + "creationTime": 0, + "name": "ScreenWrap", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Move object to opposite side (if needed)", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [], + "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::IsHorizontalWrapping" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Velocity is saved because Physics2 resets objects velocities when they are moved from the outside of the extension." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object", + "<", + "BorderLeft - (Object.Width()/2) - TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "=", + "BorderRight - (Object.Width()/2) + TriggerOffset" + ] + }, + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosX" + }, + "parameters": [ + "Object", + ">", + "BorderRight - (Object.Width()/2) + TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Object", + "=", + "BorderLeft - (Object.Width()/2) - TriggerOffset" + ] + }, + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::IsVerticalWrapping" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object", + "<", + "BorderTop - (Object.Height()/2) - TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "=", + "BorderBottom - (Object.Height()/2) + TriggerOffset" + ] + }, + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PosY" + }, + "parameters": [ + "Object", + ">", + "BorderBottom - (Object.Height()/2) + TriggerOffset" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::SaveCurrentVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + }, + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Object", + "=", + "BorderTop - (Object.Height()/2) - TriggerOffset" + ] + }, + { + "type": { + "value": "ScreenWrap::ScreenWrapPhysics::ApplySavedVelocities" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is wrapping on the left and right borders.", + "fullName": "Is horizontal wrapping", + "functionType": "Condition", + "name": "IsHorizontalWrapping", + "sentence": "_PARAM0_ is horizontal wrapping", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the object is wrapping on the top and bottom borders.", + "fullName": "Is vertical wrapping", + "functionType": "Condition", + "name": "IsVerticalWrapping", + "sentence": "_PARAM0_ is vertical wrapping", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Enable wrapping on the left and right borders.", + "fullName": "Enable horizontal wrapping", + "functionType": "Action", + "name": "EnableHorizontalWrapping", + "sentence": "Enable _PARAM0_ horizontal wrapping: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "EnableHorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "EnableHorizontalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HorizontalWrapping", + "True", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + }, + { + "description": "Value", + "name": "EnableHorizontalWrapping", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Enable wrapping on the top and bottom borders.", + "fullName": "Enable vertical wrapping", + "functionType": "Action", + "name": "EnableVerticalWrapping", + "sentence": "Enable _PARAM0_ vertical wrapping: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "EnableVerticalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "EnableVerticalWrapping", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "VerticalWrapping", + "True", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + }, + { + "description": "Value", + "name": "EnableVerticalWrapping", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Top border (Y position).", + "fullName": "Top border", + "functionType": "Expression", + "name": "BorderTop", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BorderTop" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Left border (X position).", + "fullName": "Left border", + "functionType": "Expression", + "name": "BorderLeft", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BorderLeft" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Right border (X position).", + "fullName": "Right border", + "functionType": "Expression", + "name": "BorderRight", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BorderRight" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Bottom border (Y position).", + "fullName": "Bottom border", + "functionType": "Expression", + "name": "BorderBottom", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "BorderBottom" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Number of pixels past the center where the object teleports and appears.", + "fullName": "Trigger offset", + "functionType": "Expression", + "name": "TriggerOffset", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TriggerOffset" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Set top border (Y position).", + "fullName": "Set top border", + "functionType": "Action", + "name": "SetTopBorder", + "sentence": "Set _PARAM0_ top border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderTop", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + }, + { + "description": "Top border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set left border (X position).", + "fullName": "Set left border", + "functionType": "Action", + "name": "SetLeftBorder", + "sentence": "Set _PARAM0_ left border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderLeft", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + }, + { + "description": "Left border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set bottom border (Y position).", + "fullName": "Set bottom border", + "functionType": "Action", + "name": "SetBottomBorder", + "sentence": "Set _PARAM0_ bottom border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderBottom", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + }, + { + "description": "Bottom border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set right border (X position).", + "fullName": "Set right border", + "functionType": "Action", + "name": "SetRightBorder", + "sentence": "Set _PARAM0_ right border to _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BorderRight", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + }, + { + "description": "Right border value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Set trigger offset (pixels).", + "fullName": "Set trigger offset", + "functionType": "Action", + "name": "SetTriggerOffset", + "sentence": "Set _PARAM0_ trigger offset to _PARAM2_ pixels", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TriggerOffset", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + }, + { + "description": "SetScreen Offset Leaving Value", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Save current velocity values.", + "fullName": "Save current velocity values", + "functionType": "Action", + "name": "SaveCurrentVelocities", + "sentence": "Save current velocity values of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AngularVelocity", + "=", + "Object.RequiredPhysicsBehavior::AngularVelocity()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "LinearVelocityX", + "=", + "Object.RequiredPhysicsBehavior::LinearVelocityX()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "LinearVelocityY", + "=", + "Object.RequiredPhysicsBehavior::LinearVelocityY()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Apply saved velocity values.", + "fullName": "Apply saved velocity values", + "functionType": "Action", + "name": "ApplySavedVelocities", + "sentence": "Apply saved velocity values of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Physics2::AngularVelocity" + }, + "parameters": [ + "Object", + "RequiredPhysicsBehavior", + "=", + "AngularVelocity" + ] + }, + { + "type": { + "value": "Physics2::LinearVelocityX" + }, + "parameters": [ + "Object", + "RequiredPhysicsBehavior", + "=", + "LinearVelocityX" + ] + }, + { + "type": { + "value": "Physics2::LinearVelocityY" + }, + "parameters": [ + "Object", + "RequiredPhysicsBehavior", + "=", + "LinearVelocityY" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScreenWrap::ScreenWrapPhysics", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Physics Behavior", + "extraInformation": [ + "Physics2::Physics2Behavior" + ], + "name": "RequiredPhysicsBehavior" + }, + { + "value": "true", + "type": "Boolean", + "label": "Horizontal wrapping", + "name": "HorizontalWrapping" + }, + { + "value": "true", + "type": "Boolean", + "label": "Vertical wrapping", + "name": "VerticalWrapping" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Top border of wrapped area (Y)", + "name": "BorderTop" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Left border of wrapped area (X)", + "name": "BorderLeft" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Right border of wrapped area (X)", + "description": "If blank, the value will be the scene width.", + "name": "BorderRight" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Bottom border of wrapped area (Y)", + "description": "If blank, the value will be scene height.", + "name": "BorderBottom" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Number of pixels past the center where the object teleports and appears", + "name": "TriggerOffset" + }, + { + "value": "0", + "type": "Number", + "label": "Angular Velocity", + "hidden": true, + "name": "AngularVelocity" + }, + { + "value": "0", + "type": "Number", + "label": "Linear Velocity X", + "hidden": true, + "name": "LinearVelocityX" + }, + { + "value": "0", + "type": "Number", + "label": "Linear Velocity Y", + "hidden": true, + "name": "LinearVelocityY" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] + }, + { + "author": "westboy31, Tristan Rhodes (https://victrisgames.itch.io/)", + "category": "Camera", + "extensionNamespace": "", + "fullName": "Camera shake", + "gdevelopVersion": ">=5.5.222", + "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.2.0", + "description": [ + "Shake layer cameras with translation, rotation and zoom.", + "", + "- Short shaking can be used to give impact (explosion, hit)", + "- Shaking can go indefinitely to set an ambiance (engine vibration, earthquake, pulsing)", + "- Low frequency shaking allows to simulate slow moving objects (ship rocking back and forth)", + "", + "Release notes:", + "- Version 3.0.0", + " - No adaptation of the game events is needed.", + " - It fixes an issue when used with scrolling, the amplitude will feel bigger in this case.", + " - The shaking relies on noise which could feel a bit different.", + " - This extension can no longer do impulses. For this, another extension \"Camera impulse\" can be used." + ], + "origin": { + "identifier": "CameraShake", + "name": "gdevelop-extension-store" + }, + "tags": [ + "shaking", + "camera", + "effect", + "screen", + "shake" + ], + "authorIds": [ + "gqDaZjCfevOOxBYkK6zlhtZnXCg1", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "m4hBMBTUilft4s1V4FQQPakVDGx1" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [ + { + "folded": true, + "name": "DefaultFrequency", + "type": "number", + "value": 12 + }, + { + "folded": true, + "name": "DefaultAmplitudeX", + "type": "number", + "value": 4 + }, + { + "folded": true, + "name": "DefaultAmplitudeY", + "type": "number", + "value": 4 + }, + { + "folded": true, + "name": "DefaultAmplitudeAngle", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "DefaultAmplitudeZoom", + "type": "number", + "value": 1 + }, + { + "folded": true, + "name": "Duration", + "type": "number", + "value": 0 + }, + { + "name": "Layers", + "type": "structure", + "children": [] + }, + { + "name": "Layer", + "type": "structure", + "children": [ + { + "name": "AmplitudeAngle", + "type": "number", + "value": 0 + }, + { + "name": "AmplitudeX", + "type": "number", + "value": 0 + }, + { + "name": "AmplitudeY", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "AmplitudeZoom", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaAngle", + "type": "number", + "value": 0 + }, + { + "name": "CameraDeltaX", + "type": "number", + "value": 0 + }, + { + "name": "CameraDeltaY", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "CameraDeltaZoom", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "Frequency", + "type": "number", + "value": 0 + } + ] + }, + { + "folded": true, + "name": "LayerName", + "type": "string", + "value": "" + }, + { + "folded": true, + "name": "Time", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "StartEaseDuration", + "type": "number", + "value": 0 + }, + { + "folded": true, + "name": "StopEaseDuration", + "type": "number", + "value": 0 + } + ], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "CameraShake::SetLayerShakable" + }, + "parameters": [ + "", + "", + "\"\"", + "" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onScenePostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Step time counters." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Time", + "+", + "TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "CameraShake::IsShaking" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Time", + "<", + "StartEaseDuration" + ] + }, + { + "type": { + "inverted": true, + "value": "NumberVariable" + }, + "parameters": [ + "Time", + ">", + "Duration - StopEaseDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "EaseFactor", + "=", + "clamp(Time / StartEaseDuration, 0, 1)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Time", + ">", + "Duration - StopEaseDuration" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "EaseFactor", + "=", + "clamp((Duration - Time) / StopEaseDuration, 0, 1)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "Layers", + "valueIteratorVariableName": "Layer", + "keyIteratorVariableName": "LayerName", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Layer.Shakable", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ActualLayerName", + "=", + "LayerName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ActualLayerName", + "=", + "\"\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Use user defined default values when there is no layer specific value set." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "CameraShake::SetFrequency" + }, + "parameters": [ + "", + "DefaultFrequency", + "\"\"", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeX", + "=", + "DefaultAmplitudeX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeY", + "=", + "DefaultAmplitudeY" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeAngle", + "=", + "DefaultAmplitudeAngle" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeZoom", + "=", + "DefaultAmplitudeZoom" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaX", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaY", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaAngle", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaZoom", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"Frequency\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "CameraShake::SetFrequency" + }, + "parameters": [ + "", + "Layer.Frequency", + "\"\"", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"AmplitudeX\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeX", + "=", + "Layer.AmplitudeX" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"AmplitudeY\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeY", + "=", + "Layer.AmplitudeY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"AmplitudeAngle\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeAngle", + "=", + "Layer.AmplitudeAngle" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VariableChildExists2" + }, + "parameters": [ + "Layer", + "\"AmplitudeZoom\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AmplitudeZoom", + "=", + "Layer.AmplitudeZoom" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Shake the layer camera.\nSave the camera displacement to revert it in onScenePostEvents." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaX", + "=", + "CameraShake::Noise2d(\"\", TimeFromStart(), 1000) * AmplitudeX * EaseFactor" + ] + }, + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "+", + "Layers[LayerName].CameraDeltaX", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeY", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaY", + "=", + "CameraShake::Noise2d(\"\", TimeFromStart(), 2000) * AmplitudeY * EaseFactor" + ] + }, + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "+", + "Layers[LayerName].CameraDeltaY", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeAngle", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaAngle", + "=", + "CameraShake::Noise2d(\"\", TimeFromStart(), 3000) * AmplitudeAngle * EaseFactor" + ] + }, + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "+", + "Layers[LayerName].CameraDeltaAngle", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "AmplitudeZoom", + "!=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Layers[LayerName].CameraDeltaZoom", + "=", + "pow(AmplitudeZoom, CameraShake::Noise2d(\"\", TimeFromStart(), 4000) * EaseFactor)" + ] + }, + { + "type": { + "value": "ZoomCamera" + }, + "parameters": [ + "", + "CameraZoom(ActualLayerName, 0) * Layers[LayerName].CameraDeltaZoom", + "ActualLayerName", + "0" + ] + } + ] + } ] } ] + } + ], + "variables": [ + { + "folded": true, + "name": "AmplitudeX", + "type": "number", + "value": 0 }, { - "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": "" } ] } @@ -19118,180 +21254,255 @@ "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": [], + "type": "BuiltinCommonInstructions::ForEachChildVariable", + "iterableVariableName": "Layers", + "valueIteratorVariableName": "Layer", + "keyIteratorVariableName": "LayerName", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "Layer.Shakable", + "True", + "" + ] + } + ], "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.ActualLayerName", + "CameraDeltaX", "=", - "VariableString(__CameraShake.LayerName)" + "Layer.CameraDeltaX" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraDeltaY", + "=", + "Layer.CameraDeltaY" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraDeltaAngle", + "=", + "Layer.CameraDeltaAngle" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CameraDeltaZoom", + "=", + "Layer.CameraDeltaZoom" + ] + }, { "type": { - "value": "VarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "ActualLayerName", "=", - "\"__BaseLayer\"" + "LayerName" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "LayerName", + "=", + "\"__BaseLayer\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "ActualLayerName", + "=", + "\"\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraDeltaX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "-", + "CameraDeltaX", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraDeltaY", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "-", + "CameraDeltaY", + "ActualLayerName", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CameraDeltaAngle", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "-", + "CameraDeltaAngle", + "ActualLayerName", + "0" + ] + } ] - } - ], - "actions": [ + }, { - "type": { - "value": "ModVarSceneTxt" - }, - "parameters": [ - "__CameraShake.ActualLayerName", - "=", - "\"\"" + "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": "" }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeX", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetCameraCenterX" - }, - "parameters": [ - "", - "-", - "Variable(__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaX)", - "VariableString(__CameraShake.ActualLayerName)", - "0" - ] - } - ] + "folded": true, + "name": "CameraDeltaX", + "type": "number", + "value": 0 }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeY", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetCameraCenterY" - }, - "parameters": [ - "", - "-", - "Variable(__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaY)", - "VariableString(__CameraShake.ActualLayerName)", - "0" - ] - } - ] + "folded": true, + "name": "CameraDeltaY", + "type": "number", + "value": 0 }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeAngle", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetCameraAngle" - }, - "parameters": [ - "", - "-", - "Variable(__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaAngle)", - "VariableString(__CameraShake.ActualLayerName)", - "0" - ] - } - ] + "folded": true, + "name": "CameraDeltaAngle", + "type": "number", + "value": 0 }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarScene" - }, - "parameters": [ - "__CameraShake.AmplitudeZoom", - "!=", - "1" - ] - } - ], - "actions": [ - { - "type": { - "value": "ZoomCamera" - }, - "parameters": [ - "", - "CameraZoom(VariableString(__CameraShake.ActualLayerName), 0) / Variable(__CameraShake.Layers[VariableString(__CameraShake.LayerName)].CameraDeltaZoom)", - "VariableString(__CameraShake.ActualLayerName)", - "0" - ] - } - ] + "folded": true, + "name": "CameraDeltaZoom", + "type": "number", + "value": 0 } ] } @@ -19314,42 +21525,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" ] } ] @@ -19359,34 +21570,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)" ] } ] @@ -19395,17 +21606,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" } ], @@ -19434,10 +21645,10 @@ "actions": [ { "type": { - "value": "VariableClearChildren" + "value": "ClearVariableChildren" }, "parameters": [ - "__CameraShake.Layers" + "Layers" ] }, { @@ -19447,7 +21658,7 @@ "parameters": [ "", "", - "GetArgumentAsString(\"Layer\")", + "NewLayer", "" ] } @@ -19459,92 +21670,92 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Time", + "Time", "=", "0" ] }, { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.Layer", + "Layer", "=", - "GetArgumentAsString(\"Layer\")" + "NewLayer" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Duration", + "Duration", "=", - "GetArgumentAsNumber(\"Duration\")" + "NewDuration" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.StartEaseDuration", + "StartEaseDuration", "=", "0" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.StopEaseDuration", + "StopEaseDuration", "=", - "GetArgumentAsNumber(\"Duration\")" + "NewDuration" ] }, { "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" ] } ], @@ -19557,7 +21768,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "GetArgumentAsNumber(\"ShakePeriod\")", + "ShakePeriod", "!=", "0" ] @@ -19566,12 +21777,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultFrequency", + "DefaultFrequency", "=", - "1 / GetArgumentAsNumber(\"ShakePeriod\")" + "1 / ShakePeriod" ] } ] @@ -19584,7 +21795,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "GetArgumentAsNumber(\"ShakePeriod\")", + "ShakePeriod", "=", "0" ] @@ -19593,10 +21804,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultFrequency", + "DefaultFrequency", "=", "1 / 0.08" ] @@ -19622,20 +21833,22 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"ShakeForever\"" + "ShakeForever", + "True", + "" ] } ], "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Duration", + "Duration", "=", "1234567890" ] @@ -19659,10 +21872,10 @@ "conditions": [ { "type": { - "value": "VarScene" + "value": "NumberVariable" }, "parameters": [ - "__CameraShake.Duration", + "NewDuration", "=", "0" ] @@ -19671,10 +21884,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Duration", + "Duration", "=", "0.5" ] @@ -19698,7 +21911,7 @@ }, { "description": "Layer (base layer if empty)", - "name": "Layer", + "name": "NewLayer", "type": "layer" }, { @@ -19708,7 +21921,7 @@ }, { "description": "Duration (in seconds) (Default: 0.5)", - "name": "Duration", + "name": "NewDuration", "type": "expression" }, { @@ -19748,30 +21961,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" ] @@ -19801,30 +22014,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" ] @@ -19855,12 +22068,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", - "Layer" + "NewLayerName" ] } ] @@ -19873,7 +22086,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "Layer", + "NewLayerName", "=", "\"\"" ] @@ -19882,10 +22095,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", "\"__BaseLayer\"" ] @@ -19898,21 +22111,24 @@ { "type": { "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Shakable\"" + "Shakable", + "True", + "" ] } ], "actions": [ { "type": { - "value": "SetSceneVariableAsBoolean" + "value": "SetBooleanVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].Shakable", - "=" + "Layers[LayerName].Shakable", + "False", + "" ] } ] @@ -19922,21 +22138,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Shakable\"" + "Shakable", + "True", + "" ] } ], "actions": [ { "type": { - "value": "SetSceneVariableAsBoolean" + "value": "SetBooleanVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].Shakable", - "True" + "Layers[LayerName].Shakable", + "True", + "" ] } ] @@ -19952,7 +22171,7 @@ }, { "description": "Layer", - "name": "Layer", + "name": "NewLayerName", "type": "layer" } ], @@ -19970,12 +22189,12 @@ "conditions": [ { "type": { - "value": "VarScene" + "value": "NumberVariable" }, "parameters": [ - "__CameraShake.Time", + "Time", "<", - "Variable(__CameraShake.Duration)" + "Duration" ] } ], @@ -20008,12 +22227,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", - "Layer" + "NewLayerName" ] } ] @@ -20026,7 +22245,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "Layer", + "NewLayerName", "=", "\"\"" ] @@ -20035,10 +22254,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", "\"__BaseLayer\"" ] @@ -20051,20 +22270,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" ] @@ -20085,7 +22304,7 @@ }, { "description": "Layer", - "name": "Layer", + "name": "NewLayerName", "type": "layer" } ], @@ -20105,12 +22324,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", - "Layer" + "NewLayerName" ] } ] @@ -20123,7 +22342,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "Layer", + "NewLayerName", "=", "\"\"" ] @@ -20132,10 +22351,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", "\"__BaseLayer\"" ] @@ -20148,10 +22367,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].AmplitudeAngle", + "Layers[LayerName].AmplitudeAngle", "=", "AmplitudeAngle" ] @@ -20166,8 +22385,8 @@ "type": "expression" }, { - "description": "Layer", - "name": "Layer", + "description": "NewLayerName", + "name": "NewLayerName", "type": "layer" } ], @@ -20187,12 +22406,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", - "GetArgumentAsString(\"Layer\")" + "NewLayerName" ] } ] @@ -20205,7 +22424,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "Layer", + "NewLayerName", "=", "\"\"" ] @@ -20214,10 +22433,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", "\"__BaseLayer\"" ] @@ -20230,12 +22449,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].AmplitudeZoom", + "Layers[LayerName].AmplitudeZoom", "=", - "GetArgumentAsNumber(\"AmplitudeZoom\")" + "AmplitudeZoom" ] } ] @@ -20248,8 +22467,8 @@ "type": "expression" }, { - "description": "Layer", - "name": "Layer", + "description": "NewLayerName", + "name": "NewLayerName", "type": "layer" } ], @@ -20269,12 +22488,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", - "GetArgumentAsString(\"Layer\")" + "NewLayerName" ] } ] @@ -20287,7 +22506,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "Layer", + "NewLayerName", "=", "\"\"" ] @@ -20296,10 +22515,10 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__CameraShake.LayerName", + "LayerName", "=", "\"__BaseLayer\"" ] @@ -20312,12 +22531,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.Layers[VariableString(__CameraShake.LayerName)].Frequency", + "Layers[LayerName].Frequency", "=", - "GetArgumentAsNumber(\"Frequency\")" + "Frequency" ] } ] @@ -20330,8 +22549,8 @@ "type": "expression" }, { - "description": "Layer", - "name": "Layer", + "description": "NewLayerName", + "name": "NewLayerName", "type": "layer" } ], @@ -20351,20 +22570,20 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeX", + "DefaultAmplitudeX", "=", "AmplitudeX" ] }, { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeY", + "DefaultAmplitudeY", "=", "AmplitudeY" ] @@ -20400,10 +22619,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeAngle", + "DefaultAmplitudeAngle", "=", "AmplitudeAngle" ] @@ -20434,10 +22653,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultAmplitudeZoom", + "DefaultAmplitudeZoom", "=", "AmplitudeZoom" ] @@ -20468,10 +22687,10 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__CameraShake.DefaultFrequency", + "DefaultFrequency", "=", "Frequency" ] @@ -21755,12 +23974,13 @@ "category": "Visual effect", "extensionNamespace": "", "fullName": "Flash object", + "gdevelopVersion": ">=5.5.222", "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.2.0", + "version": "1.4.0", "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).", @@ -21803,6 +24023,7 @@ "fullName": "Color tint applied to an object", "functionType": "ExpressionAndCondition", "name": "ColorTint", + "private": true, "sentence": "Color tint applied to _PARAM1_", "events": [ { @@ -21835,170 +24056,60 @@ }, "parameters": [ { - "description": "Object", - "name": "Object", - "supplementaryInformation": "Sprite", - "type": "objectList" - } - ], - "objectGroups": [] - }, - { - "description": "Check if a color tint is applied to an object.", - "fullName": "Is a color tint applied to an object", - "functionType": "StringExpression", - "name": "IsTinted", - "sentence": "_PARAM1_ is color tinted", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "Flash::ColorTint" - }, - "parameters": [ - "", - "=", - "\"255;255;255\"", - "Object", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "expressionType": { - "type": "color" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "Sprite", - "type": "objectList" - } - ], - "objectGroups": [] - }, - { - "description": "Toggle an object effect.", - "fullName": "Toggle an object effect", - "functionType": "Action", - "name": "ToggleEffect", - "sentence": "Toggle effect _PARAM2_ on _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetObjectVariableAsBoolean" - }, - "parameters": [ - "Object", - "__Flash_EffectToggled", - "False" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "IsEffectEnabled" - }, - "parameters": [ - "Object", - "GetArgumentAsString(\"EffectName\")" - ] - } - ], - "actions": [ - { - "type": { - "value": "EnableEffect" - }, - "parameters": [ - "Object", - "GetArgumentAsString(\"EffectName\")", - "" - ] - }, - { - "type": { - "value": "SetObjectVariableAsBoolean" - }, - "parameters": [ - "Object", - "__Flash_EffectToggled", - "True" - ] - } - ] - }, + "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": { - "value": "ObjectVariableAsBoolean" - }, - "parameters": [ - "Object", - "__Flash_EffectToggled", - "False" - ] - }, { "type": { "inverted": true, - "value": "IsEffectEnabled" + "value": "Flash::ColorTint" }, "parameters": [ + "", + "=", + "\"255;255;255\"", "Object", - "GetArgumentAsString(\"EffectName\")" + "" ] } ], "actions": [ { "type": { - "value": "EnableEffect" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "GetArgumentAsString(\"EffectName\")", - "yes" + "True" ] } ] } ], + "expressionType": { + "type": "color" + }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "objectList" - }, - { - "description": "Effect name to toggle", - "name": "EffectName", - "type": "objectEffectName" } ], "objectGroups": [] @@ -22070,7 +24181,7 @@ }, "parameters": [ "Object", - "GetArgumentAsString(\"ColorTint\")" + "ColorTint" ] }, { @@ -22148,6 +24259,7 @@ "fullName": "Toggle object visibility", "functionType": "Action", "name": "ToggleVisibility", + "private": true, "sentence": "Toggle visibility of _PARAM1_", "events": [ { @@ -22263,11 +24375,12 @@ "conditions": [ { "type": { - "value": "Flash::Flash::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -22293,7 +24406,7 @@ "Object", "\"Flash_Visibility_Timer\"", ">", - "Object.Behavior::PropertyHalfPeriodTime()" + "HalfPeriodTime" ] } ], @@ -22336,11 +24449,10 @@ "conditions": [ { "type": { - "value": "Flash::Flash::PropertyFlashDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", ">", "0" ] @@ -22353,7 +24465,7 @@ "Object", "\"Flash_Visibility_Duration_Timer\"", ">", - "Object.Behavior::PropertyFlashDuration()" + "FlashDuration" ] } ], @@ -22426,12 +24538,12 @@ }, { "type": { - "value": "Flash::Flash::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsFlashing", + "True", + "" ] }, { @@ -22460,13 +24572,12 @@ }, { "type": { - "value": "Flash::Flash::SetPropertyFlashDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", "=", - "GetArgumentAsNumber(\"FlashDuration\")" + "NewFlashDuration" ] } ] @@ -22487,7 +24598,7 @@ { "description": "Duration of the flashing, in seconds", "longDescription": "Use \"0\" to keep flashing until stopped.", - "name": "FlashDuration", + "name": "NewFlashDuration", "type": "expression" } ], @@ -22519,11 +24630,12 @@ "conditions": [ { "type": { - "value": "Flash::Flash::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -22604,11 +24716,12 @@ "conditions": [ { "type": { - "value": "Flash::Flash::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -22624,12 +24737,12 @@ }, { "type": { - "value": "Flash::Flash::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsFlashing", + "False", + "" ] }, { @@ -22685,7 +24798,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHalfPeriodTime()" + "HalfPeriodTime" ] } ] @@ -22722,13 +24835,12 @@ "actions": [ { "type": { - "value": "Flash::Flash::SetPropertyHalfPeriodTime" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HalfPeriodTime", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22757,17 +24869,12 @@ "unit": "Second", "label": "Half period ", "description": "Time that the object is invisible", - "group": "", - "extraInformation": [], "name": "HalfPeriodTime" }, { "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "IsFlashing" }, @@ -22777,8 +24884,6 @@ "unit": "Second", "label": "Flash duration", "description": "Use \"0\" to keep flashing until stopped", - "group": "", - "extraInformation": [], "hidden": true, "name": "FlashDuration" } @@ -22802,11 +24907,12 @@ "conditions": [ { "type": { - "value": "Flash::FlashColor::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -22832,7 +24938,7 @@ "Object", "\"Flash_Color_Timer\"", ">", - "Object.Behavior::PropertyHalfPeriodTime()" + "HalfPeriodTime" ] } ], @@ -22853,7 +24959,7 @@ "parameters": [ "", "Object", - "Object.Behavior::PropertyTintColor()", + "TintColor", "" ] } @@ -22876,11 +24982,10 @@ "conditions": [ { "type": { - "value": "Flash::FlashColor::PropertyFlashDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", ">", "0" ] @@ -22893,7 +24998,7 @@ "Object", "\"Flash_Color_Duration_Timer\"", ">", - "Object.Behavior::PropertyFlashDuration()" + "FlashDuration" ] } ], @@ -22945,11 +25050,12 @@ { "type": { "inverted": true, - "value": "Flash::FlashColor::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -22981,18 +25087,18 @@ "parameters": [ "", "Object", - "GetArgumentAsString(\"ColorTint\")", + "NewColorTint", "" ] }, { "type": { - "value": "Flash::FlashColor::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsFlashing", + "True", + "" ] } ] @@ -23012,24 +25118,22 @@ }, { "type": { - "value": "Flash::FlashColor::SetPropertyTintColor" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "TintColor", "=", - "GetArgumentAsString(\"ColorTint\")" + "NewColorTint" ] }, { "type": { - "value": "Flash::FlashColor::SetPropertyFlashDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", "=", - "GetArgumentAsNumber(\"FlashDuration\")" + "NewFlashDuration" ] } ] @@ -23051,12 +25155,12 @@ { "description": "Duration of the flashing, in seconds", "longDescription": "Use \"0\" to keep flashing until stopped.", - "name": "FlashDuration", + "name": "NewFlashDuration", "type": "expression" }, { "description": "Color tint", - "name": "ColorTint", + "name": "NewColorTint", "type": "color" } ], @@ -23088,11 +25192,12 @@ "conditions": [ { "type": { - "value": "Flash::FlashColor::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -23175,23 +25280,24 @@ "conditions": [ { "type": { - "value": "Flash::FlashColor::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Flash::FlashColor::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsFlashing", + "False", + "" ] }, { @@ -23257,7 +25363,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHalfPeriodTime()" + "HalfPeriodTime" ] } ] @@ -23295,13 +25401,12 @@ "actions": [ { "type": { - "value": "Flash::FlashColor::SetPropertyHalfPeriodTime" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HalfPeriodTime", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23331,17 +25436,12 @@ "unit": "Second", "label": "Half period", "description": "Time between flashes", - "group": "", - "extraInformation": [], "name": "HalfPeriodTime" }, { "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "IsFlashing" }, @@ -23351,8 +25451,6 @@ "unit": "Second", "label": "Flash duration", "description": "Use \"0\" to keep flashing until stopped", - "group": "", - "extraInformation": [], "hidden": true, "name": "FlashDuration" }, @@ -23360,9 +25458,6 @@ "value": "\"255;255;255\"", "type": "String", "label": "Tint color", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TintColor" } @@ -23373,7 +25468,7 @@ "description": "Flash opacity smoothly (fade) in a repeating loop.", "fullName": "Flash opacity smothly (fade)", "name": "FlashOpacity", - "objectType": "Sprite", + "objectType": "", "eventsFunctions": [ { "fullName": "", @@ -23429,9 +25524,9 @@ "Object", "TweenBehavior", "\"__Flash.ToStartingOpacity\"", - "Object.Behavior::PropertyStartingOpacity()", + "StartingOpacity", "\"easeInOutCubic\"", - "1000 * Object.Behavior::PropertyHalfPeriodTime()", + "1000 * HalfPeriodTime", "" ] }, @@ -23470,9 +25565,9 @@ "Object", "TweenBehavior", "\"__Flash.ToTargetOpacity\"", - "Object.Behavior::PropertyTargetOpacity()", + "TargetOpacity", "\"easeInOutCubic\"", - "1000 * Object.Behavior::PropertyHalfPeriodTime()", + "1000 * HalfPeriodTime", "" ] }, @@ -23505,11 +25600,10 @@ "conditions": [ { "type": { - "value": "Flash::FlashOpacity::PropertyFlashDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", ">", "0" ] @@ -23522,7 +25616,7 @@ "Object", "\"Flash_Opacity_Duration_Timer\"", ">", - "Object.Behavior::PropertyFlashDuration()" + "FlashDuration" ] } ], @@ -23549,7 +25643,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23574,24 +25667,24 @@ { "type": { "inverted": true, - "value": "Flash::FlashOpacity::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Flash::FlashOpacity::SetPropertyStartingOpacity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "StartingOpacity", "=", - "Object.Opacity()" + "Object.Opacity::Value()" ] }, { @@ -23602,20 +25695,20 @@ "Object", "TweenBehavior", "\"__Flash.ToTargetOpacity\"", - "GetArgumentAsNumber(\"TargetOpacity\")", + "NewTargetOpacity", "\"easeInOutCubic\"", - "1000 * Object.Behavior::PropertyHalfPeriodTime()", + "1000 * HalfPeriodTime", "" ] }, { "type": { - "value": "Flash::FlashOpacity::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsFlashing", + "True", + "" ] } ] @@ -23635,24 +25728,22 @@ }, { "type": { - "value": "Flash::FlashOpacity::SetPropertyFlashDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", "=", - "GetArgumentAsNumber(\"FlashDuration\")" + "NewFlashDuration" ] }, { "type": { - "value": "Flash::FlashOpacity::SetPropertyTargetOpacity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TargetOpacity", "=", - "GetArgumentAsNumber(\"TargetOpacity\")" + "NewTargetOpacity" ] } ] @@ -23662,7 +25753,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23680,12 +25770,12 @@ { "description": "Duration of the flashing, in seconds", "longDescription": "Use \"0\" to keep flashing until stopped.", - "name": "FlashDuration", + "name": "NewFlashDuration", "type": "expression" }, { "description": "Target opacity", - "name": "TargetOpacity", + "name": "NewTargetOpacity", "type": "expression" } ], @@ -23717,11 +25807,12 @@ "conditions": [ { "type": { - "value": "Flash::FlashColor::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -23741,7 +25832,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23780,7 +25870,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23816,12 +25905,12 @@ "actions": [ { "type": { - "value": "Flash::FlashOpacity::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsFlashing", + "False", + "" ] }, { @@ -23855,12 +25944,13 @@ }, { "type": { - "value": "Opacity" + "value": "OpacityCapability::OpacityBehavior::SetValue" }, "parameters": [ "Object", + "Opacity", "=", - "Object.Behavior::PropertyStartingOpacity()" + "StartingOpacity" ] } ] @@ -23870,7 +25960,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23899,7 +25988,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHalfPeriodTime()" + "HalfPeriodTime" ] } ] @@ -23912,7 +26001,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23937,13 +26025,12 @@ "actions": [ { "type": { - "value": "Flash::FlashOpacity::SetPropertyHalfPeriodTime" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HalfPeriodTime", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23953,7 +26040,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -23967,12 +26053,19 @@ } ], "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Opacity capability", + "extraInformation": [ + "OpacityCapability::OpacityBehavior" + ], + "name": "Opacity" + }, { "value": "", "type": "Behavior", "label": "Tween Behavior (required)", - "description": "", - "group": "", "extraInformation": [ "Tween::TweenBehavior" ], @@ -23984,17 +26077,12 @@ "unit": "Second", "label": "Half period", "description": "Time between flashes", - "group": "", - "extraInformation": [], "name": "HalfPeriodTime" }, { "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "IsFlashing" }, @@ -24004,8 +26092,6 @@ "unit": "Second", "label": "Flash duration", "description": "Use \"0\" to keep flashing until stopped", - "group": "", - "extraInformation": [], "hidden": true, "name": "FlashDuration" }, @@ -24015,8 +26101,6 @@ "unit": "Dimensionless", "label": "Target opacity (Range: 0 - 255)", "description": "Opacity will fade between the starting value and a target value", - "group": "", - "extraInformation": [], "hidden": true, "name": "TargetOpacity" }, @@ -24026,8 +26110,6 @@ "unit": "Dimensionless", "label": "Starting opacity", "description": "Opacity will fade between the starting value and a target value", - "group": "", - "extraInformation": [], "hidden": true, "name": "StartingOpacity" } @@ -24038,7 +26120,7 @@ "description": "Make the object flash an effect for a period of time.", "fullName": "Flash effect", "name": "FlashEffect", - "objectType": "Sprite", + "objectType": "", "eventsFunctions": [ { "fullName": "", @@ -24082,7 +26164,7 @@ "Object", "\"Flash_Effect_Timer\"", ">", - "Object.Behavior::PropertyHalfPeriodTime()" + "HalfPeriodTime" ] } ], @@ -24098,12 +26180,12 @@ }, { "type": { - "value": "Flash::ToggleEffect" + "value": "Flash::FlashEffect::ToggleEffect" }, "parameters": [ - "", "Object", - "Object.Behavior::PropertyEffectName()", + "Behavior", + "EffectName", "" ] } @@ -24126,11 +26208,10 @@ "conditions": [ { "type": { - "value": "Flash::FlashEffect::PropertyFlashDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", ">", "0" ] @@ -24143,7 +26224,7 @@ "Object", "\"Flash_Effect_Duration_Timer\"", ">", - "Object.Behavior::PropertyFlashDuration()" + "FlashDuration" ] } ], @@ -24170,7 +26251,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -24216,13 +26296,12 @@ }, { "type": { - "value": "Flash::FlashEffect::PropertyEffectName" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "EffectName", "!=", - "GetArgumentAsString(\"EffectName\")" + "NewEffectName" ] } ], @@ -24261,11 +26340,12 @@ "conditions": [ { "type": { - "value": "IsEffectEnabled" + "value": "EffectCapability::EffectBehavior::IsEffectEnabled" }, "parameters": [ "Object", - "GetArgumentAsString(\"EffectName\")" + "Effect", + "NewEffectName" ] } ], @@ -24288,11 +26368,12 @@ { "type": { "inverted": true, - "value": "IsEffectEnabled" + "value": "EffectCapability::EffectBehavior::IsEffectEnabled" }, "parameters": [ "Object", - "GetArgumentAsString(\"EffectName\")" + "Effect", + "NewEffectName" ] } ], @@ -24315,12 +26396,12 @@ "actions": [ { "type": { - "value": "Flash::ToggleEffect" + "value": "Flash::FlashEffect::ToggleEffect" }, "parameters": [ - "", "Object", - "GetArgumentAsString(\"EffectName\")", + "Behavior", + "NewEffectName", "" ] }, @@ -24335,12 +26416,12 @@ }, { "type": { - "value": "Flash::FlashEffect::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsFlashing", + "True", + "" ] } ] @@ -24362,24 +26443,22 @@ }, { "type": { - "value": "Flash::FlashEffect::SetPropertyFlashDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", "=", - "GetArgumentAsNumber(\"FlashDuration\")" + "NewFlashDuration" ] }, { "type": { - "value": "Flash::FlashEffect::SetPropertyEffectName" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "EffectName", "=", - "GetArgumentAsString(\"EffectName\")" + "NewEffectName" ] } ] @@ -24389,7 +26468,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -24401,12 +26479,12 @@ { "description": "Duration of the flashing, in seconds", "longDescription": "Use \"0\" to keep flashing until stopped.", - "name": "FlashDuration", + "name": "NewFlashDuration", "type": "expression" }, { "description": "Name of effect", - "name": "EffectName", + "name": "NewEffectName", "type": "objectEffectName" } ], @@ -24438,11 +26516,12 @@ "conditions": [ { "type": { - "value": "Flash::FlashEffect::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -24462,7 +26541,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -24501,7 +26579,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -24525,23 +26602,24 @@ "conditions": [ { "type": { - "value": "Flash::FlashColor::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Flash::FlashEffect::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsFlashing", + "False", + "" ] }, { @@ -24581,11 +26659,12 @@ "actions": [ { "type": { - "value": "EnableEffect" + "value": "EffectCapability::EffectBehavior::EnableEffect" }, "parameters": [ "Object", - "Object.Behavior::PropertyEffectName()", + "Effect", + "EffectName", "yes" ] } @@ -24608,11 +26687,12 @@ "actions": [ { "type": { - "value": "EnableEffect" + "value": "EffectCapability::EffectBehavior::EnableEffect" }, "parameters": [ "Object", - "Object.Behavior::PropertyEffectName()", + "Effect", + "EffectName", "" ] } @@ -24625,7 +26705,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -24654,7 +26733,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHalfPeriodTime()" + "HalfPeriodTime" ] } ] @@ -24667,7 +26746,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -24692,13 +26770,129 @@ "actions": [ { "type": { - "value": "Flash::FlashEffect::SetPropertyHalfPeriodTime" + "value": "SetNumberVariable" + }, + "parameters": [ + "HalfPeriodTime", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashEffect", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Toggle an object effect.", + "fullName": "Toggle an object effect", + "functionType": "Action", + "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": "EffectCapability::EffectBehavior::IsEffectEnabled" + }, + "parameters": [ + "Object", + "Effect", + "EffectName" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "EffectName", + "" + ] + }, + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_EffectToggled", + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_EffectToggled", + "False" + ] + }, + { + "type": { + "inverted": true, + "value": "EffectCapability::EffectBehavior::IsEffectEnabled" + }, + "parameters": [ + "Object", + "Effect", + "EffectName" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" }, "parameters": [ "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "Effect", + "EffectName", + "yes" ] } ] @@ -24708,7 +26902,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -24716,29 +26909,38 @@ "name": "Behavior", "supplementaryInformation": "Flash::FlashEffect", "type": "behavior" + }, + { + "description": "Effect name to toggle", + "name": "EffectName", + "type": "objectEffectName" } ], "objectGroups": [] } ], "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Effect capability", + "extraInformation": [ + "EffectCapability::EffectBehavior" + ], + "name": "Effect" + }, { "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" }, @@ -24748,8 +26950,6 @@ "unit": "Second", "label": "Flash duration", "description": "Use \"0\" to keep flashing until stopped", - "group": "", - "extraInformation": [], "hidden": true, "name": "FlashDuration" }, @@ -24757,9 +26957,6 @@ "value": "", "type": "String", "label": "Name of effect", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "EffectName" } @@ -24774,12 +26971,13 @@ "category": "Game mechanic", "extensionNamespace": "", "fullName": "Health points and damage", + "gdevelopVersion": ">=5.5.222", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWhlYXJ0LWhhbGYtZnVsbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNi41LDVDMTUsNSAxMy41OCw1LjkxIDEzLDcuMlYxNy43NEMxNy4yNSwxMy44NyAyMCwxMS4yIDIwLDguNUMyMCw2LjUgMTguNSw1IDE2LjUsNU0xNi41LDNDMTkuNTgsMyAyMiw1LjQxIDIyLDguNUMyMiwxMi4yNyAxOC42LDE1LjM2IDEzLjQ1LDIwLjAzTDEyLDIxLjM1TDEwLjU1LDIwLjAzQzUuNCwxNS4zNiAyLDEyLjI3IDIsOC41QzIsNS40MSA0LjQyLDMgNy41LDNDOS4yNCwzIDEwLjkxLDMuODEgMTIsNS4wOEMxMy4wOSwzLjgxIDE0Ljc2LDMgMTYuNSwzWiIgLz48L3N2Zz4=", "name": "Health", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/heart-half-full.svg", "shortDescription": "Manage health (life) points, shield and armor.", - "version": "0.3.1", + "version": "0.4.0", "description": [ "Manage health (life) points, shield and armor. ", "", @@ -24852,7 +27050,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyHealth()", + "Health", "" ] } @@ -24915,22 +27113,20 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyHealthRegenRate" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HealthRegenRate", "!=", "0" ] }, { "type": { - "value": "Health::Health::PropertyCurrentHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "<", "Object.Behavior::MaxHealth()" ] @@ -24943,20 +27139,19 @@ "Object", "\"__Health.TimeSinceLastHit\"", ">", - "Object.Behavior::PropertyHealthRegenDelay()" + "HealthRegenDelay" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "+", - "Object.Behavior::PropertyHealthRegenRate() * TimeDelta()" + "HealthRegenRate * TimeDelta()" ] } ], @@ -24978,11 +27173,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", ">", "Object.Behavior::MaxHealth()" ] @@ -24991,13 +27185,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "=", - "Object.Behavior::PropertyMaxHealth()" + "MaxHealth" ] } ] @@ -25022,32 +27215,32 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsHealthJustDamaged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsHealthJustDamaged", + "False", + "" ] }, { "type": { - "value": "Health::Health::SetPropertyIsJustHealed" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsJustHealed", + "False", + "" ] }, { "type": { - "value": "Health::Health::SetPropertyIsJustDodged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsJustDodged", + "False", + "" ] } ] @@ -25093,24 +27286,22 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyShieldRegenRate" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldRegenRate", "!=", "0" ] }, { "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "<", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] }, { @@ -25121,7 +27312,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", ">", - "Object.Behavior::PropertyShieldRegenDelay()" + "ShieldRegenDelay" ] } ], @@ -25132,11 +27323,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", "0" ] @@ -25161,13 +27351,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "+", - "Object.Behavior::PropertyShieldRegenRate() * TimeDelta()" + "ShieldRegenRate * TimeDelta()" ] } ] @@ -25189,26 +27378,24 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", ">", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ] @@ -25251,11 +27438,10 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", "0" ] @@ -25280,12 +27466,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsShieldJustDamaged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsShieldJustDamaged", + "False", + "" ] } ] @@ -25359,13 +27545,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "=", - "GetArgumentAsNumber(\"DamageValue\")" + "DamageValue" ] } ], @@ -25401,28 +27586,27 @@ "parameters": [ "RandomFloatInRange(0,1)", "<", - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsJustDodged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsJustDodged", + "True", + "" ] }, { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "=", "0" ] @@ -25446,19 +27630,20 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"UseArmor\"" + "UseArmor", + "True", + "" ] }, { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", ">", "0" ] @@ -25481,13 +27666,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "=", - "max(0,Object.Behavior::PropertyDamageToBeApplied() - Object.Behavior::PropertyFlatDamageReduction())" + "max(0,DamageToBeApplied - FlatDamageReduction)" ] } ] @@ -25509,22 +27693,20 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyPercentDamageReduction" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PercentDamageReduction", ">", "0" ] }, { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", ">", "0" ] @@ -25533,13 +27715,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "*", - "1 - min(1, Object.Behavior::PropertyPercentDamageReduction())" + "1 - min(1, PercentDamageReduction)" ] } ] @@ -25578,10 +27759,12 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"UseShield\"" + "UseShield", + "True", + "" ] }, { @@ -25596,11 +27779,10 @@ }, { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", ">", "0" ] @@ -25609,12 +27791,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsShieldJustDamaged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsShieldJustDamaged", + "True", + "" ] }, { @@ -25646,46 +27828,42 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "<=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "-", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { "type": { - "value": "Health::Health::SetPropertyShieldDamageTaken" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDamageTaken", "=", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "=", "0" ] @@ -25709,26 +27887,24 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", ">", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldDamageTaken" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDamageTaken", "=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -25738,33 +27914,32 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyBlockExcessDamage" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "BlockExcessDamage", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "=", "0" ] }, { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", "0" ] @@ -25789,33 +27964,32 @@ { "type": { "inverted": true, - "value": "Health::Health::PropertyBlockExcessDamage" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "BlockExcessDamage", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "-", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] }, { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", "0" ] @@ -25843,11 +28017,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", ">", "0" ] @@ -25888,7 +28061,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyCurrentHealth() - Object.Behavior::PropertyDamageToBeApplied()", + "CurrentHealth - DamageToBeApplied", "" ] } @@ -25956,7 +28129,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCurrentHealth()" + "CurrentHealth" ] } ] @@ -25994,13 +28167,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -26022,11 +28194,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyMaxHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxHealth", ">", "0" ] @@ -26035,13 +28206,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "=", - "min(Object.Behavior::PropertyCurrentHealth(), Object.Behavior::PropertyMaxHealth())" + "min(CurrentHealth, MaxHealth)" ] } ] @@ -26087,7 +28257,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -26148,11 +28318,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyMaxHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxHealth", "=", "0" ] @@ -26161,13 +28330,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HealToBeApplied", "=", - "GetArgumentAsNumber(\"HealValue\")" + "HealValue" ] } ] @@ -26189,11 +28357,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyMaxHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxHealth", ">", "0" ] @@ -26201,24 +28368,24 @@ { "type": { "inverted": true, - "value": "Health::Health::PropertyAllowOverHealing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "AllowOverHealing", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HealToBeApplied", "=", - "min(GetArgumentAsNumber(\"HealValue\"),Object.Behavior::PropertyMaxHealth() - Object.Behavior::PropertyCurrentHealth())" + "min(HealValue,MaxHealth - CurrentHealth)" ] } ] @@ -26241,13 +28408,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "+", - "Object.Behavior::PropertyHealToBeApplied()" + "HealToBeApplied" ] } ] @@ -26270,12 +28436,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsJustHealed" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsJustHealed", + "True", + "" ] } ] @@ -26321,7 +28487,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxHealth()" + "MaxHealth" ] } ] @@ -26358,13 +28524,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyMaxHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxHealth", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -26386,11 +28551,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", ">", "Object.Behavior::MaxHealth()" ] @@ -26399,11 +28563,10 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "=", "Object.Behavior::MaxHealth()" ] @@ -26452,7 +28615,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -26496,7 +28659,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenRate()" + "HealthRegenRate" ] } ] @@ -26533,13 +28696,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealthRegenRate" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HealthRegenRate", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -26586,7 +28748,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -26630,7 +28792,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDamageCooldown()" + "DamageCooldown" ] } ] @@ -26667,13 +28829,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageCooldown" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageCooldown", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -26720,7 +28881,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -26764,7 +28925,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenDelay()" + "HealthRegenDelay" ] } ] @@ -26801,13 +28962,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealthRegenDelay" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HealthRegenDelay", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -26854,7 +29014,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -26898,7 +29058,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ] @@ -26935,13 +29095,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyChanceToDodge" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ChanceToDodge", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -26988,7 +29147,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -27032,7 +29191,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFlatDamageReduction()" + "FlatDamageReduction" ] } ] @@ -27069,13 +29228,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyFlatDamageReduction" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlatDamageReduction", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -27122,7 +29280,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -27166,7 +29324,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPercentDamageReduction()" + "PercentDamageReduction" ] } ] @@ -27203,13 +29361,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyPercentDamageReduction" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PercentDamageReduction", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -27256,7 +29413,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -27297,12 +29454,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyAllowOverHealing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "AllowOverHealing", + "False", + "" ] } ] @@ -27312,22 +29469,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Value\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyAllowOverHealing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "AllowOverHealing", + "True", + "" ] } ] @@ -27368,12 +29527,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHitAtLeastOnce" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "HitAtLeastOnce", + "False", + "" ] } ] @@ -27383,22 +29542,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Value\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyHitAtLeastOnce" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "HitAtLeastOnce", + "True", + "" ] } ] @@ -27439,12 +29600,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsHealthJustDamaged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsHealthJustDamaged", + "False", + "" ] } ] @@ -27454,22 +29615,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Value\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsHealthJustDamaged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsHealthJustDamaged", + "True", + "" ] } ] @@ -27615,11 +29778,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyHitAtLeastOnce" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HitAtLeastOnce", + "True", + "" ] } ], @@ -27677,11 +29841,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsHealthJustDamaged" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsHealthJustDamaged", + "True", + "" ] } ], @@ -27739,11 +29904,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsJustHealed" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsJustHealed", + "True", + "" ] } ], @@ -27801,20 +29967,20 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyHitAtLeastOnce" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HitAtLeastOnce", + "True", + "" ] }, { "type": { - "value": "Health::Health::PropertyDamageCooldown" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageCooldown", ">", "0" ] @@ -27827,7 +29993,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", "<", - "Object.Behavior::PropertyDamageCooldown()" + "DamageCooldown" ] } ], @@ -27900,7 +30066,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::PropertyDamageCooldown() - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" + "max(0,DamageCooldown - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" ] } ] @@ -27951,11 +30117,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "<=", "0" ] @@ -28046,7 +30211,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] } ] @@ -28087,7 +30252,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ] @@ -28124,13 +30289,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyMaxShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxShieldPoints", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28177,7 +30341,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -28225,7 +30389,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -28269,7 +30433,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ] @@ -28306,13 +30470,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28359,7 +30522,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -28403,7 +30566,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenRate()" + "ShieldRegenRate" ] } ] @@ -28440,13 +30603,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldRegenRate" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldRegenRate", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28493,7 +30655,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -28537,7 +30699,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenDelay()" + "ShieldRegenDelay" ] } ] @@ -28574,13 +30736,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldRegenDelay" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldRegenDelay", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28627,7 +30788,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -28671,7 +30832,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDuration()" + "ShieldDuration" ] } ] @@ -28708,13 +30869,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDuration", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -28761,7 +30921,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -28841,13 +31001,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", - "GetArgumentAsNumber(\"ShieldPoints\")" + "ShieldPoints" ] } ] @@ -28857,11 +31016,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyMaxShieldPoints" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxShieldPoints", ">", "0" ] @@ -28870,13 +31028,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", - "min(GetArgumentAsNumber(\"ShieldPoints\"),Object.Behavior::MaxShield())" + "min(ShieldPoints,Object.Behavior::MaxShield())" ] } ] @@ -28886,10 +31043,12 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"RenewShieldDuration\"" + "RenewShieldDuration", + "True", + "" ] } ], @@ -28948,12 +31107,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyBlockExcessDamage" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "BlockExcessDamage", + "False", + "" ] } ] @@ -28963,22 +31122,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Value\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyBlockExcessDamage" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "BlockExcessDamage", + "True", + "" ] } ] @@ -29031,11 +31192,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsShieldJustDamaged" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsShieldJustDamaged", + "True", + "" ] } ], @@ -29093,11 +31255,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsJustDodged" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsJustDodged", + "True", + "" ] } ], @@ -29167,11 +31330,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", ">", "0" ] @@ -29196,11 +31358,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyShieldDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDuration", "<=", "0" ] @@ -29222,11 +31383,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyShieldDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDuration", ">", "0" ] @@ -29239,7 +31399,7 @@ "Object", "\"__Health.ShieldDuration\"", "<", - "Object.Behavior::PropertyShieldDuration()" + "ShieldDuration" ] } ], @@ -29299,11 +31459,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyShieldDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDuration", ">", "0" ] @@ -29315,7 +31474,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::PropertyShieldDuration() - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" + "max(0,ShieldDuration - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" ] } ] @@ -29356,7 +31515,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDamageTaken()" + "ShieldDamageTaken" ] } ] @@ -29397,7 +31556,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealToBeApplied()" + "HealToBeApplied" ] } ] @@ -29427,18 +31586,14 @@ "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" }, @@ -29448,7 +31603,6 @@ "label": "Maximum health", "description": "Use 0 for no maximum.", "group": "Health", - "extraInformation": [], "name": "MaxHealth" }, { @@ -29456,18 +31610,14 @@ "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" }, @@ -29475,9 +31625,7 @@ "value": "", "type": "Boolean", "label": "", - "description": "", "group": "Health", - "extraInformation": [], "hidden": true, "name": "IsHealthJustDamaged" }, @@ -29485,9 +31633,7 @@ "value": "0", "type": "Number", "label": "Damage to health from the previous incoming damage", - "description": "", "group": "Health", - "extraInformation": [], "hidden": true, "name": "DamageToBeApplied" }, @@ -29495,9 +31641,7 @@ "value": "", "type": "Boolean", "label": "", - "description": "", "group": "Health", - "extraInformation": [], "hidden": true, "name": "HitAtLeastOnce" }, @@ -29507,7 +31651,6 @@ "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" }, @@ -29515,9 +31658,7 @@ "value": "", "type": "Boolean", "label": "", - "description": "", "group": "Health", - "extraInformation": [], "hidden": true, "name": "IsJustDodged" }, @@ -29525,9 +31666,7 @@ "value": "0", "type": "Number", "label": "Health points gained from the previous heal", - "description": "", "group": "Health", - "extraInformation": [], "hidden": true, "name": "HealToBeApplied" }, @@ -29535,9 +31674,7 @@ "value": "0", "type": "Number", "label": "Rate of health regeneration (points per second)", - "description": "", "group": "Health regeneration", - "extraInformation": [], "advanced": true, "name": "HealthRegenRate" }, @@ -29548,7 +31685,6 @@ "label": "Health regeneration delay ", "description": "Delay before health regeneration starts after a hit.", "group": "Health regeneration", - "extraInformation": [], "advanced": true, "name": "HealthRegenDelay" }, @@ -29556,9 +31692,6 @@ "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "IsJustHealed" }, @@ -29566,9 +31699,7 @@ "value": "", "type": "Number", "label": "Current shield points", - "description": "", "group": "Shield", - "extraInformation": [], "hidden": true, "name": "CurrentShieldPoints" }, @@ -29578,7 +31709,6 @@ "label": "Maximum shield", "description": "Leave 0 for unlimited.", "group": "Shield", - "extraInformation": [], "advanced": true, "name": "MaxShieldPoints" }, @@ -29589,7 +31719,6 @@ "label": "Duration of shield", "description": "Use 0 to make the shield permanent.", "group": "Shield", - "extraInformation": [], "advanced": true, "name": "ShieldDuration" }, @@ -29597,9 +31726,7 @@ "value": "0", "type": "Number", "label": "Rate of shield regeneration (points per second)", - "description": "", "group": "Shield regeneration", - "extraInformation": [], "advanced": true, "name": "ShieldRegenRate" }, @@ -29607,9 +31734,7 @@ "value": "", "type": "Boolean", "label": "Block excess damage when shield is broken", - "description": "", "group": "Shield", - "extraInformation": [], "advanced": true, "name": "BlockExcessDamage" }, @@ -29620,7 +31745,6 @@ "label": "Shield regeneration delay", "description": "Delay before shield regeneration starts after a hit.", "group": "Shield regeneration", - "extraInformation": [], "advanced": true, "name": "ShieldRegenDelay" }, @@ -29628,9 +31752,7 @@ "value": "", "type": "Boolean", "label": "", - "description": "", "group": "Shield", - "extraInformation": [], "hidden": true, "name": "IsShieldJustDamaged" }, @@ -29638,9 +31760,7 @@ "value": "", "type": "Number", "label": "Damage to shield from the previous incoming damage", - "description": "", "group": "Shield", - "extraInformation": [], "hidden": true, "name": "ShieldDamageTaken" }, @@ -29650,7 +31770,6 @@ "label": "Flat damage reduction from armor", "description": "Incoming damages are reduced by this value.", "group": "Armor", - "extraInformation": [], "advanced": true, "name": "FlatDamageReduction" }, @@ -29658,9 +31777,7 @@ "value": "0", "type": "Number", "label": "Percentage damage reduction from armor (between 0 and 1)", - "description": "", "group": "Armor", - "extraInformation": [], "advanced": true, "name": "PercentDamageReduction" } @@ -29800,6 +31917,5 @@ "windowMask": false } } - ], - "externalSourceFiles": [] + ] } \ No newline at end of file From 855bdeb0eb3dbffb748b12ba17d2ddb6881c532c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 15 Jul 2025 18:12:44 +0200 Subject: [PATCH 2/9] Use a variant --- examples/space-asteroids/space-asteroids.json | 1133 ++++++++++------- 1 file changed, 705 insertions(+), 428 deletions(-) diff --git a/examples/space-asteroids/space-asteroids.json b/examples/space-asteroids/space-asteroids.json index 4c4e02cff..74ac131b0 100644 --- a/examples/space-asteroids/space-asteroids.json +++ b/examples/space-asteroids/space-asteroids.json @@ -1686,7 +1686,7 @@ "assetStoreId": "", "name": "LifeBar", "type": "TiledUnitsBar::TiledUnitsBar", - "variant": "", + "variant": "Life bar", "variables": [], "effects": [], "behaviors": [ @@ -4285,6 +4285,14 @@ } ], "behaviorsSharedData": [ + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, + { + "name": "Effect", + "type": "EffectCapability::EffectBehavior" + }, { "name": "FireBullet", "type": "FireBullet::FireBullet" @@ -4293,6 +4301,10 @@ "name": "Flash", "type": "Flash::Flash" }, + { + "name": "Flippable", + "type": "FlippableCapability::FlippableBehavior" + }, { "name": "Health", "type": "Health::Health" @@ -4301,6 +4313,10 @@ "name": "MultitouchButton", "type": "SpriteMultitouchJoystick::MultitouchButton" }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, { "name": "Physics2", "type": "Physics2::Physics2Behavior", @@ -4309,9 +4325,21 @@ "scaleX": 100, "scaleY": 100 }, + { + "name": "Resizable", + "type": "ResizableCapability::ResizableBehavior" + }, + { + "name": "Scale", + "type": "ScalableCapability::ScalableBehavior" + }, { "name": "ScreenWrapPhysics", "type": "ScreenWrap::ScreenWrapPhysics" + }, + { + "name": "Text", + "type": "TextContainerCapability::TextContainerBehavior" } ] } @@ -9274,13 +9302,13 @@ "category": "User interface", "extensionNamespace": "", "fullName": "Resource bar (separated units)", - "gdevelopVersion": "", + "gdevelopVersion": ">=5.5.230", "helpPath": "/objects/resource-bar", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWRvdHMtaG9yaXpvbnRhbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNiwxMkEyLDIgMCAwLDEgMTgsMTBBMiwyIDAgMCwxIDIwLDEyQTIsMiAwIDAsMSAxOCwxNEEyLDIgMCAwLDEgMTYsMTJNMTAsMTJBMiwyIDAgMCwxIDEyLDEwQTIsMiAwIDAsMSAxNCwxMkEyLDIgMCAwLDEgMTIsMTRBMiwyIDAgMCwxIDEwLDEyTTQsMTJBMiwyIDAgMCwxIDYsMTBBMiwyIDAgMCwxIDgsMTJBMiwyIDAgMCwxIDYsMTRBMiwyIDAgMCwxIDQsMTJaIiAvPjwvc3ZnPg==", "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": "2.0.0", "description": [ "A bar that represents a resource in the game (health, mana, ammo, etc).", "", @@ -9305,10 +9333,109 @@ "gqDaZjCfevOOxBYkK6zlhtZnXCg1", "q8ubdigLvIRXLxsJDDTaokO41mc2" ], + "changelog": [ + { + "version": "2.0.0", + "breaking": "- Resource bars now use variants, you will have to make some adjustments to existing resource bars in your project by following this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/)." + } + ], "dependencies": [], "globalVariables": [], "sceneVariables": [], - "eventsFunctions": [], + "eventsFunctions": [ + { + "description": "left anchor", + "fullName": "Left anchor", + "functionType": "ExpressionAndCondition", + "name": "LeftEdgeAnchor", + "private": true, + "sentence": "Left anchor of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._TiledUnitsBarExtension = gdjs._TiledUnitsBarExtension || {", + " anchors: [\"None\", \"Min\", \"Max\", \"Proportional\", \"Center\"]", + "}", + "const { anchors } = gdjs._TiledUnitsBarExtension;", + "", + "const object = objects[0];", + "/** @type {gdjs.AnchorRuntimeBehavior} */", + "const anchor = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Anchor\"));", + "eventsFunctionContext.returnValue = anchors[anchor._leftEdgeAnchor] || \"None\";", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "supplementaryInformation": "[\"None\",\"Min\",\"Max\",\"Proportional\",\"Center\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Anchor", + "name": "Anchor", + "supplementaryInformation": "AnchorBehavior::AnchorBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "left anchor", + "fullName": "Right anchor", + "functionType": "ExpressionAndCondition", + "name": "RightEdgeAnchor", + "private": true, + "sentence": "Right anchor of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._TiledUnitsBarExtension = gdjs._TiledUnitsBarExtension || {", + " anchors: [\"None\", \"Min\", \"Max\", \"Proportional\", \"Center\"]", + "}", + "const { anchors } = gdjs._TiledUnitsBarExtension;", + "", + "const object = objects[0];", + "/** @type {gdjs.AnchorRuntimeBehavior} */", + "const anchor = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Anchor\"));", + "eventsFunctionContext.returnValue = anchors[anchor._rightEdgeAnchor] || \"None\";", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "supplementaryInformation": "[\"None\",\"Min\",\"Max\",\"Proportional\",\"Center\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Anchor", + "name": "Anchor", + "supplementaryInformation": "AnchorBehavior::AnchorBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], "eventsBasedBehaviors": [ { "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", @@ -9396,7 +9523,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Value" + "CurrentValue" ] } ] @@ -9433,11 +9560,10 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentValue", "=", "clamp(Value, 0, MaxValue)" ] @@ -9449,11 +9575,10 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "Value", "<", "PreviousHighValue" ] @@ -9476,11 +9601,10 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "Value", ">=", "PreviousHighValue" ] @@ -9569,11 +9693,10 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyMaxValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxValue", "=", "Value" ] @@ -9608,11 +9731,10 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentValue", "=", "0" ] @@ -9657,11 +9779,10 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentValue", "=", "MaxValue" ] @@ -9747,13 +9868,12 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyPreviousHighValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PreviousHighValue", "=", - "Value" + "CurrentValue" ] } ] @@ -9828,11 +9948,10 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyPreviousHighValueDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PreviousHighValueDuration", "=", "Value" ] @@ -9873,7 +9992,7 @@ "Object", "Behavior", "!=", - "Value", + "CurrentValue", "" ] }, @@ -9922,7 +10041,7 @@ "value": "1", "type": "Number", "label": "Value", - "name": "Value" + "name": "CurrentValue" }, { "value": "3", @@ -9949,8 +10068,8 @@ ], "eventsBasedObjects": [ { - "areaMaxX": 64, - "areaMaxY": 64, + "areaMaxX": 96, + "areaMaxY": 32, "areaMaxZ": 64, "areaMinX": 0, "areaMinY": 0, @@ -9958,7 +10077,8 @@ "defaultName": "ResourceBar", "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", "fullName": "Resource bar (separated units)", - "isUsingLegacyInstancesRenderer": true, + "isInnerAreaFollowingParentSize": true, + "isUsingLegacyInstancesRenderer": false, "name": "TiledUnitsBar", "objects": [ { @@ -9971,6 +10091,16 @@ "variables": [], "effects": [], "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + }, { "name": "ResourceBar", "type": "TiledUnitsBar::ResourceBar", @@ -9989,7 +10119,18 @@ "width": 32, "variables": [], "effects": [], - "behaviors": [] + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + } + ] }, { "assetStoreId": "", @@ -9999,13 +10140,24 @@ "name": "Background", "rightMargin": 0, "texture": "", - "tiled": true, + "tiled": false, "topMargin": 0, "type": "PanelSpriteObject::PanelSprite", "width": 32, "variables": [], "effects": [], - "behaviors": [] + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] } ], "objectsFolderStructure": { @@ -10053,7 +10205,58 @@ "effects": [] } ], - "instances": [], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 32, + "keepRatio": true, + "layer": "", + "name": "Background", + "persistentUuid": "b13e773c-6941-4f67-b198-030f29c8b679", + "width": 96, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 26, + "keepRatio": true, + "layer": "", + "name": "Bar", + "persistentUuid": "caf6fdad-096d-4247-b23b-6cc1a89ce9f8", + "width": 90, + "x": 3, + "y": 3, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 26, + "layer": "", + "name": "FillBar", + "persistentUuid": "4b784a8f-dbae-4d8b-a287-628642416d10", + "width": 60, + "x": 3, + "y": 3, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], "eventsFunctions": [ { "fullName": "", @@ -10079,16 +10282,33 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::SetPropertyPreviousInitialValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", + "PreviousInitialValue", "=", "InitialValue" ] } ] - }, + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -10099,119 +10319,18 @@ "textG": 0, "textR": 0 }, - "comment": "Create the child-object instances." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "Background", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "Bar", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "FillBar", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Background", - "=", - "1" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Bar", - "=", - "2" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "FillBar", - "=", - "3" - ] - } - ] + "comment": "Pass the configuration to the behavior (MaxValue must be set before Value)." }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": true, - "value": "TiledUnitsBar::TiledUnitsBar::PropertyShowBackground" + "value": "BuiltinCommonInstructions::Once" }, - "parameters": [ - "Object" - ] + "parameters": [] } ], - "actions": [ - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Background" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Pass the configuration to the behavior (MaxValue must be set before Value)." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], "actions": [ { "type": { @@ -10260,11 +10379,13 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" + "value": "TiledUnitsBar::TiledUnitsBar::SetUnitWidth" }, "parameters": [ "Object", - "" + "=", + "UnitWidth", + "Object.PropertyMaxValue()" ] }, { @@ -10285,10 +10406,10 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::PropertyInitialValue" + "value": "NumberVariable" }, "parameters": [ - "Object", + "InitialValue", "!=", "PreviousInitialValue" ] @@ -10297,10 +10418,10 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::SetPropertyPreviousInitialValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", + "PreviousInitialValue", "=", "InitialValue" ] @@ -10329,221 +10450,6 @@ ], "objectGroups": [] }, - { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Resize", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Children instances must be resized when the button size change:\n- background is resized to take the full dimensions of the button\n- the bar size is refreshed according to the value\n\nThe scale is set back to 1 because it means that the parent instance has the same dimensions as the union of its children instances." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Width()", - "!=", - "max(Background.BoundingBoxRight(), Bar.BoundingBoxRight()) - min(Background.BoundingBoxLeft(), Bar.BoundingBoxLeft())" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Height()", - "!=", - "max(Background.BoundingBoxBottom(), Bar.BoundingBoxBottom()) - min(Background.BoundingBoxTop(), Bar.BoundingBoxTop())" - ] - } - ] - } - ], - "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)" - ] - }, - { - "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" - }, - "parameters": [ - "Object", - "" - ] - } - ] - } - ], - "parameters": [] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Center the bar according to the button configuration. This is used in doStepPostEvents when the button is resized.", - "fullName": "", - "functionType": "Action", - "name": "CenterBar", - "private": true, - "sentence": "Center the bar of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetCenter" - }, - "parameters": [ - "Bar", - "=", - "Background.CenterX()", - "=", - "Background.CenterY()" - ] - }, - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Bar", - "+", - "0" - ] - }, - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Bar", - "+", - "0" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "MettreXY" - }, - "parameters": [ - "FillBar", - "=", - "Bar.X()", - "=", - "Bar.Y()" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", - "type": "object" - } - ], - "objectGroups": [] - }, { "description": "the value of the object.", "fullName": "Value", @@ -10587,6 +10493,18 @@ "name": "SetValue", "sentence": "", "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The value is clamped by the behavior. This is why Object.Value() is used instead of Value directly." + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], @@ -10611,7 +10529,7 @@ "FillBar", "Resizable", "=", - "Value * Object.PropertyUnitWidth()" + "Object.Value() * UnitWidth" ] } ] @@ -10650,7 +10568,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "FillBar.ResourceBar::PropertyMaxValue()" + "FillBar.ResourceBar::MaxValue()" ] } ] @@ -10694,21 +10612,21 @@ }, { "type": { - "value": "ResizableCapability::ResizableBehavior::SetWidth" + "value": "TiledUnitsBar::TiledUnitsBar::UpdateBarWidth" }, "parameters": [ - "Bar", - "Resizable", - "=", - "Value * Object.PropertyUnitWidth()" + "Object", + "" ] }, { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" + "value": "TiledUnitsBar::TiledUnitsBar::SetValue" }, "parameters": [ "Object", + "=", + "Object.Value()", "" ] } @@ -10818,18 +10736,258 @@ } ], "objectGroups": [] + }, + { + "description": "the unit width of the object. How much pixels to show for a value of 1.", + "fullName": "Unit width", + "functionType": "ExpressionAndCondition", + "group": "Resource bar configuration", + "name": "UnitWidth", + "private": true, + "sentence": "the unit width", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "UnitWidth" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "UnitWidth", + "name": "SetUnitWidth", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "UnitWidth", + "=", + "Value" + ] + }, + { + "type": { + "value": "TiledUnitsBar::TiledUnitsBar::UpdateBarWidth" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Update the bar width.", + "fullName": "Bar width", + "functionType": "Action", + "name": "UpdateBarWidth", + "private": true, + "sentence": "Update the bar width of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "NewWidth", + "=", + "Object.MaxValue() * UnitWidth" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TiledUnitsBar::LeftEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Center\"", + "Bar", + "Anchor", + "" + ] + }, + { + "type": { + "value": "TiledUnitsBar::RightEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Center\"", + "Bar", + "Anchor", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Bar", + "-", + "(NewWidth - Bar.Width()) / 2" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TiledUnitsBar::LeftEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + }, + { + "type": { + "value": "TiledUnitsBar::RightEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Bar", + "-", + "NewWidth - Bar.Width()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "Bar", + "Resizable", + "=", + "NewWidth" + ] + }, + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "FillBar", + "=", + "Bar.X()" + ] + } + ] + } + ], + "variables": [ + { + "name": "NewWidth", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "type": "object" + } + ], + "objectGroups": [] } ], "propertyDescriptors": [ { "value": "3", "type": "Number", + "unit": "Dimensionless", "label": "Maximum value", "name": "MaxValue" }, { "value": "3", "type": "Number", + "unit": "Dimensionless", "label": "Initial value", "name": "InitialValue" }, @@ -10844,64 +11002,183 @@ { "value": "24", "type": "Number", + "unit": "Pixel", "label": "Unit width", "description": "How much pixels to show for a value of 1.", "name": "UnitWidth" - }, - { - "value": "true", - "type": "Boolean", - "label": "Show the background", - "extraInformation": [ - "Background" - ], - "name": "ShowBackground" - }, - { - "value": "0", - "type": "Number", - "label": "Bar left margin", - "extraInformation": [ - "FillBar", - "Bar" - ], - "name": "BarLeftPadding" - }, - { - "value": "0", - "type": "Number", - "label": "Bar right margin", - "extraInformation": [ - "FillBar", - "Bar" - ], - "name": "BarRightPadding" - }, - { - "value": "Center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "extraInformation": [ - "FillBar", - "Bar" - ], - "hidden": true, - "name": "BarVerticalAnchorOrigin" - }, - { - "value": "Center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "extraInformation": [ - "Background" - ], - "hidden": true, - "name": "BarVerticalAnchorTarget" } ], - "variants": [] + "variants": [ + { + "areaMaxX": 108, + "areaMaxY": 26, + "areaMaxZ": 1, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "Life bar", + "objects": [ + { + "assetStoreId": "", + "height": 32, + "name": "FillBar", + "texture": "playerLife3_red.png", + "type": "TiledSpriteObject::TiledSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "leftEdgeAnchor": 1, + "name": "Anchor", + "rightEdgeAnchor": 2, + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "ResourceBar", + "type": "TiledUnitsBar::ResourceBar", + "Value": 1, + "MaxValue": 3, + "PreviousValue": 0 + } + ] + }, + { + "assetStoreId": "", + "height": 32, + "name": "Bar", + "texture": "assets\\playerLife3_empty.png", + "type": "TiledSpriteObject::TiledSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "leftEdgeAnchor": 1, + "name": "Anchor", + "rightEdgeAnchor": 2, + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Background", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "FillBar" + }, + { + "objectName": "Bar" + }, + { + "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": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 26, + "keepRatio": true, + "layer": "", + "name": "Bar", + "persistentUuid": "caf6fdad-096d-4247-b23b-6cc1a89ce9f8", + "width": 108, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 26, + "layer": "", + "name": "FillBar", + "persistentUuid": "4b784a8f-dbae-4d8b-a287-628642416d10", + "width": 108, + "x": 0, + "y": 0, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ] + } + ] } ] }, From ba2712f578897367b02789190785c48d1be9fc02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 15 Jul 2025 18:14:32 +0200 Subject: [PATCH 3/9] Update extensions --- .../geometry-monster/geometry-monster.json | 2717 ++++++++--------- 1 file changed, 1278 insertions(+), 1439 deletions(-) diff --git a/examples/geometry-monster/geometry-monster.json b/examples/geometry-monster/geometry-monster.json index a74e210d8..04e954899 100755 --- a/examples/geometry-monster/geometry-monster.json +++ b/examples/geometry-monster/geometry-monster.json @@ -1,9 +1,9 @@ { "firstLayout": "", "gdVersion": { - "build": 99, - "major": 4, - "minor": 0, + "build": 236, + "major": 5, + "minor": 5, "revision": 0 }, "properties": { @@ -18,7 +18,6 @@ "scaleMode": "linear", "sizeOnStartupMode": "", "templateSlug": "", - "useExternalSourceFiles": false, "version": "1.0.0", "name": "Geometry Monster", "description": "", @@ -67,7 +66,6 @@ "resources": { "resources": [ { - "alwaysLoaded": false, "file": "monster-idle0.png", "kind": "image", "metadata": "", @@ -76,7 +74,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "monster-idle1.png", "kind": "image", "metadata": "", @@ -85,7 +82,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "monster-idle2.png", "kind": "image", "metadata": "", @@ -94,7 +90,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "monster-idle3.png", "kind": "image", "metadata": "", @@ -103,7 +98,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "monster-idle4.png", "kind": "image", "metadata": "", @@ -112,7 +106,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "monster-idle5.png", "kind": "image", "metadata": "", @@ -121,7 +114,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "monster-idle6.png", "kind": "image", "metadata": "", @@ -130,7 +122,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "monster-idle7.png", "kind": "image", "metadata": "", @@ -139,7 +130,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "monster-idle8.png", "kind": "image", "metadata": "", @@ -148,7 +138,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "monster-idle9.png", "kind": "image", "metadata": "", @@ -157,7 +146,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "monster-idle10.png", "kind": "image", "metadata": "", @@ -166,7 +154,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "monster-idle11.png", "kind": "image", "metadata": "", @@ -175,7 +162,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "geometry1.png", "kind": "image", "metadata": "", @@ -184,7 +170,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "geometry2.png", "kind": "image", "metadata": "", @@ -193,7 +178,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "geometry3.png", "kind": "image", "metadata": "", @@ -202,7 +186,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "geometry4.png", "kind": "image", "metadata": "", @@ -221,7 +204,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "bomb1.png", "kind": "image", "metadata": "", @@ -230,7 +212,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "bomb2.png", "kind": "image", "metadata": "", @@ -249,7 +230,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "life-3.png", "kind": "image", "metadata": "", @@ -258,7 +238,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "life-0.png", "kind": "image", "metadata": "", @@ -267,7 +246,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "game-over.png", "kind": "image", "metadata": "", @@ -276,7 +254,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "btn-try-again-normal.png", "kind": "image", "metadata": "", @@ -285,7 +262,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "btn-start-hover.png", "kind": "image", "metadata": "", @@ -294,7 +270,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "btn-try-again-hover.png", "kind": "image", "metadata": "", @@ -303,7 +278,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "btn-try-again-pressed.png", "kind": "image", "metadata": "", @@ -312,7 +286,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "btn-main-menu-normal.png", "kind": "image", "metadata": "", @@ -321,7 +294,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "btn-main-menu-hover.png", "kind": "image", "metadata": "", @@ -330,7 +302,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "btn-main-menu-pressed.png", "kind": "image", "metadata": "", @@ -339,7 +310,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "monster-killed1.png", "kind": "image", "metadata": "", @@ -348,7 +318,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "game-title.png", "kind": "image", "metadata": "", @@ -357,7 +326,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "btn-start-normal.png", "kind": "image", "metadata": "", @@ -366,7 +334,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "btn-start-pressed.png", "kind": "image", "metadata": "", @@ -375,7 +342,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Yellow Button_Hovered.png", "kind": "image", "metadata": "", @@ -388,7 +354,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Yellow Button_Idle.png", "kind": "image", "metadata": "", @@ -401,7 +366,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Yellow Button_Pressed.png", "kind": "image", "metadata": "", @@ -556,6 +520,7 @@ "assetStoreId": "", "name": "StartButton", "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "", "variables": [], "effects": [], "behaviors": [], @@ -615,6 +580,7 @@ "text": "", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 20, "color": "0;0;0" } @@ -1303,6 +1269,7 @@ "text": "Score:", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 30, "color": "248;231;28" } @@ -1311,6 +1278,7 @@ "assetStoreId": "", "name": "Life", "type": "TiledUnitsBar::TiledUnitsBar", + "variant": "", "variables": [], "effects": [], "behaviors": [], @@ -1421,6 +1389,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 255, "particleBlue2": 255, + "particleColor1": "255;255;255", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": 30, "particleGreen1": 255, @@ -1466,6 +1436,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 255, "particleBlue2": 255, + "particleColor1": "255;255;255", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": 30, "particleGreen1": 255, @@ -1511,6 +1483,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 255, "particleBlue2": 255, + "particleColor1": "255;255;255", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": 30, "particleGreen1": 255, @@ -1556,6 +1530,8 @@ "particleAngleRandomness2": 0, "particleBlue1": 255, "particleBlue2": 255, + "particleColor1": "255;255;255", + "particleColor2": "255;255;255", "particleGravityX": 0, "particleGravityY": 30, "particleGreen1": 255, @@ -2799,6 +2775,7 @@ "text": "Score", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 60, "color": "248;231;28" } @@ -2830,6 +2807,7 @@ "assetStoreId": "", "name": "RestartButton", "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "", "variables": [], "effects": [], "behaviors": [], @@ -2889,6 +2867,7 @@ "text": "", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 20, "color": "0;0;0" } @@ -2909,6 +2888,7 @@ "assetStoreId": "", "name": "MainMenuButton", "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "", "variables": [], "effects": [], "behaviors": [], @@ -2968,6 +2948,7 @@ "text": "", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 20, "color": "0;0;0" } @@ -2988,6 +2969,7 @@ "assetStoreId": "", "name": "ScoresButton", "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "", "variables": [], "effects": [], "behaviors": [], @@ -3044,6 +3026,7 @@ "text": "Text", "font": "", "textAlignment": "", + "verticalTextAlignment": "top", "characterSize": 20, "color": "0;0;0" } @@ -3105,6 +3088,7 @@ "assetStoreId": "615de0316452630b9f4f6a39decc82e2449b82c1afd1ff24d6470dad2922177b", "name": "SubmitButton", "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "", "variables": [], "effects": [], "behaviors": [], @@ -3168,6 +3152,7 @@ "text": "🡲", "font": "", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 60, "color": "100;43;31" } @@ -3743,6 +3728,7 @@ "category": "User interface", "extensionNamespace": "", "fullName": "Resource bar (separated units)", + "gdevelopVersion": "", "helpPath": "/objects/resource-bar", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWRvdHMtaG9yaXpvbnRhbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNiwxMkEyLDIgMCAwLDEgMTgsMTBBMiwyIDAgMCwxIDIwLDEyQTIsMiAwIDAsMSAxOCwxNEEyLDIgMCAwLDEgMTYsMTJNMTAsMTJBMiwyIDAgMCwxIDEyLDEwQTIsMiAwIDAsMSAxNCwxMkEyLDIgMCAwLDEgMTIsMTRBMiwyIDAgMCwxIDEwLDEyTTQsMTJBMiwyIDAgMCwxIDYsMTBBMiwyIDAgMCwxIDgsMTJBMiwyIDAgMCwxIDYsMTRBMiwyIDAgMCwxIDQsMTJaIiAvPjwvc3ZnPg==", "name": "TiledUnitsBar", @@ -4390,27 +4376,18 @@ "value": "1", "type": "Number", "label": "Value", - "description": "", - "group": "", - "extraInformation": [], "name": "Value" }, { "value": "3", "type": "Number", "label": "Maximum value", - "description": "", - "group": "", - "extraInformation": [], "name": "MaxValue" }, { "value": "", "type": "Number", "label": "Previous high value", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "PreviousHighValue" }, @@ -4418,9 +4395,6 @@ "value": "1", "type": "Number", "label": "Previous high value conservation duration (in seconds)", - "description": "", - "group": "", - "extraInformation": [], "name": "PreviousHighValueDuration" } ], @@ -4429,10 +4403,111 @@ ], "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 (separated units)", + "isUsingLegacyInstancesRenderer": true, "name": "TiledUnitsBar", + "objects": [ + { + "assetStoreId": "", + "height": 32, + "name": "FillBar", + "texture": "", + "type": "TiledSpriteObject::TiledSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "ResourceBar", + "type": "TiledUnitsBar::ResourceBar", + "Value": 1, + "MaxValue": 3, + "PreviousValue": 0 + } + ] + }, + { + "assetStoreId": "", + "height": 32, + "name": "Bar", + "texture": "", + "type": "TiledSpriteObject::TiledSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [] + }, + { + "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": "FillBar" + }, + { + "objectName": "Bar" + }, + { + "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": [], "eventsFunctions": [ { "fullName": "", @@ -5204,18 +5279,12 @@ "value": "3", "type": "Number", "label": "Maximum value", - "description": "", - "group": "", - "extraInformation": [], "name": "MaxValue" }, { "value": "3", "type": "Number", "label": "Initial value", - "description": "", - "group": "", - "extraInformation": [], "name": "InitialValue" }, { @@ -5223,8 +5292,6 @@ "type": "Number", "label": "", "description": "It's used to detect a change at hot reload.", - "group": "", - "extraInformation": [], "hidden": true, "name": "PreviousInitialValue" }, @@ -5233,16 +5300,12 @@ "type": "Number", "label": "Unit width", "description": "How much pixels to show for a value of 1.", - "group": "", - "extraInformation": [], "name": "UnitWidth" }, { "value": "true", "type": "Boolean", "label": "Show the background", - "description": "", - "group": "", "extraInformation": [ "Background" ], @@ -5252,8 +5315,6 @@ "value": "0", "type": "Number", "label": "Bar left margin", - "description": "", - "group": "", "extraInformation": [ "FillBar", "Bar" @@ -5264,8 +5325,6 @@ "value": "0", "type": "Number", "label": "Bar right margin", - "description": "", - "group": "", "extraInformation": [ "FillBar", "Bar" @@ -5277,7 +5336,6 @@ "type": "String", "label": "", "description": "Only used by the scene editor.", - "group": "", "extraInformation": [ "FillBar", "Bar" @@ -5290,7 +5348,6 @@ "type": "String", "label": "", "description": "Only used by the scene editor.", - "group": "", "extraInformation": [ "Background" ], @@ -5298,68 +5355,7 @@ "name": "BarVerticalAnchorTarget" } ], - "objects": [ - { - "assetStoreId": "", - "height": 32, - "name": "FillBar", - "texture": "", - "type": "TiledSpriteObject::TiledSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "ResourceBar", - "type": "TiledUnitsBar::ResourceBar", - "Value": 1, - "MaxValue": 3, - "PreviousValue": 0 - } - ] - }, - { - "assetStoreId": "", - "height": 32, - "name": "Bar", - "texture": "", - "type": "TiledSpriteObject::TiledSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [] - }, - { - "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": "FillBar" - }, - { - "objectName": "Bar" - }, - { - "objectName": "Background" - } - ] - } + "variants": [] } ] }, @@ -5368,18 +5364,22 @@ "category": "Movement", "extensionNamespace": "", "fullName": "Ellipse movement", + "gdevelopVersion": ">=5.5.222", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXNpbmUtd2F2ZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNi41LDIxQzEzLjUsMjEgMTIuMzEsMTYuNzYgMTEuMDUsMTIuMjhDMTAuMTQsOS4wNCA5LDUgNy41LDVDNC4xMSw1IDQsMTEuOTMgNCwxMkgyQzIsMTEuNjMgMi4wNiwzIDcuNSwzQzEwLjUsMyAxMS43MSw3LjI1IDEyLjk3LDExLjc0QzEzLjgzLDE0LjggMTUsMTkgMTYuNSwxOUMxOS45NCwxOSAyMC4wMywxMi4wNyAyMC4wMywxMkgyMi4wM0MyMi4wMywxMi4zNyAyMS45NywyMSAxNi41LDIxWiIgLz48L3N2Zz4=", "name": "EllipseMovement", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/sine-wave.svg", "shortDescription": "Move objects on ellipses or smoothly back and forth in one direction.", - "version": "1.0.2", + "version": "1.1.0", "description": [ "It allows objects to move:", "- on an ellipsis or arcs", "- smoothly vertically or horizontally (by setting one radius to 0)", "- on a sine wave (by adding a force)", "", + "Instances will start their movement from their initial position on the scene.", + "The center position will be decided according to the \"initial direction\" angle and the radius.", + "", "It can be used for:", "- Making objects float, such as powerups or coins", "- Moving platforms", @@ -5428,22 +5428,20 @@ "actions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyOldX" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "OldX", "=", "Object.X()" ] }, { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyOldY" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "OldY", "=", "Object.Y()" ] @@ -5467,22 +5465,22 @@ "conditions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::PropertyInitialTurningLeft" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "InitialTurningLeft", + "True", + "" ] } ], "actions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "LoopDuration", "*", "-1" ] @@ -5494,11 +5492,10 @@ "conditions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "LoopDuration", "<", "0" ] @@ -5507,13 +5504,12 @@ "actions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MovementAngle", "=", - "Object.Behavior::PropertyInitialDirectionAngle() + 90" + "InitialDirectionAngle + 90" ] } ] @@ -5523,11 +5519,10 @@ "conditions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "LoopDuration", ">=", "0" ] @@ -5536,13 +5531,12 @@ "actions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MovementAngle", "=", - "Object.Behavior::PropertyInitialDirectionAngle() - 90" + "InitialDirectionAngle - 90" ] } ] @@ -5553,22 +5547,20 @@ "actions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyCenterX" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CenterX", "=", "Object.X() - Object.Behavior::DeltaX()" ] }, { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyCenterY" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CenterY", "=", "Object.Y() - Object.Behavior::DeltaY()" ] @@ -5615,24 +5607,22 @@ "actions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyCenterX" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CenterX", "+", - "Object.X() - Object.Behavior::PropertyOldX()" + "Object.X() - OldX" ] }, { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyCenterY" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CenterY", "+", - "Object.Y() - Object.Behavior::PropertyOldY()" + "Object.Y() - OldY" ] } ] @@ -5654,11 +5644,10 @@ "conditions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::PropertyRadiusX" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "RadiusX", "!=", "0" ] @@ -5672,7 +5661,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyCenterX() + Object.Behavior::DeltaX()" + "CenterX + Object.Behavior::DeltaX()" ] } ] @@ -5682,11 +5671,10 @@ "conditions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::PropertyRadiusY" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "RadiusY", "!=", "0" ] @@ -5700,7 +5688,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyCenterY() + Object.Behavior::DeltaY()" + "CenterY + Object.Behavior::DeltaY()" ] } ] @@ -5710,11 +5698,12 @@ "conditions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::PropertyShouldRotate" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "ShouldRotate", + "True", + "" ] } ], @@ -5726,7 +5715,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::DirectionAngle() + Object.Behavior::PropertyRotationOffset()" + "Object.Behavior::DirectionAngle() + RotationOffset" ] } ] @@ -5749,22 +5738,20 @@ "actions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyOldX" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "OldX", "=", "Object.X()" ] }, { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyOldY" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "OldY", "=", "Object.Y()" ] @@ -5811,13 +5798,12 @@ "actions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MovementAngle", "+", - "360 * TimeDelta() / Object.Behavior::PropertyLoopDuration()" + "360 * TimeDelta() / LoopDuration" ] } ] @@ -5851,44 +5837,40 @@ "actions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyCenterX" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CenterX", "=", "2 * Object.X() - Object.Behavior::CenterX()" ] }, { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyCenterY" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CenterY", "=", "2 * Object.Y() - Object.Behavior::CenterY()" ] }, { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MovementAngle", "+", "180" ] }, { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "LoopDuration", "*", "-1" ] @@ -6031,11 +6013,10 @@ "conditions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "LoopDuration", "<", "0" ] @@ -6084,7 +6065,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMovementAngle()" + "MovementAngle" ] } ] @@ -6125,7 +6106,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "abs(Object.Behavior::PropertyLoopDuration())" + "abs(LoopDuration)" ] } ] @@ -6166,7 +6147,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyRadiusX()" + "RadiusX" ] } ] @@ -6207,7 +6188,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyRadiusY()" + "RadiusY" ] } ] @@ -6248,7 +6229,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCenterX()" + "CenterX" ] } ] @@ -6289,7 +6270,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCenterY()" + "CenterY" ] } ] @@ -6327,13 +6308,12 @@ "actions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyRadiusX" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "RadiusX", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6373,13 +6353,12 @@ "actions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyRadiusY" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "RadiusY", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6430,13 +6409,12 @@ "actions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "LoopDuration", "=", - "-GetArgumentAsNumber(\"Value\")" + "-Value" ] } ] @@ -6459,13 +6437,12 @@ "actions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyLoopDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "LoopDuration", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6504,13 +6481,12 @@ "actions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::SetPropertyMovementAngle" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MovementAngle", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6552,7 +6528,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "cos(ToRad(Object.Behavior::PropertyMovementAngle())) * Object.Behavior::PropertyRadiusX()" + "cos(ToRad(MovementAngle)) * RadiusX" ] } ] @@ -6592,7 +6568,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "sin(ToRad(Object.Behavior::PropertyMovementAngle())) * Object.Behavior::PropertyRadiusY()" + "sin(ToRad(MovementAngle)) * RadiusY" ] } ] @@ -6628,11 +6604,10 @@ "conditions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "LoopDuration", "<", "0" ] @@ -6644,7 +6619,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMovementAngle() + 90" + "MovementAngle + 90" ] } ] @@ -6654,11 +6629,10 @@ "conditions": [ { "type": { - "value": "EllipseMovement::EllipseMovement::PropertyLoopDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "LoopDuration", ">=", "0" ] @@ -6670,7 +6644,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMovementAngle() - 90" + "MovementAngle - 90" ] } ] @@ -6701,9 +6675,7 @@ "type": "Number", "unit": "Pixel", "label": "Radius of the movement on X axis", - "description": "", "group": "Ellipse", - "extraInformation": [], "name": "RadiusX" }, { @@ -6711,9 +6683,7 @@ "type": "Number", "unit": "Pixel", "label": "Radius of the movement on Y axis", - "description": "", "group": "Ellipse", - "extraInformation": [], "name": "RadiusY" }, { @@ -6721,18 +6691,14 @@ "type": "Number", "unit": "Second", "label": "Loop duration", - "description": "", "group": "Speed", - "extraInformation": [], "name": "LoopDuration" }, { "value": "", "type": "Boolean", "label": "Turn left", - "description": "", "group": "Speed", - "extraInformation": [], "name": "InitialTurningLeft" }, { @@ -6740,18 +6706,14 @@ "type": "Number", "unit": "DegreeAngle", "label": "Initial direction", - "description": "", "group": "Speed", - "extraInformation": [], "name": "InitialDirectionAngle" }, { "value": "", "type": "Boolean", "label": "Rotate", - "description": "", "group": "Rotation", - "extraInformation": [], "name": "ShouldRotate" }, { @@ -6759,18 +6721,13 @@ "type": "Number", "unit": "DegreeAngle", "label": "Rotation offset", - "description": "", "group": "Rotation", - "extraInformation": [], "name": "RotationOffset" }, { "value": "0", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "CenterX" }, @@ -6778,9 +6735,6 @@ "value": "0", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "CenterY" }, @@ -6788,9 +6742,6 @@ "value": "0", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "MovementAngle" }, @@ -6798,9 +6749,6 @@ "value": "", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "OldX" }, @@ -6808,9 +6756,6 @@ "value": "", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "OldY" } @@ -6825,12 +6770,13 @@ "category": "User interface", "extensionNamespace": "", "fullName": "Panel sprite button", + "gdevelopVersion": ">=5.5.222", "helpPath": "/objects/button", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI5LDIzSDNjLTEuMSwwLTItMC45LTItMlYxMWMwLTEuMSwwLjktMiwyLTJoMjZjMS4xLDAsMiwwLjksMiwydjEwQzMxLDIyLjEsMzAuMSwyMywyOSwyM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMywxOUwxMywxOWMtMS4xLDAtMi0wLjktMi0ydi0yYzAtMS4xLDAuOS0yLDItMmgwYzEuMSwwLDIsMC45LDIsMnYyQzE1LDE4LjEsMTQuMSwxOSwxMywxOXoiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIxOCIgeTE9IjEzIiB4Mj0iMTgiIHkyPSIxOSIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIxIiB5MT0iMTMiIHgyPSIxOCIgeTI9IjE3Ii8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMjEiIHkxPSIxOSIgeDI9IjE5IiB5Mj0iMTYiLz4NCjwvc3ZnPg0K", "name": "PanelSpriteButton", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg", "shortDescription": "A button that can be customized.", - "version": "1.4.4", + "version": "1.5.0", "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.", "", @@ -6891,11 +6837,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Validated\"" ] @@ -6904,11 +6849,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] @@ -6942,12 +6886,12 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyMouseIsInside" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "MouseIsInside", + "False", + "" ] } ] @@ -6957,11 +6901,12 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyShouldCheckHovering" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "ShouldCheckHovering", + "True", + "" ] }, { @@ -6978,12 +6923,12 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyMouseIsInside" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "MouseIsInside", + "True", + "" ] } ] @@ -7006,12 +6951,12 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchIsInside" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "TouchIsInside", + "False", + "" ] } ] @@ -7021,11 +6966,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyTouchId" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "!=", "0" ] @@ -7036,20 +6980,20 @@ }, "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)" ] } ], "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchIsInside" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "TouchIsInside", + "True", + "" ] } ] @@ -7081,11 +7025,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyIndex" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "Index", "=", "0" ] @@ -7107,31 +7050,30 @@ }, "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)" ] } ], "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchIsInside" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "TouchIsInside", + "True", + "" ] } ], @@ -7173,11 +7115,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -7192,11 +7133,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyIndex" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "Index", "+", "1" ] @@ -7225,20 +7165,20 @@ { "type": { "inverted": true, - "value": "PanelSpriteButton::ButtonFSM::PropertyMouseIsInside" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "MouseIsInside", + "True", + "" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Hovered\"" ] @@ -7247,11 +7187,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] @@ -7263,20 +7202,20 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyMouseIsInside" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "MouseIsInside", + "True", + "" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] @@ -7285,11 +7224,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Hovered\"" ] @@ -7302,20 +7240,20 @@ { "type": { "inverted": true, - "value": "PanelSpriteButton::ButtonFSM::PropertyTouchIsInside" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "TouchIsInside", + "True", + "" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -7324,11 +7262,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedOutside\"" ] @@ -7340,20 +7277,20 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyTouchIsInside" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "TouchIsInside", + "True", + "" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedOutside\"" ] @@ -7362,11 +7299,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -7394,18 +7330,17 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", "0" ] @@ -7417,11 +7352,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -7430,11 +7364,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Validated\"" ] @@ -7447,11 +7380,10 @@ { "type": { "inverted": true, - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -7459,11 +7391,10 @@ { "type": { "inverted": true, - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Validated\"" ] @@ -7472,11 +7403,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] @@ -7559,22 +7489,20 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", "0" ] @@ -7609,11 +7537,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] @@ -7658,11 +7585,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Validated\"" ] @@ -7707,11 +7633,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Hovered\"" ] @@ -7756,11 +7681,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Hovered\"" ] @@ -7782,11 +7706,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedOutside\"" ] @@ -7831,11 +7754,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -7880,11 +7802,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedOutside\"" ] @@ -7933,7 +7854,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -7964,8 +7885,6 @@ "type": "Boolean", "label": "", "description": "Should check hovering", - "group": "", - "extraInformation": [], "hidden": true, "name": "ShouldCheckHovering" }, @@ -7973,8 +7892,6 @@ "value": "Idle", "type": "Choice", "label": "State", - "description": "", - "group": "", "extraInformation": [ "Idle", "Hovered", @@ -7989,9 +7906,6 @@ "value": "0", "type": "Number", "label": "Touch id", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TouchId" }, @@ -7999,9 +7913,6 @@ "value": "", "type": "Boolean", "label": "Touch is inside", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TouchIsInside" }, @@ -8009,9 +7920,6 @@ "value": "", "type": "Boolean", "label": "Mouse is inside", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "MouseIsInside" }, @@ -8019,9 +7927,6 @@ "value": "", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "Index" } @@ -8031,10 +7936,176 @@ ], "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", + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Label", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Text", + "font": "", + "textAlignment": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Text", + "font": "", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 20, + "color": "0;0;0" + } + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Idle", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [ + { + "folded": true, + "name": "State", + "type": "string", + "value": "Idle" + } + ], + "effects": [], + "behaviors": [ + { + "name": "ButtonFSM", + "type": "PanelSpriteButton::ButtonFSM", + "ShouldCheckHovering": true + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Hovered", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Pressed", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Label" + }, + { + "objectName": "Idle" + }, + { + "objectName": "Hovered" + }, + { + "objectName": "Pressed" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [], "eventsFunctions": [ { "fullName": "", @@ -8327,10 +8398,10 @@ }, { "type": { - "value": "PanelSpriteButton::PanelSpriteButton::PropertyHoveredFadeOutDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", + "HoveredFadeOutDuration", ">", "0" ] @@ -8358,10 +8429,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::PanelSpriteButton::PropertyHoveredFadeOutDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", + "HoveredFadeOutDuration", "=", "0" ] @@ -8662,66 +8733,83 @@ ] } ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Idle", - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Idle", - "Height", - "=", - "Object.Height()" - ] - }, + "actions": [], + "events": [ { - "type": { - "value": "PanelSpriteButton::Scale" - }, - "parameters": [ - "Object", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Idle.Variable(Width)" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Idle.Variable(Height)" - ] - }, - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" - }, - "parameters": [ - "Object", - "" + "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 + } ] } ] @@ -8988,7 +9076,7 @@ "parameters": [ "Label", "=", - "GetArgumentAsString(\"LabelText\")" + "LabelText" ] }, { @@ -9019,11 +9107,11 @@ "objectGroups": [] }, { - "description": "Return the label text.", + "description": "the label text.", "fullName": "Label text", - "functionType": "StringExpression", + "functionType": "ExpressionAndCondition", "name": "LabelText", - "sentence": "", + "sentence": "the label text", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -9217,10 +9305,12 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"ShouldActivate\"" + "ShouldActivate", + "True", + "" ] } ], @@ -9243,10 +9333,12 @@ { "type": { "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"ShouldActivate\"" + "ShouldActivate", + "True", + "" ] } ], @@ -9327,16 +9419,12 @@ "value": "0", "type": "Number", "label": "Label offset on Y axis when pressed", - "description": "", - "group": "", - "extraInformation": [], "name": "PressedLabelOffsetY" }, { "value": "0", "type": "Number", "label": "Left padding", - "description": "", "group": "Padding", "extraInformation": [ "Label" @@ -9347,7 +9435,6 @@ "value": "0", "type": "Number", "label": "Right padding", - "description": "", "group": "Padding", "extraInformation": [ "Label" @@ -9358,7 +9445,6 @@ "value": "0", "type": "Number", "label": "Top padding", - "description": "", "group": "Padding", "extraInformation": [ "Label" @@ -9369,7 +9455,6 @@ "value": "0", "type": "Number", "label": "Bottom padding", - "description": "", "group": "Padding", "extraInformation": [ "Label" @@ -9380,138 +9465,10 @@ "value": "0.25", "type": "Number", "label": "Hovered fade out duration (in seconds)", - "description": "", - "group": "", - "extraInformation": [], "name": "HoveredFadeOutDuration" } ], - "objects": [ - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "Label", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [], - "string": "Text", - "font": "", - "textAlignment": "", - "characterSize": 20, - "color": { - "b": 0, - "g": 0, - "r": 0 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Text", - "font": "", - "textAlignment": "", - "characterSize": 20, - "color": "0;0;0" - } - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Idle", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [ - { - "folded": true, - "name": "State", - "type": "string", - "value": "Idle" - } - ], - "effects": [], - "behaviors": [ - { - "name": "ButtonFSM", - "type": "PanelSpriteButton::ButtonFSM", - "ShouldCheckHovering": true - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Hovered", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Pressed", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Label" - }, - { - "objectName": "Idle" - }, - { - "objectName": "Hovered" - }, - { - "objectName": "Pressed" - } - ] - } + "variants": [] } ] }, @@ -9520,12 +9477,13 @@ "category": "Movement", "extensionNamespace": "", "fullName": "Stay On Screen", + "gdevelopVersion": ">=5.5.222", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLW1vbml0b3Itc2NyZWVuc2hvdCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik05LDZINVYxMEg3VjhIOU0xOSwxMEgxN1YxMkgxNVYxNEgxOU0yMSwxNkgzVjRIMjFNMjEsMkgzQzEuODksMiAxLDIuODkgMSw0VjE2QTIsMiAwIDAsMCAzLDE4SDEwVjIwSDhWMjJIMTZWMjBIMTRWMThIMjFBMiwyIDAgMCwwIDIzLDE2VjRDMjMsMi44OSAyMi4xLDIgMjEsMiIgLz48L3N2Zz4=", "name": "StayOnScreen", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/monitor-screenshot.svg", "shortDescription": "Move the object to keep it visible on the screen.", - "version": "1.0.1", + "version": "1.1.0", "description": [ "Force the object to stay visible on the screen by setting back its position inside the viewport of the camera.", "", @@ -9573,7 +9531,7 @@ "parameters": [ "Object", "+", - "max(0, CameraBorderLeft(Object.Layer()) + Object.Behavior::PropertyMarginLeft() - Object.BoundingBoxLeft())\n" + "max(0, CameraBorderLeft(Object.Layer()) + MarginLeft - Object.BoundingBoxLeft())\n" ] }, { @@ -9583,7 +9541,7 @@ "parameters": [ "Object", "+", - "min(0, CameraBorderRight(Object.Layer()) - Object.Behavior::PropertyMarginRight() - Object.BoundingBoxRight())\n" + "min(0, CameraBorderRight(Object.Layer()) - MarginRight - Object.BoundingBoxRight())\n" ] }, { @@ -9593,7 +9551,7 @@ "parameters": [ "Object", "+", - "max(0, CameraBorderTop(Object.Layer()) + Object.Behavior::PropertyMarginTop() - Object.BoundingBoxTop())\n" + "max(0, CameraBorderTop(Object.Layer()) + MarginTop - Object.BoundingBoxTop())\n" ] }, { @@ -9603,7 +9561,7 @@ "parameters": [ "Object", "+", - "min(0, CameraBorderBottom(Object.Layer()) - Object.Behavior::PropertyMarginBottom() - Object.BoundingBoxBottom())\n" + "min(0, CameraBorderBottom(Object.Layer()) - MarginBottom - Object.BoundingBoxBottom())\n" ] } ] @@ -9641,7 +9599,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMarginTop()" + "MarginTop" ] } ] @@ -9678,13 +9636,12 @@ "actions": [ { "type": { - "value": "StayOnScreen::StayOnScreen::SetPropertyMarginTop" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MarginTop", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -9722,7 +9679,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMarginBottom()" + "MarginBottom" ] } ] @@ -9759,13 +9716,12 @@ "actions": [ { "type": { - "value": "StayOnScreen::StayOnScreen::SetPropertyMarginBottom" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MarginBottom", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -9803,7 +9759,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMarginLeft()" + "MarginLeft" ] } ] @@ -9840,13 +9796,12 @@ "actions": [ { "type": { - "value": "StayOnScreen::StayOnScreen::SetPropertyMarginLeft" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MarginLeft", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -9884,7 +9839,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMarginRight()" + "MarginRight" ] } ] @@ -9921,13 +9876,12 @@ "actions": [ { "type": { - "value": "StayOnScreen::StayOnScreen::SetPropertyMarginRight" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MarginRight", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -9955,9 +9909,6 @@ "type": "Number", "unit": "Pixel", "label": "Top margin", - "description": "", - "group": "", - "extraInformation": [], "name": "MarginTop" }, { @@ -9965,9 +9916,6 @@ "type": "Number", "unit": "Pixel", "label": "Bottom margin", - "description": "", - "group": "", - "extraInformation": [], "name": "MarginBottom" }, { @@ -9975,9 +9923,6 @@ "type": "Number", "unit": "Pixel", "label": "Left margin", - "description": "", - "group": "", - "extraInformation": [], "name": "MarginLeft" }, { @@ -9985,9 +9930,6 @@ "type": "Number", "unit": "Pixel", "label": "Right margin", - "description": "", - "group": "", - "extraInformation": [], "name": "MarginRight" } ], @@ -10001,12 +9943,13 @@ "category": "Visual effect", "extensionNamespace": "", "fullName": "Flash object", + "gdevelopVersion": ">=5.5.222", "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.2.0", + "version": "1.4.0", "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).", @@ -10049,6 +9992,7 @@ "fullName": "Color tint applied to an object", "functionType": "ExpressionAndCondition", "name": "ColorTint", + "private": true, "sentence": "Color tint applied to _PARAM1_", "events": [ { @@ -10081,170 +10025,60 @@ }, "parameters": [ { - "description": "Object", - "name": "Object", - "supplementaryInformation": "Sprite", - "type": "objectList" - } - ], - "objectGroups": [] - }, - { - "description": "Check if a color tint is applied to an object.", - "fullName": "Is a color tint applied to an object", - "functionType": "StringExpression", - "name": "IsTinted", - "sentence": "_PARAM1_ is color tinted", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "Flash::ColorTint" - }, - "parameters": [ - "", - "=", - "\"255;255;255\"", - "Object", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "expressionType": { - "type": "color" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "Sprite", - "type": "objectList" - } - ], - "objectGroups": [] - }, - { - "description": "Toggle an object effect.", - "fullName": "Toggle an object effect", - "functionType": "Action", - "name": "ToggleEffect", - "sentence": "Toggle effect _PARAM2_ on _PARAM1_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetObjectVariableAsBoolean" - }, - "parameters": [ - "Object", - "__Flash_EffectToggled", - "False" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "IsEffectEnabled" - }, - "parameters": [ - "Object", - "GetArgumentAsString(\"EffectName\")" - ] - } - ], - "actions": [ - { - "type": { - "value": "EnableEffect" - }, - "parameters": [ - "Object", - "GetArgumentAsString(\"EffectName\")", - "" - ] - }, - { - "type": { - "value": "SetObjectVariableAsBoolean" - }, - "parameters": [ - "Object", - "__Flash_EffectToggled", - "True" - ] - } - ] - }, - { + "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": { - "value": "ObjectVariableAsBoolean" - }, - "parameters": [ - "Object", - "__Flash_EffectToggled", - "False" - ] - }, { "type": { "inverted": true, - "value": "IsEffectEnabled" + "value": "Flash::ColorTint" }, "parameters": [ + "", + "=", + "\"255;255;255\"", "Object", - "GetArgumentAsString(\"EffectName\")" + "" ] } ], "actions": [ { "type": { - "value": "EnableEffect" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "GetArgumentAsString(\"EffectName\")", - "yes" + "True" ] } ] } ], + "expressionType": { + "type": "color" + }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "Sprite", "type": "objectList" - }, - { - "description": "Effect name to toggle", - "name": "EffectName", - "type": "objectEffectName" } ], "objectGroups": [] @@ -10316,7 +10150,7 @@ }, "parameters": [ "Object", - "GetArgumentAsString(\"ColorTint\")" + "ColorTint" ] }, { @@ -10394,6 +10228,7 @@ "fullName": "Toggle object visibility", "functionType": "Action", "name": "ToggleVisibility", + "private": true, "sentence": "Toggle visibility of _PARAM1_", "events": [ { @@ -10509,11 +10344,12 @@ "conditions": [ { "type": { - "value": "Flash::Flash::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -10539,7 +10375,7 @@ "Object", "\"Flash_Visibility_Timer\"", ">", - "Object.Behavior::PropertyHalfPeriodTime()" + "HalfPeriodTime" ] } ], @@ -10582,11 +10418,10 @@ "conditions": [ { "type": { - "value": "Flash::Flash::PropertyFlashDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", ">", "0" ] @@ -10599,7 +10434,7 @@ "Object", "\"Flash_Visibility_Duration_Timer\"", ">", - "Object.Behavior::PropertyFlashDuration()" + "FlashDuration" ] } ], @@ -10672,12 +10507,12 @@ }, { "type": { - "value": "Flash::Flash::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsFlashing", + "True", + "" ] }, { @@ -10706,13 +10541,12 @@ }, { "type": { - "value": "Flash::Flash::SetPropertyFlashDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", "=", - "GetArgumentAsNumber(\"FlashDuration\")" + "NewFlashDuration" ] } ] @@ -10733,7 +10567,7 @@ { "description": "Duration of the flashing, in seconds", "longDescription": "Use \"0\" to keep flashing until stopped.", - "name": "FlashDuration", + "name": "NewFlashDuration", "type": "expression" } ], @@ -10765,11 +10599,12 @@ "conditions": [ { "type": { - "value": "Flash::Flash::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -10850,11 +10685,12 @@ "conditions": [ { "type": { - "value": "Flash::Flash::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -10870,12 +10706,12 @@ }, { "type": { - "value": "Flash::Flash::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsFlashing", + "False", + "" ] }, { @@ -10931,7 +10767,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHalfPeriodTime()" + "HalfPeriodTime" ] } ] @@ -10968,13 +10804,12 @@ "actions": [ { "type": { - "value": "Flash::Flash::SetPropertyHalfPeriodTime" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HalfPeriodTime", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -11003,17 +10838,12 @@ "unit": "Second", "label": "Half period ", "description": "Time that the object is invisible", - "group": "", - "extraInformation": [], "name": "HalfPeriodTime" }, { "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "IsFlashing" }, @@ -11023,8 +10853,6 @@ "unit": "Second", "label": "Flash duration", "description": "Use \"0\" to keep flashing until stopped", - "group": "", - "extraInformation": [], "hidden": true, "name": "FlashDuration" } @@ -11048,11 +10876,12 @@ "conditions": [ { "type": { - "value": "Flash::FlashColor::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -11078,7 +10907,7 @@ "Object", "\"Flash_Color_Timer\"", ">", - "Object.Behavior::PropertyHalfPeriodTime()" + "HalfPeriodTime" ] } ], @@ -11099,7 +10928,7 @@ "parameters": [ "", "Object", - "Object.Behavior::PropertyTintColor()", + "TintColor", "" ] } @@ -11122,11 +10951,10 @@ "conditions": [ { "type": { - "value": "Flash::FlashColor::PropertyFlashDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", ">", "0" ] @@ -11139,7 +10967,7 @@ "Object", "\"Flash_Color_Duration_Timer\"", ">", - "Object.Behavior::PropertyFlashDuration()" + "FlashDuration" ] } ], @@ -11191,11 +11019,12 @@ { "type": { "inverted": true, - "value": "Flash::FlashColor::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -11227,18 +11056,18 @@ "parameters": [ "", "Object", - "GetArgumentAsString(\"ColorTint\")", + "NewColorTint", "" ] }, { "type": { - "value": "Flash::FlashColor::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsFlashing", + "True", + "" ] } ] @@ -11258,24 +11087,22 @@ }, { "type": { - "value": "Flash::FlashColor::SetPropertyTintColor" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "TintColor", "=", - "GetArgumentAsString(\"ColorTint\")" + "NewColorTint" ] }, { "type": { - "value": "Flash::FlashColor::SetPropertyFlashDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", "=", - "GetArgumentAsNumber(\"FlashDuration\")" + "NewFlashDuration" ] } ] @@ -11297,12 +11124,12 @@ { "description": "Duration of the flashing, in seconds", "longDescription": "Use \"0\" to keep flashing until stopped.", - "name": "FlashDuration", + "name": "NewFlashDuration", "type": "expression" }, { "description": "Color tint", - "name": "ColorTint", + "name": "NewColorTint", "type": "color" } ], @@ -11334,11 +11161,12 @@ "conditions": [ { "type": { - "value": "Flash::FlashColor::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -11421,23 +11249,24 @@ "conditions": [ { "type": { - "value": "Flash::FlashColor::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Flash::FlashColor::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsFlashing", + "False", + "" ] }, { @@ -11503,7 +11332,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHalfPeriodTime()" + "HalfPeriodTime" ] } ] @@ -11541,13 +11370,12 @@ "actions": [ { "type": { - "value": "Flash::FlashColor::SetPropertyHalfPeriodTime" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HalfPeriodTime", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -11577,17 +11405,12 @@ "unit": "Second", "label": "Half period", "description": "Time between flashes", - "group": "", - "extraInformation": [], "name": "HalfPeriodTime" }, { "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "IsFlashing" }, @@ -11597,8 +11420,6 @@ "unit": "Second", "label": "Flash duration", "description": "Use \"0\" to keep flashing until stopped", - "group": "", - "extraInformation": [], "hidden": true, "name": "FlashDuration" }, @@ -11606,9 +11427,6 @@ "value": "\"255;255;255\"", "type": "String", "label": "Tint color", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TintColor" } @@ -11619,7 +11437,7 @@ "description": "Flash opacity smoothly (fade) in a repeating loop.", "fullName": "Flash opacity smothly (fade)", "name": "FlashOpacity", - "objectType": "Sprite", + "objectType": "", "eventsFunctions": [ { "fullName": "", @@ -11675,9 +11493,9 @@ "Object", "TweenBehavior", "\"__Flash.ToStartingOpacity\"", - "Object.Behavior::PropertyStartingOpacity()", + "StartingOpacity", "\"easeInOutCubic\"", - "1000 * Object.Behavior::PropertyHalfPeriodTime()", + "1000 * HalfPeriodTime", "" ] }, @@ -11716,9 +11534,9 @@ "Object", "TweenBehavior", "\"__Flash.ToTargetOpacity\"", - "Object.Behavior::PropertyTargetOpacity()", + "TargetOpacity", "\"easeInOutCubic\"", - "1000 * Object.Behavior::PropertyHalfPeriodTime()", + "1000 * HalfPeriodTime", "" ] }, @@ -11751,11 +11569,10 @@ "conditions": [ { "type": { - "value": "Flash::FlashOpacity::PropertyFlashDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", ">", "0" ] @@ -11768,7 +11585,7 @@ "Object", "\"Flash_Opacity_Duration_Timer\"", ">", - "Object.Behavior::PropertyFlashDuration()" + "FlashDuration" ] } ], @@ -11795,7 +11612,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -11820,24 +11636,24 @@ { "type": { "inverted": true, - "value": "Flash::FlashOpacity::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Flash::FlashOpacity::SetPropertyStartingOpacity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "StartingOpacity", "=", - "Object.Opacity()" + "Object.Opacity::Value()" ] }, { @@ -11848,20 +11664,20 @@ "Object", "TweenBehavior", "\"__Flash.ToTargetOpacity\"", - "GetArgumentAsNumber(\"TargetOpacity\")", + "NewTargetOpacity", "\"easeInOutCubic\"", - "1000 * Object.Behavior::PropertyHalfPeriodTime()", + "1000 * HalfPeriodTime", "" ] }, { "type": { - "value": "Flash::FlashOpacity::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsFlashing", + "True", + "" ] } ] @@ -11881,24 +11697,22 @@ }, { "type": { - "value": "Flash::FlashOpacity::SetPropertyFlashDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", "=", - "GetArgumentAsNumber(\"FlashDuration\")" + "NewFlashDuration" ] }, { "type": { - "value": "Flash::FlashOpacity::SetPropertyTargetOpacity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TargetOpacity", "=", - "GetArgumentAsNumber(\"TargetOpacity\")" + "NewTargetOpacity" ] } ] @@ -11908,7 +11722,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -11926,12 +11739,12 @@ { "description": "Duration of the flashing, in seconds", "longDescription": "Use \"0\" to keep flashing until stopped.", - "name": "FlashDuration", + "name": "NewFlashDuration", "type": "expression" }, { "description": "Target opacity", - "name": "TargetOpacity", + "name": "NewTargetOpacity", "type": "expression" } ], @@ -11963,11 +11776,12 @@ "conditions": [ { "type": { - "value": "Flash::FlashColor::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -11987,7 +11801,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -12026,7 +11839,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -12062,12 +11874,12 @@ "actions": [ { "type": { - "value": "Flash::FlashOpacity::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsFlashing", + "False", + "" ] }, { @@ -12101,12 +11913,13 @@ }, { "type": { - "value": "Opacity" + "value": "OpacityCapability::OpacityBehavior::SetValue" }, "parameters": [ "Object", + "Opacity", "=", - "Object.Behavior::PropertyStartingOpacity()" + "StartingOpacity" ] } ] @@ -12116,7 +11929,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -12145,7 +11957,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHalfPeriodTime()" + "HalfPeriodTime" ] } ] @@ -12158,7 +11970,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -12183,13 +11994,12 @@ "actions": [ { "type": { - "value": "Flash::FlashOpacity::SetPropertyHalfPeriodTime" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HalfPeriodTime", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -12199,7 +12009,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -12213,12 +12022,19 @@ } ], "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Opacity capability", + "extraInformation": [ + "OpacityCapability::OpacityBehavior" + ], + "name": "Opacity" + }, { "value": "", "type": "Behavior", "label": "Tween Behavior (required)", - "description": "", - "group": "", "extraInformation": [ "Tween::TweenBehavior" ], @@ -12230,17 +12046,12 @@ "unit": "Second", "label": "Half period", "description": "Time between flashes", - "group": "", - "extraInformation": [], "name": "HalfPeriodTime" }, { "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "IsFlashing" }, @@ -12250,8 +12061,6 @@ "unit": "Second", "label": "Flash duration", "description": "Use \"0\" to keep flashing until stopped", - "group": "", - "extraInformation": [], "hidden": true, "name": "FlashDuration" }, @@ -12261,8 +12070,6 @@ "unit": "Dimensionless", "label": "Target opacity (Range: 0 - 255)", "description": "Opacity will fade between the starting value and a target value", - "group": "", - "extraInformation": [], "hidden": true, "name": "TargetOpacity" }, @@ -12272,8 +12079,6 @@ "unit": "Dimensionless", "label": "Starting opacity", "description": "Opacity will fade between the starting value and a target value", - "group": "", - "extraInformation": [], "hidden": true, "name": "StartingOpacity" } @@ -12284,7 +12089,7 @@ "description": "Make the object flash an effect for a period of time.", "fullName": "Flash effect", "name": "FlashEffect", - "objectType": "Sprite", + "objectType": "", "eventsFunctions": [ { "fullName": "", @@ -12328,7 +12133,7 @@ "Object", "\"Flash_Effect_Timer\"", ">", - "Object.Behavior::PropertyHalfPeriodTime()" + "HalfPeriodTime" ] } ], @@ -12344,12 +12149,12 @@ }, { "type": { - "value": "Flash::ToggleEffect" + "value": "Flash::FlashEffect::ToggleEffect" }, "parameters": [ - "", "Object", - "Object.Behavior::PropertyEffectName()", + "Behavior", + "EffectName", "" ] } @@ -12372,11 +12177,10 @@ "conditions": [ { "type": { - "value": "Flash::FlashEffect::PropertyFlashDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", ">", "0" ] @@ -12389,7 +12193,7 @@ "Object", "\"Flash_Effect_Duration_Timer\"", ">", - "Object.Behavior::PropertyFlashDuration()" + "FlashDuration" ] } ], @@ -12416,7 +12220,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -12462,13 +12265,12 @@ }, { "type": { - "value": "Flash::FlashEffect::PropertyEffectName" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "EffectName", "!=", - "GetArgumentAsString(\"EffectName\")" + "NewEffectName" ] } ], @@ -12507,11 +12309,12 @@ "conditions": [ { "type": { - "value": "IsEffectEnabled" + "value": "EffectCapability::EffectBehavior::IsEffectEnabled" }, "parameters": [ "Object", - "GetArgumentAsString(\"EffectName\")" + "Effect", + "NewEffectName" ] } ], @@ -12534,11 +12337,12 @@ { "type": { "inverted": true, - "value": "IsEffectEnabled" + "value": "EffectCapability::EffectBehavior::IsEffectEnabled" }, "parameters": [ "Object", - "GetArgumentAsString(\"EffectName\")" + "Effect", + "NewEffectName" ] } ], @@ -12561,12 +12365,12 @@ "actions": [ { "type": { - "value": "Flash::ToggleEffect" + "value": "Flash::FlashEffect::ToggleEffect" }, "parameters": [ - "", "Object", - "GetArgumentAsString(\"EffectName\")", + "Behavior", + "NewEffectName", "" ] }, @@ -12581,12 +12385,12 @@ }, { "type": { - "value": "Flash::FlashEffect::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsFlashing", + "True", + "" ] } ] @@ -12608,24 +12412,22 @@ }, { "type": { - "value": "Flash::FlashEffect::SetPropertyFlashDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlashDuration", "=", - "GetArgumentAsNumber(\"FlashDuration\")" + "NewFlashDuration" ] }, { "type": { - "value": "Flash::FlashEffect::SetPropertyEffectName" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "EffectName", "=", - "GetArgumentAsString(\"EffectName\")" + "NewEffectName" ] } ] @@ -12635,7 +12437,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -12647,12 +12448,12 @@ { "description": "Duration of the flashing, in seconds", "longDescription": "Use \"0\" to keep flashing until stopped.", - "name": "FlashDuration", + "name": "NewFlashDuration", "type": "expression" }, { "description": "Name of effect", - "name": "EffectName", + "name": "NewEffectName", "type": "objectEffectName" } ], @@ -12684,11 +12485,12 @@ "conditions": [ { "type": { - "value": "Flash::FlashEffect::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], @@ -12708,7 +12510,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -12747,7 +12548,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -12771,23 +12571,24 @@ "conditions": [ { "type": { - "value": "Flash::FlashColor::PropertyIsFlashing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsFlashing", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Flash::FlashEffect::SetPropertyIsFlashing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsFlashing", + "False", + "" ] }, { @@ -12827,11 +12628,12 @@ "actions": [ { "type": { - "value": "EnableEffect" + "value": "EffectCapability::EffectBehavior::EnableEffect" }, "parameters": [ "Object", - "Object.Behavior::PropertyEffectName()", + "Effect", + "EffectName", "yes" ] } @@ -12854,11 +12656,12 @@ "actions": [ { "type": { - "value": "EnableEffect" + "value": "EffectCapability::EffectBehavior::EnableEffect" }, "parameters": [ "Object", - "Object.Behavior::PropertyEffectName()", + "Effect", + "EffectName", "" ] } @@ -12871,7 +12674,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -12900,7 +12702,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHalfPeriodTime()" + "HalfPeriodTime" ] } ] @@ -12913,7 +12715,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -12938,13 +12739,129 @@ "actions": [ { "type": { - "value": "Flash::FlashEffect::SetPropertyHalfPeriodTime" + "value": "SetNumberVariable" + }, + "parameters": [ + "HalfPeriodTime", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Flash::FlashEffect", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Toggle an object effect.", + "fullName": "Toggle an object effect", + "functionType": "Action", + "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": "EffectCapability::EffectBehavior::IsEffectEnabled" + }, + "parameters": [ + "Object", + "Effect", + "EffectName" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Object", + "Effect", + "EffectName", + "" + ] + }, + { + "type": { + "value": "SetObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_EffectToggled", + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "ObjectVariableAsBoolean" + }, + "parameters": [ + "Object", + "__Flash_EffectToggled", + "False" + ] + }, + { + "type": { + "inverted": true, + "value": "EffectCapability::EffectBehavior::IsEffectEnabled" + }, + "parameters": [ + "Object", + "Effect", + "EffectName" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" }, "parameters": [ "Object", - "Behavior", - "=", - "GetArgumentAsNumber(\"Value\")" + "Effect", + "EffectName", + "yes" ] } ] @@ -12954,7 +12871,6 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "Sprite", "type": "object" }, { @@ -12962,29 +12878,38 @@ "name": "Behavior", "supplementaryInformation": "Flash::FlashEffect", "type": "behavior" + }, + { + "description": "Effect name to toggle", + "name": "EffectName", + "type": "objectEffectName" } ], "objectGroups": [] } ], "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Effect capability", + "extraInformation": [ + "EffectCapability::EffectBehavior" + ], + "name": "Effect" + }, { "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" }, @@ -12994,8 +12919,6 @@ "unit": "Second", "label": "Flash duration", "description": "Use \"0\" to keep flashing until stopped", - "group": "", - "extraInformation": [], "hidden": true, "name": "FlashDuration" }, @@ -13003,9 +12926,6 @@ "value": "", "type": "String", "label": "Name of effect", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "EffectName" } @@ -13020,12 +12940,13 @@ "category": "Game mechanic", "extensionNamespace": "", "fullName": "Health points and damage", + "gdevelopVersion": ">=5.5.222", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWhlYXJ0LWhhbGYtZnVsbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNi41LDVDMTUsNSAxMy41OCw1LjkxIDEzLDcuMlYxNy43NEMxNy4yNSwxMy44NyAyMCwxMS4yIDIwLDguNUMyMCw2LjUgMTguNSw1IDE2LjUsNU0xNi41LDNDMTkuNTgsMyAyMiw1LjQxIDIyLDguNUMyMiwxMi4yNyAxOC42LDE1LjM2IDEzLjQ1LDIwLjAzTDEyLDIxLjM1TDEwLjU1LDIwLjAzQzUuNCwxNS4zNiAyLDEyLjI3IDIsOC41QzIsNS40MSA0LjQyLDMgNy41LDNDOS4yNCwzIDEwLjkxLDMuODEgMTIsNS4wOEMxMy4wOSwzLjgxIDE0Ljc2LDMgMTYuNSwzWiIgLz48L3N2Zz4=", "name": "Health", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/heart-half-full.svg", "shortDescription": "Manage health (life) points, shield and armor.", - "version": "0.3.1", + "version": "0.4.0", "description": [ "Manage health (life) points, shield and armor. ", "", @@ -13098,7 +13019,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyHealth()", + "Health", "" ] } @@ -13161,22 +13082,20 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyHealthRegenRate" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HealthRegenRate", "!=", "0" ] }, { "type": { - "value": "Health::Health::PropertyCurrentHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "<", "Object.Behavior::MaxHealth()" ] @@ -13189,20 +13108,19 @@ "Object", "\"__Health.TimeSinceLastHit\"", ">", - "Object.Behavior::PropertyHealthRegenDelay()" + "HealthRegenDelay" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "+", - "Object.Behavior::PropertyHealthRegenRate() * TimeDelta()" + "HealthRegenRate * TimeDelta()" ] } ], @@ -13224,11 +13142,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", ">", "Object.Behavior::MaxHealth()" ] @@ -13237,13 +13154,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "=", - "Object.Behavior::PropertyMaxHealth()" + "MaxHealth" ] } ] @@ -13268,32 +13184,32 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsHealthJustDamaged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsHealthJustDamaged", + "False", + "" ] }, { "type": { - "value": "Health::Health::SetPropertyIsJustHealed" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsJustHealed", + "False", + "" ] }, { "type": { - "value": "Health::Health::SetPropertyIsJustDodged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsJustDodged", + "False", + "" ] } ] @@ -13339,24 +13255,22 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyShieldRegenRate" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldRegenRate", "!=", "0" ] }, { "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "<", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] }, { @@ -13367,7 +13281,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", ">", - "Object.Behavior::PropertyShieldRegenDelay()" + "ShieldRegenDelay" ] } ], @@ -13378,11 +13292,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", "0" ] @@ -13407,13 +13320,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "+", - "Object.Behavior::PropertyShieldRegenRate() * TimeDelta()" + "ShieldRegenRate * TimeDelta()" ] } ] @@ -13435,26 +13347,24 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", ">", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ] @@ -13497,11 +13407,10 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", "0" ] @@ -13526,12 +13435,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsShieldJustDamaged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsShieldJustDamaged", + "False", + "" ] } ] @@ -13605,13 +13514,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "=", - "GetArgumentAsNumber(\"DamageValue\")" + "DamageValue" ] } ], @@ -13647,28 +13555,27 @@ "parameters": [ "RandomFloatInRange(0,1)", "<", - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsJustDodged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsJustDodged", + "True", + "" ] }, { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "=", "0" ] @@ -13692,19 +13599,20 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"UseArmor\"" + "UseArmor", + "True", + "" ] }, { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", ">", "0" ] @@ -13727,13 +13635,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "=", - "max(0,Object.Behavior::PropertyDamageToBeApplied() - Object.Behavior::PropertyFlatDamageReduction())" + "max(0,DamageToBeApplied - FlatDamageReduction)" ] } ] @@ -13755,22 +13662,20 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyPercentDamageReduction" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PercentDamageReduction", ">", "0" ] }, { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", ">", "0" ] @@ -13779,13 +13684,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "*", - "1 - min(1, Object.Behavior::PropertyPercentDamageReduction())" + "1 - min(1, PercentDamageReduction)" ] } ] @@ -13824,10 +13728,12 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"UseShield\"" + "UseShield", + "True", + "" ] }, { @@ -13842,11 +13748,10 @@ }, { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", ">", "0" ] @@ -13855,12 +13760,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsShieldJustDamaged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsShieldJustDamaged", + "True", + "" ] }, { @@ -13892,46 +13797,42 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "<=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "-", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { "type": { - "value": "Health::Health::SetPropertyShieldDamageTaken" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDamageTaken", "=", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "=", "0" ] @@ -13955,26 +13856,24 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", ">", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldDamageTaken" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDamageTaken", "=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -13984,33 +13883,32 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyBlockExcessDamage" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "BlockExcessDamage", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "=", "0" ] }, { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", "0" ] @@ -14035,33 +13933,32 @@ { "type": { "inverted": true, - "value": "Health::Health::PropertyBlockExcessDamage" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "BlockExcessDamage", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "-", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] }, { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", "0" ] @@ -14089,11 +13986,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", ">", "0" ] @@ -14134,7 +14030,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyCurrentHealth() - Object.Behavior::PropertyDamageToBeApplied()", + "CurrentHealth - DamageToBeApplied", "" ] } @@ -14202,7 +14098,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCurrentHealth()" + "CurrentHealth" ] } ] @@ -14240,13 +14136,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -14268,11 +14163,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyMaxHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxHealth", ">", "0" ] @@ -14281,13 +14175,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "=", - "min(Object.Behavior::PropertyCurrentHealth(), Object.Behavior::PropertyMaxHealth())" + "min(CurrentHealth, MaxHealth)" ] } ] @@ -14333,7 +14226,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -14394,11 +14287,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyMaxHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxHealth", "=", "0" ] @@ -14407,13 +14299,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HealToBeApplied", "=", - "GetArgumentAsNumber(\"HealValue\")" + "HealValue" ] } ] @@ -14435,11 +14326,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyMaxHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxHealth", ">", "0" ] @@ -14447,24 +14337,24 @@ { "type": { "inverted": true, - "value": "Health::Health::PropertyAllowOverHealing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "AllowOverHealing", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HealToBeApplied", "=", - "min(GetArgumentAsNumber(\"HealValue\"),Object.Behavior::PropertyMaxHealth() - Object.Behavior::PropertyCurrentHealth())" + "min(HealValue,MaxHealth - CurrentHealth)" ] } ] @@ -14487,13 +14377,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "+", - "Object.Behavior::PropertyHealToBeApplied()" + "HealToBeApplied" ] } ] @@ -14516,12 +14405,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsJustHealed" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsJustHealed", + "True", + "" ] } ] @@ -14567,7 +14456,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxHealth()" + "MaxHealth" ] } ] @@ -14604,13 +14493,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyMaxHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxHealth", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -14632,11 +14520,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", ">", "Object.Behavior::MaxHealth()" ] @@ -14645,11 +14532,10 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "=", "Object.Behavior::MaxHealth()" ] @@ -14698,7 +14584,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -14742,7 +14628,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenRate()" + "HealthRegenRate" ] } ] @@ -14779,13 +14665,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealthRegenRate" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HealthRegenRate", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -14832,7 +14717,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -14876,7 +14761,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDamageCooldown()" + "DamageCooldown" ] } ] @@ -14913,13 +14798,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageCooldown" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageCooldown", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -14966,7 +14850,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -15010,7 +14894,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenDelay()" + "HealthRegenDelay" ] } ] @@ -15047,13 +14931,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealthRegenDelay" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HealthRegenDelay", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -15100,7 +14983,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -15144,7 +15027,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ] @@ -15181,13 +15064,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyChanceToDodge" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ChanceToDodge", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -15234,7 +15116,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -15278,7 +15160,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFlatDamageReduction()" + "FlatDamageReduction" ] } ] @@ -15315,13 +15197,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyFlatDamageReduction" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlatDamageReduction", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -15368,7 +15249,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -15412,7 +15293,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPercentDamageReduction()" + "PercentDamageReduction" ] } ] @@ -15449,13 +15330,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyPercentDamageReduction" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PercentDamageReduction", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -15502,7 +15382,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -15543,12 +15423,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyAllowOverHealing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "AllowOverHealing", + "False", + "" ] } ] @@ -15558,22 +15438,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Value\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyAllowOverHealing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "AllowOverHealing", + "True", + "" ] } ] @@ -15614,12 +15496,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHitAtLeastOnce" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "HitAtLeastOnce", + "False", + "" ] } ] @@ -15629,22 +15511,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Value\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyHitAtLeastOnce" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "HitAtLeastOnce", + "True", + "" ] } ] @@ -15685,12 +15569,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsHealthJustDamaged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsHealthJustDamaged", + "False", + "" ] } ] @@ -15700,22 +15584,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Value\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsHealthJustDamaged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsHealthJustDamaged", + "True", + "" ] } ] @@ -15861,11 +15747,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyHitAtLeastOnce" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HitAtLeastOnce", + "True", + "" ] } ], @@ -15923,11 +15810,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsHealthJustDamaged" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsHealthJustDamaged", + "True", + "" ] } ], @@ -15985,11 +15873,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsJustHealed" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsJustHealed", + "True", + "" ] } ], @@ -16047,20 +15936,20 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyHitAtLeastOnce" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HitAtLeastOnce", + "True", + "" ] }, { "type": { - "value": "Health::Health::PropertyDamageCooldown" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageCooldown", ">", "0" ] @@ -16073,7 +15962,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", "<", - "Object.Behavior::PropertyDamageCooldown()" + "DamageCooldown" ] } ], @@ -16146,7 +16035,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::PropertyDamageCooldown() - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" + "max(0,DamageCooldown - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" ] } ] @@ -16197,11 +16086,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "<=", "0" ] @@ -16292,7 +16180,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] } ] @@ -16333,7 +16221,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ] @@ -16370,13 +16258,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyMaxShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxShieldPoints", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -16423,7 +16310,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -16471,7 +16358,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -16515,7 +16402,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ] @@ -16552,13 +16439,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -16605,7 +16491,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -16649,7 +16535,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenRate()" + "ShieldRegenRate" ] } ] @@ -16686,13 +16572,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldRegenRate" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldRegenRate", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -16739,7 +16624,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -16783,7 +16668,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenDelay()" + "ShieldRegenDelay" ] } ] @@ -16820,13 +16705,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldRegenDelay" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldRegenDelay", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -16873,7 +16757,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -16917,7 +16801,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDuration()" + "ShieldDuration" ] } ] @@ -16954,13 +16838,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDuration", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -17007,7 +16890,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -17087,13 +16970,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", - "GetArgumentAsNumber(\"ShieldPoints\")" + "ShieldPoints" ] } ] @@ -17103,11 +16985,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyMaxShieldPoints" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxShieldPoints", ">", "0" ] @@ -17116,13 +16997,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", - "min(GetArgumentAsNumber(\"ShieldPoints\"),Object.Behavior::MaxShield())" + "min(ShieldPoints,Object.Behavior::MaxShield())" ] } ] @@ -17132,10 +17012,12 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"RenewShieldDuration\"" + "RenewShieldDuration", + "True", + "" ] } ], @@ -17194,12 +17076,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyBlockExcessDamage" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "BlockExcessDamage", + "False", + "" ] } ] @@ -17209,22 +17091,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Value\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyBlockExcessDamage" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "BlockExcessDamage", + "True", + "" ] } ] @@ -17277,11 +17161,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsShieldJustDamaged" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsShieldJustDamaged", + "True", + "" ] } ], @@ -17339,11 +17224,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsJustDodged" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsJustDodged", + "True", + "" ] } ], @@ -17413,11 +17299,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", ">", "0" ] @@ -17442,11 +17327,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyShieldDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDuration", "<=", "0" ] @@ -17468,11 +17352,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyShieldDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDuration", ">", "0" ] @@ -17485,7 +17368,7 @@ "Object", "\"__Health.ShieldDuration\"", "<", - "Object.Behavior::PropertyShieldDuration()" + "ShieldDuration" ] } ], @@ -17545,11 +17428,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyShieldDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDuration", ">", "0" ] @@ -17561,7 +17443,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::PropertyShieldDuration() - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" + "max(0,ShieldDuration - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" ] } ] @@ -17602,7 +17484,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDamageTaken()" + "ShieldDamageTaken" ] } ] @@ -17643,7 +17525,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealToBeApplied()" + "HealToBeApplied" ] } ] @@ -17673,18 +17555,14 @@ "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" }, @@ -17694,7 +17572,6 @@ "label": "Maximum health", "description": "Use 0 for no maximum.", "group": "Health", - "extraInformation": [], "name": "MaxHealth" }, { @@ -17702,18 +17579,14 @@ "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" }, @@ -17721,9 +17594,7 @@ "value": "", "type": "Boolean", "label": "", - "description": "", "group": "Health", - "extraInformation": [], "hidden": true, "name": "IsHealthJustDamaged" }, @@ -17731,9 +17602,7 @@ "value": "0", "type": "Number", "label": "Damage to health from the previous incoming damage", - "description": "", "group": "Health", - "extraInformation": [], "hidden": true, "name": "DamageToBeApplied" }, @@ -17741,9 +17610,7 @@ "value": "", "type": "Boolean", "label": "", - "description": "", "group": "Health", - "extraInformation": [], "hidden": true, "name": "HitAtLeastOnce" }, @@ -17753,7 +17620,6 @@ "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" }, @@ -17761,9 +17627,7 @@ "value": "", "type": "Boolean", "label": "", - "description": "", "group": "Health", - "extraInformation": [], "hidden": true, "name": "IsJustDodged" }, @@ -17771,9 +17635,7 @@ "value": "0", "type": "Number", "label": "Health points gained from the previous heal", - "description": "", "group": "Health", - "extraInformation": [], "hidden": true, "name": "HealToBeApplied" }, @@ -17781,9 +17643,7 @@ "value": "0", "type": "Number", "label": "Rate of health regeneration (points per second)", - "description": "", "group": "Health regeneration", - "extraInformation": [], "advanced": true, "name": "HealthRegenRate" }, @@ -17794,7 +17654,6 @@ "label": "Health regeneration delay ", "description": "Delay before health regeneration starts after a hit.", "group": "Health regeneration", - "extraInformation": [], "advanced": true, "name": "HealthRegenDelay" }, @@ -17802,9 +17661,6 @@ "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "IsJustHealed" }, @@ -17812,9 +17668,7 @@ "value": "", "type": "Number", "label": "Current shield points", - "description": "", "group": "Shield", - "extraInformation": [], "hidden": true, "name": "CurrentShieldPoints" }, @@ -17824,7 +17678,6 @@ "label": "Maximum shield", "description": "Leave 0 for unlimited.", "group": "Shield", - "extraInformation": [], "advanced": true, "name": "MaxShieldPoints" }, @@ -17835,7 +17688,6 @@ "label": "Duration of shield", "description": "Use 0 to make the shield permanent.", "group": "Shield", - "extraInformation": [], "advanced": true, "name": "ShieldDuration" }, @@ -17843,9 +17695,7 @@ "value": "0", "type": "Number", "label": "Rate of shield regeneration (points per second)", - "description": "", "group": "Shield regeneration", - "extraInformation": [], "advanced": true, "name": "ShieldRegenRate" }, @@ -17853,9 +17703,7 @@ "value": "", "type": "Boolean", "label": "Block excess damage when shield is broken", - "description": "", "group": "Shield", - "extraInformation": [], "advanced": true, "name": "BlockExcessDamage" }, @@ -17866,7 +17714,6 @@ "label": "Shield regeneration delay", "description": "Delay before shield regeneration starts after a hit.", "group": "Shield regeneration", - "extraInformation": [], "advanced": true, "name": "ShieldRegenDelay" }, @@ -17874,9 +17721,7 @@ "value": "", "type": "Boolean", "label": "", - "description": "", "group": "Shield", - "extraInformation": [], "hidden": true, "name": "IsShieldJustDamaged" }, @@ -17884,9 +17729,7 @@ "value": "", "type": "Number", "label": "Damage to shield from the previous incoming damage", - "description": "", "group": "Shield", - "extraInformation": [], "hidden": true, "name": "ShieldDamageTaken" }, @@ -17896,7 +17739,6 @@ "label": "Flat damage reduction from armor", "description": "Incoming damages are reduced by this value.", "group": "Armor", - "extraInformation": [], "advanced": true, "name": "FlatDamageReduction" }, @@ -17904,9 +17746,7 @@ "value": "0", "type": "Number", "label": "Percentage damage reduction from armor (between 0 and 1)", - "description": "", "group": "Armor", - "extraInformation": [], "advanced": true, "name": "PercentDamageReduction" } @@ -17917,6 +17757,5 @@ "eventsBasedObjects": [] } ], - "externalLayouts": [], - "externalSourceFiles": [] + "externalLayouts": [] } \ No newline at end of file From 4c2b884e0142c1fc79f7ec1b683d3c1a41ecc6f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 15 Jul 2025 18:41:41 +0200 Subject: [PATCH 4/9] Use a variant --- .../geometry-monster/geometry-monster.json | 1459 ++++++++++------- 1 file changed, 901 insertions(+), 558 deletions(-) diff --git a/examples/geometry-monster/geometry-monster.json b/examples/geometry-monster/geometry-monster.json index 04e954899..081bc17e9 100755 --- a/examples/geometry-monster/geometry-monster.json +++ b/examples/geometry-monster/geometry-monster.json @@ -668,9 +668,33 @@ } ], "behaviorsSharedData": [ + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, + { + "name": "Effect", + "type": "EffectCapability::EffectBehavior" + }, { "name": "EllipseMovement", "type": "EllipseMovement::EllipseMovement" + }, + { + "name": "Flippable", + "type": "FlippableCapability::FlippableBehavior" + }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, + { + "name": "Resizable", + "type": "ResizableCapability::ResizableBehavior" + }, + { + "name": "Scale", + "type": "ScalableCapability::ScalableBehavior" } ] }, @@ -1278,7 +1302,7 @@ "assetStoreId": "", "name": "Life", "type": "TiledUnitsBar::TiledUnitsBar", - "variant": "", + "variant": "Yellow hearth bar", "variables": [], "effects": [], "behaviors": [], @@ -3706,17 +3730,45 @@ } ], "behaviorsSharedData": [ + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, + { + "name": "Effect", + "type": "EffectCapability::EffectBehavior" + }, { "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": "StayOnScreen", "type": "StayOnScreen::StayOnScreen" + }, + { + "name": "Text", + "type": "TextContainerCapability::TextContainerBehavior" } ] } @@ -3728,13 +3780,13 @@ "category": "User interface", "extensionNamespace": "", "fullName": "Resource bar (separated units)", - "gdevelopVersion": "", + "gdevelopVersion": ">=5.5.230", "helpPath": "/objects/resource-bar", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWRvdHMtaG9yaXpvbnRhbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNiwxMkEyLDIgMCAwLDEgMTgsMTBBMiwyIDAgMCwxIDIwLDEyQTIsMiAwIDAsMSAxOCwxNEEyLDIgMCAwLDEgMTYsMTJNMTAsMTJBMiwyIDAgMCwxIDEyLDEwQTIsMiAwIDAsMSAxNCwxMkEyLDIgMCAwLDEgMTIsMTRBMiwyIDAgMCwxIDEwLDEyTTQsMTJBMiwyIDAgMCwxIDYsMTBBMiwyIDAgMCwxIDgsMTJBMiwyIDAgMCwxIDYsMTRBMiwyIDAgMCwxIDQsMTJaIiAvPjwvc3ZnPg==", "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": "2.0.0", "description": [ "A bar that represents a resource in the game (health, mana, ammo, etc).", "", @@ -3759,10 +3811,109 @@ "gqDaZjCfevOOxBYkK6zlhtZnXCg1", "q8ubdigLvIRXLxsJDDTaokO41mc2" ], + "changelog": [ + { + "version": "2.0.0", + "breaking": "- Resource bars now use variants, you will have to make some adjustments to existing resource bars in your project by following this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/)." + } + ], "dependencies": [], "globalVariables": [], "sceneVariables": [], - "eventsFunctions": [], + "eventsFunctions": [ + { + "description": "left anchor", + "fullName": "Left anchor", + "functionType": "ExpressionAndCondition", + "name": "LeftEdgeAnchor", + "private": true, + "sentence": "Left anchor of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._TiledUnitsBarExtension = gdjs._TiledUnitsBarExtension || {", + " anchors: [\"None\", \"Min\", \"Max\", \"Proportional\", \"Center\"]", + "}", + "const { anchors } = gdjs._TiledUnitsBarExtension;", + "", + "const object = objects[0];", + "/** @type {gdjs.AnchorRuntimeBehavior} */", + "const anchor = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Anchor\"));", + "eventsFunctionContext.returnValue = anchors[anchor._leftEdgeAnchor] || \"None\";", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "supplementaryInformation": "[\"None\",\"Min\",\"Max\",\"Proportional\",\"Center\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Anchor", + "name": "Anchor", + "supplementaryInformation": "AnchorBehavior::AnchorBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "left anchor", + "fullName": "Right anchor", + "functionType": "ExpressionAndCondition", + "name": "RightEdgeAnchor", + "private": true, + "sentence": "Right anchor of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._TiledUnitsBarExtension = gdjs._TiledUnitsBarExtension || {", + " anchors: [\"None\", \"Min\", \"Max\", \"Proportional\", \"Center\"]", + "}", + "const { anchors } = gdjs._TiledUnitsBarExtension;", + "", + "const object = objects[0];", + "/** @type {gdjs.AnchorRuntimeBehavior} */", + "const anchor = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Anchor\"));", + "eventsFunctionContext.returnValue = anchors[anchor._rightEdgeAnchor] || \"None\";", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "supplementaryInformation": "[\"None\",\"Min\",\"Max\",\"Proportional\",\"Center\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Anchor", + "name": "Anchor", + "supplementaryInformation": "AnchorBehavior::AnchorBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], "eventsBasedBehaviors": [ { "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", @@ -3850,7 +4001,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Value" + "CurrentValue" ] } ] @@ -3887,11 +4038,10 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentValue", "=", "clamp(Value, 0, MaxValue)" ] @@ -3903,11 +4053,10 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "Value", "<", "PreviousHighValue" ] @@ -3930,11 +4079,10 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "Value", ">=", "PreviousHighValue" ] @@ -4023,11 +4171,10 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyMaxValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxValue", "=", "Value" ] @@ -4062,11 +4209,10 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentValue", "=", "0" ] @@ -4111,11 +4257,10 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentValue", "=", "MaxValue" ] @@ -4201,13 +4346,12 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyPreviousHighValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PreviousHighValue", "=", - "Value" + "CurrentValue" ] } ] @@ -4282,11 +4426,10 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyPreviousHighValueDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PreviousHighValueDuration", "=", "Value" ] @@ -4327,7 +4470,7 @@ "Object", "Behavior", "!=", - "Value", + "CurrentValue", "" ] }, @@ -4376,7 +4519,7 @@ "value": "1", "type": "Number", "label": "Value", - "name": "Value" + "name": "CurrentValue" }, { "value": "3", @@ -4403,8 +4546,8 @@ ], "eventsBasedObjects": [ { - "areaMaxX": 64, - "areaMaxY": 64, + "areaMaxX": 96, + "areaMaxY": 32, "areaMaxZ": 64, "areaMinX": 0, "areaMinY": 0, @@ -4412,7 +4555,8 @@ "defaultName": "ResourceBar", "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", "fullName": "Resource bar (separated units)", - "isUsingLegacyInstancesRenderer": true, + "isInnerAreaFollowingParentSize": true, + "isUsingLegacyInstancesRenderer": false, "name": "TiledUnitsBar", "objects": [ { @@ -4425,6 +4569,16 @@ "variables": [], "effects": [], "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + }, { "name": "ResourceBar", "type": "TiledUnitsBar::ResourceBar", @@ -4443,7 +4597,18 @@ "width": 32, "variables": [], "effects": [], - "behaviors": [] + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + } + ] }, { "assetStoreId": "", @@ -4453,13 +4618,24 @@ "name": "Background", "rightMargin": 0, "texture": "", - "tiled": true, + "tiled": false, "topMargin": 0, "type": "PanelSpriteObject::PanelSprite", "width": 32, "variables": [], "effects": [], - "behaviors": [] + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] } ], "objectsFolderStructure": { @@ -4507,7 +4683,58 @@ "effects": [] } ], - "instances": [], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 32, + "keepRatio": true, + "layer": "", + "name": "Background", + "persistentUuid": "b13e773c-6941-4f67-b198-030f29c8b679", + "width": 96, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 26, + "keepRatio": true, + "layer": "", + "name": "Bar", + "persistentUuid": "caf6fdad-096d-4247-b23b-6cc1a89ce9f8", + "width": 90, + "x": 3, + "y": 3, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 26, + "layer": "", + "name": "FillBar", + "persistentUuid": "4b784a8f-dbae-4d8b-a287-628642416d10", + "width": 60, + "x": 3, + "y": 3, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], "eventsFunctions": [ { "fullName": "", @@ -4533,16 +4760,33 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::SetPropertyPreviousInitialValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", + "PreviousInitialValue", "=", "InitialValue" ] } ] - }, + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -4553,76 +4797,84 @@ "textG": 0, "textR": 0 }, - "comment": "Create the child-object instances." + "comment": "Pass the configuration to the behavior (MaxValue must be set before Value)." }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "Create" + "value": "BuiltinCommonInstructions::Once" }, - "parameters": [ - "", - "Background", - "0", - "0", - "" - ] - }, + "parameters": [] + } + ], + "actions": [ { "type": { - "value": "Create" + "value": "TiledUnitsBar::TiledUnitsBar::SetMaxValue" }, "parameters": [ - "", - "Bar", - "0", - "0", + "Object", + "=", + "MaxValue", "" ] }, { "type": { - "value": "Create" + "value": "TiledUnitsBar::TiledUnitsBar::SetValue" }, "parameters": [ - "", - "FillBar", - "0", - "0", + "Object", + "=", + "InitialValue", "" ] - }, + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { "type": { - "value": "ChangePlan" + "value": "TiledUnitsBar::TiledUnitsBar::SetUnitWidth" }, "parameters": [ - "Background", + "Object", "=", - "1" + "UnitWidth", + "Object.PropertyMaxValue()" ] }, { "type": { - "value": "ChangePlan" + "value": "TiledUnitsBar::TiledUnitsBar::SetMaxValue" }, "parameters": [ - "Bar", + "Object", "=", - "2" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "FillBar", - "=", - "3" + "MaxValue", + "Object.PropertyMaxValue()" ] } ] @@ -4632,25 +4884,93 @@ "conditions": [ { "type": { - "inverted": true, - "value": "TiledUnitsBar::TiledUnitsBar::PropertyShowBackground" + "value": "NumberVariable" }, "parameters": [ - "Object" + "InitialValue", + "!=", + "PreviousInitialValue" ] } ], "actions": [ { "type": { - "value": "Cache" + "value": "SetNumberVariable" + }, + "parameters": [ + "PreviousInitialValue", + "=", + "InitialValue" + ] + }, + { + "type": { + "value": "TiledUnitsBar::TiledUnitsBar::SetValue" }, "parameters": [ - "Background" + "Object", + "=", + "InitialValue", + "Object.PropertyInitialValue()" ] } ] - }, + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "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": "TiledUnitsBar::TiledUnitsBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "Value", + "name": "SetValue", + "sentence": "", + "events": [ { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -4661,7 +4981,7 @@ "textG": 0, "textR": 0 }, - "comment": "Pass the configuration to the behavior (MaxValue must be set before Value)." + "comment": "The value is clamped by the behavior. This is why Object.Value() is used instead of Value directly." }, { "type": "BuiltinCommonInstructions::Standard", @@ -4669,29 +4989,70 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::SetMaxValue" + "value": "TiledUnitsBar::ResourceBar::SetValue" }, "parameters": [ - "Object", + "FillBar", + "ResourceBar", "=", - "MaxValue", + "Value", "" ] }, { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::SetValue" + "value": "TiledUnitsBar::TiledUnitsBar::UpdateBarWidth" }, "parameters": [ "Object", - "=", - "InitialValue", "" ] } ] } ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TiledUnitsBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum value of the object.", + "fullName": "Maximum value", + "functionType": "ExpressionAndCondition", + "group": "Resource bar configuration", + "name": "MaxValue", + "sentence": "the maximum value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "FillBar.ResourceBar::MaxValue()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -4704,8 +5065,9 @@ }, { "fullName": "", - "functionType": "Action", - "name": "onHotReloading", + "functionType": "ActionWithOperator", + "getterName": "MaxValue", + "name": "SetMaxValue", "sentence": "", "events": [ { @@ -4714,60 +5076,119 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" + "value": "TiledUnitsBar::ResourceBar::SetMaxValue" }, "parameters": [ - "Object", + "FillBar", + "ResourceBar", + "=", + "Value", "" ] }, { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::SetMaxValue" + "value": "TiledUnitsBar::TiledUnitsBar::SetValue" }, "parameters": [ "Object", "=", - "MaxValue", - "Object.PropertyMaxValue()" + "Object.Value()", + "" ] } ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "type": "object" }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TiledUnitsBar::ResourceBar", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the bar is empty.", + "fullName": "Empty", + "functionType": "Condition", + "group": "Resource bar", + "name": "IsEmpty", + "sentence": "_PARAM0_ bar is empty", + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::PropertyInitialValue" + "value": "TiledUnitsBar::ResourceBar::IsEmpty" }, "parameters": [ - "Object", - "!=", - "PreviousInitialValue" + "FillBar", + "ResourceBar", + "=" ] } ], "actions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::SetPropertyPreviousInitialValue" + "value": "SetReturnBoolean" }, "parameters": [ - "Object", - "=", - "InitialValue" + "True" ] - }, + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if the bar is full.", + "fullName": "Full", + "functionType": "Condition", + "group": "Resource bar", + "name": "IsFull", + "sentence": "_PARAM0_ bar is full", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::SetValue" + "value": "TiledUnitsBar::ResourceBar::IsFull" }, "parameters": [ - "Object", - "=", - "InitialValue", - "Object.PropertyInitialValue()" + "FillBar", + "ResourceBar", + "=" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" ] } ] @@ -4784,238 +5205,24 @@ "objectGroups": [] }, { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", + "description": "the unit width of the object. How much pixels to show for a value of 1.", + "fullName": "Unit width", + "functionType": "ExpressionAndCondition", + "group": "Resource bar configuration", + "name": "UnitWidth", + "private": true, + "sentence": "the unit width", "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 button size change:\n- background is resized to take the full dimensions of the button\n- the bar size is refreshed according to the value\n\nThe scale is set back to 1 because it means that the parent instance has the same dimensions as the union of its children instances." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Width()", - "!=", - "max(Background.BoundingBoxRight(), Bar.BoundingBoxRight()) - min(Background.BoundingBoxLeft(), Bar.BoundingBoxLeft())" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Height()", - "!=", - "max(Background.BoundingBoxBottom(), Bar.BoundingBoxBottom()) - min(Background.BoundingBoxTop(), Bar.BoundingBoxTop())" - ] - } - ] - } - ], - "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)" - ] - }, - { - "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" - }, - "parameters": [ - "Object", - "" - ] - } - ] - } - ], - "parameters": [] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Center the bar according to the button configuration. This is used in doStepPostEvents when the button is resized.", - "fullName": "", - "functionType": "Action", - "name": "CenterBar", - "private": true, - "sentence": "Center the bar of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetCenter" - }, - "parameters": [ - "Bar", - "=", - "Background.CenterX()", - "=", - "Background.CenterY()" - ] - }, - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Bar", - "+", - "0" - ] - }, - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Bar", - "+", - "0" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "MettreXY" - }, - "parameters": [ - "FillBar", - "=", - "Bar.X()", - "=", - "Bar.Y()" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", - "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": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { "type": { "value": "SetReturnNumber" }, "parameters": [ - "FillBar.ResourceBar::Value()" + "UnitWidth" ] } ] @@ -5037,8 +5244,9 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "Value", - "name": "SetValue", + "getterName": "UnitWidth", + "name": "SetUnitWidth", + "private": true, "sentence": "", "events": [ { @@ -5047,25 +5255,21 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetValue" + "value": "SetNumberVariable" }, "parameters": [ - "FillBar", - "ResourceBar", + "UnitWidth", "=", - "Value", - "" + "Value" ] }, { "type": { - "value": "ResizableCapability::ResizableBehavior::SetWidth" + "value": "TiledUnitsBar::TiledUnitsBar::UpdateBarWidth" }, "parameters": [ - "FillBar", - "Resizable", - "=", - "Value * Object.PropertyUnitWidth()" + "Object", + "" ] } ] @@ -5077,23 +5281,17 @@ "name": "Object", "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "TiledUnitsBar::ResourceBar", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "the maximum value of the object.", - "fullName": "Maximum value", - "functionType": "ExpressionAndCondition", - "group": "Resource bar configuration", - "name": "MaxValue", - "sentence": "the maximum value", + "description": "Update the bar width.", + "fullName": "Bar width", + "functionType": "Action", + "name": "UpdateBarWidth", + "private": true, + "sentence": "Update the bar width of _PARAM0_", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -5101,164 +5299,189 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetNumberVariable" }, "parameters": [ - "FillBar.ResourceBar::PropertyMaxValue()" + "NewWidth", + "=", + "Object.MaxValue() * UnitWidth" ] } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "MaxValue", - "name": "SetMaxValue", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + ], + "events": [ { - "type": { - "value": "TiledUnitsBar::ResourceBar::SetMaxValue" - }, - "parameters": [ - "FillBar", - "ResourceBar", - "=", - "Value", - "" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TiledUnitsBar::LeftEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Center\"", + "Bar", + "Anchor", + "" + ] + }, + { + "type": { + "value": "TiledUnitsBar::RightEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Center\"", + "Bar", + "Anchor", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Bar", + "-", + "(NewWidth - Bar.Width()) / 2" + ] + } ] }, { - "type": { - "value": "ResizableCapability::ResizableBehavior::SetWidth" - }, - "parameters": [ - "Bar", - "Resizable", - "=", - "Value * Object.PropertyUnitWidth()" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TiledUnitsBar::LeftEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + }, + { + "type": { + "value": "TiledUnitsBar::RightEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Bar", + "-", + "NewWidth - Bar.Width()" + ] + } ] }, { - "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" - }, - "parameters": [ - "Object", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "TiledUnitsBar::ResourceBar", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the bar is empty.", - "fullName": "Empty", - "functionType": "Condition", - "group": "Resource bar", - "name": "IsEmpty", - "sentence": "_PARAM0_ bar is empty", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "TiledUnitsBar::ResourceBar::IsEmpty" - }, - "parameters": [ - "FillBar", - "ResourceBar", - "=" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "Bar", + "Resizable", + "=", + "NewWidth" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "FillBar", + "Resizable", + "=", + "Object.Value() * UnitWidth" + ] + }, + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "FillBar", + "=", + "Bar.X()" + ] + } ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the bar is full.", - "fullName": "Full", - "functionType": "Condition", - "group": "Resource bar", - "name": "IsFull", - "sentence": "_PARAM0_ bar is full", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { - "type": { - "value": "TiledUnitsBar::ResourceBar::IsFull" - }, - "parameters": [ - "FillBar", - "ResourceBar", - "=" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TiledUnitsBar::LeftEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + }, + { + "type": { + "value": "TiledUnitsBar::RightEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "FillBar", + "=", + "Bar.X() + Bar.Width() - FillBar.Width()" + ] + } ] } ], - "actions": [ + "variables": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] + "name": "NewWidth", + "type": "number", + "value": 0 } ] } @@ -5278,12 +5501,14 @@ { "value": "3", "type": "Number", + "unit": "Dimensionless", "label": "Maximum value", "name": "MaxValue" }, { "value": "3", "type": "Number", + "unit": "Dimensionless", "label": "Initial value", "name": "InitialValue" }, @@ -5298,64 +5523,182 @@ { "value": "24", "type": "Number", + "unit": "Pixel", "label": "Unit width", "description": "How much pixels to show for a value of 1.", "name": "UnitWidth" - }, - { - "value": "true", - "type": "Boolean", - "label": "Show the background", - "extraInformation": [ - "Background" - ], - "name": "ShowBackground" - }, - { - "value": "0", - "type": "Number", - "label": "Bar left margin", - "extraInformation": [ - "FillBar", - "Bar" - ], - "name": "BarLeftPadding" - }, - { - "value": "0", - "type": "Number", - "label": "Bar right margin", - "extraInformation": [ - "FillBar", - "Bar" - ], - "name": "BarRightPadding" - }, - { - "value": "Center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "extraInformation": [ - "FillBar", - "Bar" - ], - "hidden": true, - "name": "BarVerticalAnchorOrigin" - }, - { - "value": "Center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "extraInformation": [ - "Background" - ], - "hidden": true, - "name": "BarVerticalAnchorTarget" } ], - "variants": [] + "variants": [ + { + "areaMaxX": 123, + "areaMaxY": 32, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "Yellow hearth bar", + "objects": [ + { + "assetStoreId": "", + "height": 32, + "name": "FillBar", + "texture": "life-3.png", + "type": "TiledSpriteObject::TiledSprite", + "width": 41, + "variables": [], + "effects": [], + "behaviors": [ + { + "leftEdgeAnchor": 1, + "name": "Anchor", + "rightEdgeAnchor": 2, + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "ResourceBar", + "type": "TiledUnitsBar::ResourceBar", + "Value": 1, + "MaxValue": 3, + "PreviousValue": 0 + } + ] + }, + { + "assetStoreId": "", + "height": 32, + "name": "Bar", + "texture": "life-0.png", + "type": "TiledSpriteObject::TiledSprite", + "width": 41, + "variables": [], + "effects": [], + "behaviors": [ + { + "leftEdgeAnchor": 1, + "name": "Anchor", + "rightEdgeAnchor": 2, + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Background", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "FillBar" + }, + { + "objectName": "Bar" + }, + { + "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": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 32, + "layer": "", + "name": "Bar", + "persistentUuid": "caf6fdad-096d-4247-b23b-6cc1a89ce9f8", + "width": 123, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 32, + "layer": "", + "name": "FillBar", + "persistentUuid": "4b784a8f-dbae-4d8b-a287-628642416d10", + "width": 123, + "x": 0, + "y": 0, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ] + } + ] } ] }, From c47824eab05d1f1ad9c50f6e64ab64cf76f3e67d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 15 Jul 2025 18:52:30 +0200 Subject: [PATCH 5/9] Update extensions --- .../multiplayer-platformer-arrow-fight.json | 14384 ++++++++++------ 1 file changed, 9178 insertions(+), 5206 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 e31a54ba5..15e6d5a65 100644 --- a/examples/multiplayer-platformer-arrow-fight/multiplayer-platformer-arrow-fight.json +++ b/examples/multiplayer-platformer-arrow-fight/multiplayer-platformer-arrow-fight.json @@ -1,7 +1,7 @@ { "firstLayout": "Lobby", "gdVersion": { - "build": 223, + "build": 236, "major": 5, "minor": 5, "revision": 0 @@ -22,7 +22,6 @@ "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", "author": "", - "gdevelopVersion": ">=5.5.222", "windowWidth": 1280, "windowHeight": 720, "latestCompilationDirectory": "", @@ -812,6 +811,7 @@ "assetStoreId": "1cacfe2713f10642e8079542f28282d52f1bf46ae2dc27dc6c291a2970c90971", "name": "LobbyButton", "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "", "variables": [], "effects": [], "behaviors": [], @@ -3539,6 +3539,7 @@ "assetStoreId": "", "name": "ArrowBar", "type": "TiledUnitsBar::TiledUnitsBar", + "variant": "", "variables": [], "effects": [], "behaviors": [ @@ -3580,6 +3581,7 @@ "assetStoreId": "1cacfe2713f10642e8079542f28282d52f1bf46ae2dc27dc6c291a2970c90971", "name": "LeaveGameButton", "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "", "variables": [], "effects": [], "behaviors": [ @@ -3831,6 +3833,7 @@ "assetStoreId": "14597a6b9020c730f9fd07fdf2b0deaba2505f0c33fd78ccd2e982b5ecee350b", "name": "MovementJoystick", "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "variant": "", "variables": [], "effects": [], "behaviors": [], @@ -3912,6 +3915,7 @@ "assetStoreId": "14597a6b9020c730f9fd07fdf2b0deaba2505f0c33fd78ccd2e982b5ecee350b", "name": "AimingJoystick", "type": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "variant": "", "variables": [], "effects": [], "behaviors": [], @@ -5337,6 +5341,7 @@ "assetStoreId": "", "name": "Avatar", "type": "PlayerAvatar::PlayerAvatar", + "variant": "", "variables": [ { "name": "PlayerNumber", @@ -8131,13 +8136,14 @@ "author": "", "category": "Input", "extensionNamespace": "", - "fullName": "Behavior Remapper", + "fullName": "Platformer and top-down remapper", + "gdevelopVersion": ">=5.5.222", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWFscGhhLXctYm94LW91dGxpbmUiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOSwxN0EyLDIgMCAwLDEgNywxNVY3SDlWMTVIMTFWOEgxM1YxNUgxNVY3SDE3VjE1QTIsMiAwIDAsMSAxNSwxN0g5TTUsM0gxOUEyLDIgMCAwLDEgMjEsNVYxOUEyLDIgMCAwLDEgMTksMjFINUEyLDIgMCAwLDEgMywxOVY1QTIsMiAwIDAsMSA1LDNNNSw1VjE5SDE5VjVINVoiIC8+PC9zdmc+", "name": "BehaviorRemapper", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/alpha-w-box-outline.svg", - "shortDescription": "Quickly remap Behavior controls to different keys. ", - "version": "1.0.0", + "shortDescription": "Quickly remap keyboard controls.", + "version": "1.1.1", "description": [ "Make sure to disable default controls unless you want two keys to do the same action.", "", @@ -8196,8 +8202,8 @@ "eventsFunctions": [], "eventsBasedBehaviors": [ { - "description": "Allows for the controls of a Top-Down behavior to be re-mapped via a single action.", - "fullName": "Remap Top-down", + "description": "Remap keyboard controls of the top-down movement.", + "fullName": "Top-down keyboard remapper", "name": "RemapForTopdown", "objectType": "", "eventsFunctions": [ @@ -8216,7 +8222,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyUp()" + "Up" ] } ], @@ -8241,7 +8247,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyLeft()" + "Left" ] } ], @@ -8266,7 +8272,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyRight()" + "Right" ] } ], @@ -8291,7 +8297,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyDown()" + "Down" ] } ], @@ -8343,46 +8349,42 @@ "actions": [ { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyUp" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Up", "=", - "GetArgumentAsString(\"up\")" + "up" ] }, { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyLeft" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Left", "=", - "GetArgumentAsString(\"left\")" + "left" ] }, { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyRight" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Right", "=", - "GetArgumentAsString(\"right\")" + "right" ] }, { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyDown" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Down", "=", - "GetArgumentAsString(\"down\")" + "down" ] } ] @@ -8403,22 +8405,22 @@ { "description": "Up key", "name": "up", - "type": "key" + "type": "keyboardKey" }, { "description": "Left key", "name": "left", - "type": "key" + "type": "keyboardKey" }, { "description": "Down key", "name": "down", - "type": "key" + "type": "keyboardKey" }, { "description": "Right key", "name": "right", - "type": "key" + "type": "keyboardKey" } ], "objectGroups": [] @@ -8450,7 +8452,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"WASD\"" ] @@ -8459,44 +8461,40 @@ "actions": [ { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyUp" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Up", "=", "\"w\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyLeft" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Left", "=", "\"a\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyDown" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Down", "=", "\"s\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyRight" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Right", "=", "\"d\"" ] @@ -8523,7 +8521,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"ZQSD\"" ] @@ -8532,44 +8530,40 @@ "actions": [ { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyUp" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Up", "=", "\"z\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyLeft" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Left", "=", "\"q\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyDown" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Down", "=", "\"s\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyDown" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Down", "=", "\"d\"" ] @@ -8596,7 +8590,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"Numpad\"" ] @@ -8605,44 +8599,40 @@ "actions": [ { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyUp" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Up", "=", "\"NumpadUp\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyLeft" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Left", "=", "\"NumpadLeft\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyDown" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Down", "=", "\"NumpadDown\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyRight" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Right", "=", "\"NumpadRight\"" ] @@ -8669,7 +8659,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"IJKL\"" ] @@ -8678,44 +8668,40 @@ "actions": [ { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyUp" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Up", "=", "\"i\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyLeft" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Left", "=", "\"j\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyDown" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Down", "=", "\"k\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForTopdown::SetPropertyRight" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Right", "=", "\"l\"" ] @@ -8748,46 +8734,32 @@ "propertyDescriptors": [ { "value": "w", - "type": "String", + "type": "KeyboardKey", "label": "Up key", - "description": "", - "group": "", - "extraInformation": [], "name": "Up" }, { "value": "a", - "type": "String", + "type": "KeyboardKey", "label": "Left key", - "description": "", - "group": "", - "extraInformation": [], "name": "Left" }, { "value": "d", - "type": "String", + "type": "KeyboardKey", "label": "Right key", - "description": "", - "group": "", - "extraInformation": [], "name": "Right" }, { "value": "s", - "type": "String", + "type": "KeyboardKey", "label": "Down key", - "description": "", - "group": "", - "extraInformation": [], "name": "Down" }, { "value": "", "type": "Behavior", "label": "", - "description": "", - "group": "", "extraInformation": [ "TopDownMovementBehavior::TopDownMovementBehavior" ], @@ -8797,8 +8769,8 @@ "sharedPropertyDescriptors": [] }, { - "description": "Allows for the controls of a platformer behavior to be re-mapped via a single action.", - "fullName": "Remap Platformer controls", + "description": "Remap keyboard controls of the platformer character movement.", + "fullName": "Platformer keyboard mapper", "name": "RemapForPlatformer", "objectType": "", "eventsFunctions": [ @@ -8817,7 +8789,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyUp()" + "Up" ] } ], @@ -8851,7 +8823,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyLeft()" + "Left" ] } ], @@ -8876,7 +8848,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyRight()" + "Right" ] } ], @@ -8901,7 +8873,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyDown()" + "Down" ] } ], @@ -8935,7 +8907,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyJump()" + "Jump" ] } ], @@ -8987,57 +8959,52 @@ "actions": [ { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyUp" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Up", "=", - "GetArgumentAsString(\"up\")" + "up" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyLeft" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Left", "=", - "GetArgumentAsString(\"left\")" + "left" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyRight" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Right", "=", - "GetArgumentAsString(\"right\")" + "right" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyDown" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Down", "=", - "GetArgumentAsString(\"down\")" + "down" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyJump" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Jump", "=", - "GetArgumentAsString(\"jump\")" + "jump" ] } ] @@ -9058,27 +9025,27 @@ { "description": "Up key", "name": "up", - "type": "key" + "type": "keyboardKey" }, { "description": "Left key", "name": "left", - "type": "key" + "type": "keyboardKey" }, { "description": "Down key", "name": "down", - "type": "key" + "type": "keyboardKey" }, { "description": "Right key", "name": "right", - "type": "key" + "type": "keyboardKey" }, { "description": "Jump key", "name": "jump", - "type": "key" + "type": "keyboardKey" } ], "objectGroups": [] @@ -9110,7 +9077,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"WASD\"" ] @@ -9119,55 +9086,50 @@ "actions": [ { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyUp" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Up", "=", "\"w\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyLeft" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Left", "=", "\"a\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyDown" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Down", "=", "\"s\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyRight" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Right", "=", "\"d\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyJump" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Jump", "=", "\"Space\"" ] @@ -9194,7 +9156,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"ZQSD\"" ] @@ -9203,55 +9165,50 @@ "actions": [ { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyUp" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Up", "=", "\"z\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyLeft" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Left", "=", "\"q\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyDown" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Down", "=", "\"s\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyRight" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Right", "=", "\"d\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyJump" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Jump", "=", "\"Space\"" ] @@ -9278,7 +9235,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"Numpad\"" ] @@ -9287,55 +9244,50 @@ "actions": [ { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyUp" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Up", "=", "\"NumpadUp\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyLeft" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Left", "=", "\"NumpadLeft\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyDown" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Down", "=", "\"NumpadDown\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyRight" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Right", "=", "\"NumpadRight\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyJump" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Jump", "=", "\"NumpadReturn\"" ] @@ -9362,7 +9314,7 @@ "value": "StrEqual" }, "parameters": [ - "GetArgumentAsString(\"options\")", + "options", "=", "\"IJKL\"" ] @@ -9371,55 +9323,50 @@ "actions": [ { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyUp" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Up", "=", "\"i\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyLeft" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Left", "=", "\"j\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyDown" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Down", "=", "\"k\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyRight" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Right", "=", "\"l\"" ] }, { "type": { - "value": "BehaviorRemapper::RemapForPlatformer::SetPropertyJump" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "Jump", "=", "\"Return\"" ] @@ -9452,55 +9399,38 @@ "propertyDescriptors": [ { "value": "", - "type": "String", + "type": "KeyboardKey", "label": "Up key", - "description": "", - "group": "", - "extraInformation": [], "name": "Up" }, { "value": "", - "type": "String", + "type": "KeyboardKey", "label": "Left key", - "description": "", - "group": "", - "extraInformation": [], "name": "Left" }, { "value": "", - "type": "String", + "type": "KeyboardKey", "label": "Down key", - "description": "", - "group": "", - "extraInformation": [], "name": "Down" }, { "value": "", - "type": "String", + "type": "KeyboardKey", "label": "Right key", - "description": "", - "group": "", - "extraInformation": [], "name": "Right" }, { "value": "", - "type": "String", + "type": "KeyboardKey", "label": "Jump key", - "description": "", - "group": "", - "extraInformation": [], "name": "Jump" }, { "value": "", "type": "Behavior", "label": "", - "description": "", - "group": "", "extraInformation": [ "PlatformBehavior::PlatformerObjectBehavior" ], @@ -9517,12 +9447,13 @@ "category": "Input", "extensionNamespace": "", "fullName": "Multitouch joystick and buttons (sprite)", + "gdevelopVersion": ">=5.5.222", "helpPath": "/objects/multitouch-joystick", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMTYiIGN5PSIxNiIgcj0iMTMiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjI4LjQsMTIgMjAsMTIgMjAsMy42ICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMjAsMjguNCAyMCwyMCAyOC40LDIwICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMy42LDIwIDEyLDIwIDEyLDI4LjQgIi8+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIxMiwzLjYgMTIsMTIgMy42LDEyICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIxNiw2IDE2LjcsNyAxNS4zLDcgIi8+DQo8cG9seWdvbiBjbGFzcz0ic3QwIiBwb2ludHM9IjE2LDI2IDE1LjMsMjUgMTYuNywyNSAiLz4NCjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iNiwxNiA3LDE1LjMgNywxNi43ICIvPg0KPHBvbHlnb24gY2xhc3M9InN0MCIgcG9pbnRzPSIyNiwxNiAyNSwxNi43IDI1LDE1LjMgIi8+DQo8L3N2Zz4NCg==", "name": "SpriteMultitouchJoystick", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Videogames/Videogames_controller_joystick_arrows_direction.svg", "shortDescription": "Joysticks or buttons for touchscreens.", - "version": "1.2.2", + "version": "1.8.3", "description": [ "Multitouch joysticks can be used the same way as physical gamepads:", "- 4 or 8 directions", @@ -9557,61 +9488,511 @@ ], "dependencies": [], "globalVariables": [], - "sceneVariables": [], + "sceneVariables": [ + { + "name": "Controllers", + "type": "array", + "children": [ + { + "type": "structure", + "children": [ + { + "name": "Buttons", + "type": "array", + "children": [ + { + "type": "structure", + "children": [ + { + "name": "State", + "type": "string", + "value": "Idle" + } + ] + } + ] + }, + { + "name": "Joystick", + "type": "structure", + "children": [] + } + ] + } + ] + } + ], "eventsFunctions": [ { - "description": "Check if a button is pressed on a gamepad.", - "fullName": "Multitouch controller button pressed", - "functionType": "Condition", - "name": "IsButtonPressed", - "sentence": "Button _PARAM2_ of multitouch controller _PARAM1_ is pressed", + "fullName": "Accelerated speed", + "functionType": "Expression", + "name": "AcceleratedSpeed", + "private": true, + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "VarSceneTxt" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "AcceleratedSpeed", "=", - "\"Pressed\"" + "CurrentSpeed" ] } ], - "actions": [ + "events": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TargetedSpeed", + "<", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Reduce the speed to match the stick force." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "-", + "Acceleration * TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Turn back at least as fast as it would stop." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TargetedSpeed", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Reduce the speed to match the stick force." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "+", + "Acceleration * TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Turn back at least as fast as it would stop." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TargetedSpeed", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(0, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(0, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "clamp(AcceleratedSpeed, -SpeedMax, SpeedMax)" + ] + } ] } + ], + "variables": [ + { + "name": "AcceleratedSpeed", + "type": "number", + "value": 0 + } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { - "description": "Multitouch controller identifier (1, 2, 3, 4...)", - "name": "ControllerIdentifier", + "description": "Current speed", + "name": "CurrentSpeed", "type": "expression" }, { - "description": "Button name", - "name": "Button", - "supplementaryInformation": "[\"A\",\"CROSS\",\"B\",\"CIRCLE\",\"X\",\"SQUARE\",\"Y\",\"TRIANGLE\",\"LB\",\"L1\",\"RB\",\"R1\",\"LT\",\"L2\",\"RT\",\"R2\",\"UP\",\"DOWN\",\"LEFT\",\"RIGHT\",\"BACK\",\"SHARE\",\"START\",\"OPTIONS\",\"CLICK_STICK_LEFT\",\"CLICK_STICK_RIGHT\",\"PS_BUTTON\",\"CLICK_TOUCHPAD\"]", - "type": "string" + "description": "Targeted speed", + "name": "TargetedSpeed", + "type": "expression" + }, + { + "description": "Max speed", + "name": "SpeedMax", + "type": "expression" + }, + { + "description": "Acceleration", + "name": "Acceleration", + "type": "expression" + }, + { + "description": "Deceleration", + "name": "Deceleration", + "type": "expression" } ], "objectGroups": [] }, { - "description": "Check if a button is released on a gamepad.", - "fullName": "Multitouch controller button released", + "description": "Check if a button is pressed on a gamepad.", + "fullName": "Multitouch controller button pressed", "functionType": "Condition", - "name": "IsButtonReleased", + "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": [ { @@ -9619,10 +10000,10 @@ "conditions": [ { "type": { - "value": "VarSceneTxt" + "value": "StringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", "\"Released\"" ] @@ -9669,12 +10050,12 @@ "actions": [ { "type": { - "value": "ModVarSceneTxt" + "value": "SetStringVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Buttons[GetArgumentAsString(\"Button\")].State", + "Controllers[ControllerIdentifier].Buttons[Button].State", "=", - "GetArgumentAsString(\"ButtonState\")" + "ButtonState" ] } ] @@ -9714,12 +10095,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone", "=", - "GetArgumentAsNumber(\"DeadZoneRadius\")" + "DeadZoneRadius" ] } ] @@ -9762,7 +10143,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].DeadZone)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].DeadZone" ] } ] @@ -9802,7 +10183,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 4 / 360), 4)" + "mod(round(Angle * 4 / 360), 4)" ] } ] @@ -9837,7 +10218,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "mod(round(GetArgumentAsNumber(\"Angle\") * 8 / 360), 8)" + "mod(round(Angle * 8 / 360), 8)" ] } ] @@ -9871,7 +10252,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -9884,7 +10265,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9908,7 +10289,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -9921,7 +10302,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9945,7 +10326,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -9958,7 +10339,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -9982,7 +10363,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -9995,7 +10376,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10043,7 +10424,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Right\"" ] @@ -10056,7 +10437,7 @@ "", "=", "0", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10080,7 +10461,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownRight\"" ] @@ -10093,7 +10474,7 @@ "", "=", "1", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10117,7 +10498,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Down\"" ] @@ -10130,7 +10511,7 @@ "", "=", "2", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10154,7 +10535,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"DownLeft\"" ] @@ -10167,7 +10548,7 @@ "", "=", "3", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10191,7 +10572,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Left\"" ] @@ -10204,7 +10585,7 @@ "", "=", "4", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10228,7 +10609,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpLeft\"" ] @@ -10241,7 +10622,7 @@ "", "=", "5", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10265,7 +10646,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"Up\"" ] @@ -10278,7 +10659,7 @@ "", "=", "6", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10302,7 +10683,7 @@ "value": "BuiltinCommonInstructions::CompareStrings" }, "parameters": [ - "GetArgumentAsString(\"Direction\")", + "Direction", "=", "\"UpRight\"" ] @@ -10315,7 +10696,7 @@ "", "=", "7", - "GetArgumentAsNumber(\"Angle\")", + "Angle", "" ] } @@ -10376,9 +10757,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -10388,8 +10769,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -10456,9 +10837,9 @@ "parameters": [ "", ">", - "SpriteMultitouchJoystick::DeadZone(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsNumber(\"ControllerIdentifier\")", - "GetArgumentAsString(\"JoystickIdentifier\")", + "0", + "ControllerIdentifier", + "JoystickIdentifier", "" ] }, @@ -10468,8 +10849,8 @@ }, "parameters": [ "", - "SpriteMultitouchJoystick::JoystickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))", - "GetArgumentAsString(\"Direction\")", + "SpriteMultitouchJoystick::JoystickAngle(ControllerIdentifier, JoystickIdentifier)", + "Direction", "" ] } @@ -10524,7 +10905,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickForce(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -10544,6 +10925,11 @@ "name": "JoystickIdentifier", "supplementaryInformation": "[\"Primary\",\"Secondary\"]", "type": "stringWithSelector" + }, + { + "description": "", + "name": "Coucou", + "type": "expression" } ], "objectGroups": [] @@ -10564,7 +10950,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))" ] } ] @@ -10602,12 +10988,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Force", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Force", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -10649,7 +11035,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "SpriteMultitouchJoystick::StickAngle(GetArgumentAsNumber(\"ControllerIdentifier\"), GetArgumentAsString(\"JoystickIdentifier\"))" + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)" ] } ] @@ -10689,7 +11075,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Variable(__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle)" + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle" ] } ] @@ -10727,12 +11113,12 @@ "actions": [ { "type": { - "value": "ModVarScene" + "value": "SetNumberVariable" }, "parameters": [ - "__MultitouchJoystick.Controllers[GetArgumentAsNumber(\"ControllerIdentifier\")].Joystick[GetArgumentAsString(\"JoystickIdentifier\")].Angle", + "Controllers[ControllerIdentifier].Joystick[JoystickIdentifier].Angle", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -10773,7 +11159,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))" ] } ] @@ -10813,7 +11199,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))" ] } ] @@ -10836,6 +11222,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": "StringVariable" + }, + "parameters": [ + "Side", + "=", + "\"Left\"" + ] + }, + { + "type": { + "value": "TouchX" + }, + "parameters": [ + "", + "StartedTouchOrMouseId(0)", + "<", + "CameraCenterX(Object.Layer())", + "Object.Layer()", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Side", + "=", + "\"Right\"" + ] + }, + { + "type": { + "value": "TouchX" + }, + "parameters": [ + "", + "StartedTouchOrMouseId(0)", + ">=", + "CameraCenterX(Object.Layer())", + "Object.Layer()", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Multitouch joystick", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "objectList" + }, + { + "description": "Screen side", + "name": "Side", + "supplementaryInformation": "[\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] } ], "eventsBasedBehaviors": [ @@ -10862,9 +11365,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyDeadZoneRadius()", + "ControllerIdentifier", + "JoystickIdentifier", + "DeadZoneRadius", "" ] }, @@ -10989,11 +11492,10 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchIndex", "=", "0" ] @@ -11011,11 +11513,10 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", "0" ] @@ -11026,21 +11527,20 @@ }, "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)" ] } ], "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] } ] @@ -11051,11 +11551,10 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchIndex" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchIndex", "+", "1" ] @@ -11087,7 +11586,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -11121,11 +11620,10 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "!=", "0" ] @@ -11139,8 +11637,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))" ] }, { @@ -11151,7 +11649,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)", "" ] } @@ -11192,7 +11690,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickForce()" + "max(0, JoystickForce - DeadZoneRadius) / (1 - DeadZoneRadius)" ] } ] @@ -11230,13 +11728,12 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickForce" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "JoystickForce", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -11245,9 +11742,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickForce()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickForce", "" ] } @@ -11265,6 +11762,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "", + "name": "Parameter", + "type": "objectList" } ], "objectGroups": [] @@ -11285,7 +11787,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJoystickAngle()" + "JoystickAngle" ] } ] @@ -11323,13 +11825,12 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickAngle" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "JoystickAngle", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] }, { @@ -11338,9 +11839,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", - "Object.Behavior::PropertyJoystickAngle()", + "ControllerIdentifier", + "JoystickIdentifier", + "JoystickAngle", "" ] } @@ -11459,13 +11960,14 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyJoystickForce" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" }, "parameters": [ "Object", "Behavior", ">", - "Object.Behavior::PropertyDeadZoneRadius()" + "0", + "" ] }, { @@ -11474,8 +11976,8 @@ }, "parameters": [ "", - "Object.Behavior::JoystickAngle()", - "GetArgumentAsString(\"Direction\")", + "JoystickAngle", + "Direction", "" ] } @@ -11525,13 +12027,14 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyJoystickForce" + "value": "SpriteMultitouchJoystick::MultitouchJoystick::JoystickForce" }, "parameters": [ "Object", "Behavior", ">", - "Object.Behavior::PropertyDeadZoneRadius()" + "0", + "" ] }, { @@ -11540,8 +12043,8 @@ }, "parameters": [ "", - "Object.Behavior::JoystickAngle()", - "GetArgumentAsString(\"Direction\")", + "JoystickAngle", + "Direction", "" ] } @@ -11591,11 +12094,10 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::PropertyTouchId" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "!=", "0" ] @@ -11654,11 +12156,10 @@ }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", "0" ] @@ -11698,7 +12199,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyControllerIdentifier()" + "ControllerIdentifier" ] } ] @@ -11735,13 +12236,12 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyControllerIdentifier" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ControllerIdentifier", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -11779,7 +12279,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyJoystickIdentifier()" + "JoystickIdentifier" ] } ] @@ -11816,13 +12316,12 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyJoystickIdentifier" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "JoystickIdentifier", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -11860,7 +12359,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDeadZoneRadius()" + "DeadZoneRadius" ] } ] @@ -11897,13 +12396,63 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetPropertyDeadZoneRadius" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DeadZoneRadius", + "=", + "Value" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SetDeadZone" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Force the joystick into the pressing state.", + "fullName": "Force start pressing", + "functionType": "Action", + "name": "ForceStartPressing", + "sentence": "Force start pressing _PARAM0_ with touch identifier: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TouchId", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -11920,6 +12469,11 @@ "name": "Behavior", "supplementaryInformation": "SpriteMultitouchJoystick::MultitouchJoystick", "type": "behavior" + }, + { + "description": "Touch identifier", + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -11930,18 +12484,12 @@ "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" }, { @@ -11949,17 +12497,12 @@ "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" }, @@ -11967,9 +12510,6 @@ "value": "0", "type": "Number", "label": "Joystick force (range: 0 to 1)", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "JoystickForce" }, @@ -11977,9 +12517,6 @@ "value": "0", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TouchId" }, @@ -11987,9 +12524,6 @@ "value": "", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TouchIndex" } @@ -12025,12 +12559,12 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyIsReleased" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsReleased", + "False", + "" ] }, { @@ -12072,11 +12606,10 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchIndex" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchIndex", "=", "0" ] @@ -12094,25 +12627,42 @@ "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": "NumberVariable" + }, + "parameters": [ + "Radius", + ">", + "DistanceBetweenPositions(Object.CenterX(), Object.CenterY(), TouchX(StartedTouchOrMouseId(TouchIndex), Object.Layer()), TouchY(StartedTouchOrMouseId(TouchIndex), Object.Layer()))" + ] + } ] } ], "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyTouchIndex())" + "StartedTouchOrMouseId(TouchIndex)" ] }, { @@ -12134,11 +12684,10 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchIndex" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchIndex", "+", "1" ] @@ -12168,7 +12717,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], @@ -12186,21 +12735,20 @@ }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyIsReleased" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsReleased", + "True", + "" ] }, { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", "0" ] @@ -12235,11 +12783,12 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyIsReleased" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsReleased", + "True", + "" ] } ], @@ -12282,11 +12831,10 @@ "conditions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchButton::PropertyTouchId" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "!=", "0" ] @@ -12336,9 +12884,9 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyButtonIdentifier()", - "GetArgumentAsString(\"ButtonState\")", + "ControllerIdentifier", + "ButtonIdentifier", + "ButtonState", "" ] } @@ -12372,27 +12920,18 @@ "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" }, @@ -12400,9 +12939,6 @@ "value": "", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TouchIndex" }, @@ -12410,11 +12946,16 @@ "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.", + "name": "Radius" } ], "sharedPropertyDescriptors": [] @@ -12424,6 +12965,7 @@ "fullName": "Platformer multitouch controller mapper", "name": "PlatformerMultitouchMapper", "objectType": "", + "quickCustomizationVisibility": "hidden", "eventsFunctions": [ { "fullName": "", @@ -12440,8 +12982,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Left\"", "" ] @@ -12468,8 +13010,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Right\"", "" ] @@ -12496,8 +13038,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Up\"", "" ] @@ -12533,8 +13075,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJoystickIdentifier()", + "ControllerIdentifier", + "JoystickIdentifier", "\"Down\"", "" ] @@ -12561,8 +13103,8 @@ }, "parameters": [ "", - "Object.Behavior::PropertyControllerIdentifier()", - "Object.Behavior::PropertyJumpButton()", + "ControllerIdentifier", + "JumpButton", "\"Down\"" ] } @@ -12601,8 +13143,6 @@ "value": "", "type": "Behavior", "label": "Platform character behavior", - "description": "", - "group": "", "extraInformation": [ "PlatformBehavior::PlatformerObjectBehavior" ], @@ -12612,16 +13152,12 @@ "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", @@ -12633,19 +13169,18 @@ "value": "A", "type": "String", "label": "Jump button name", - "description": "", "group": "Controls", - "extraInformation": [], "name": "JumpButton" } ], "sharedPropertyDescriptors": [] }, { - "description": "Control a top-down character with a multitouch controller.", - "fullName": "Top-down multitouch controller mapper", - "name": "TopDownMultitouchMapper", + "description": "Control a 3D physics character with a multitouch controller.", + "fullName": "3D platformer multitouch controller mapper", + "name": "Platformer3DMultitouchMapper", "objectType": "", + "quickCustomizationVisibility": "hidden", "eventsFunctions": [ { "fullName": "", @@ -12658,55 +13193,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)" ] } ] @@ -12716,423 +13235,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" ] } ] @@ -13147,7 +13267,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", + "supplementaryInformation": "SpriteMultitouchJoystick::Platformer3DMultitouchMapper", "type": "behavior" } ], @@ -13158,29 +13278,23 @@ { "value": "", "type": "Behavior", - "label": "Top-down movement behavior", - "description": "", - "group": "", + "label": "3D physics character", "extraInformation": [ - "TopDownMovementBehavior::TopDownMovementBehavior" + "Physics3D::PhysicsCharacter3D" ], - "name": "TopDownMovement" + "name": "PhysicsCharacter3D" }, { "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": "", + "label": "Walk joystick", + "group": "Controls", "extraInformation": [ "Primary", "Secondary" @@ -13188,129 +13302,228 @@ "name": "JoystickIdentifier" }, { - "value": "Analog", - "type": "Choice", - "label": "Stick mode", - "description": "", + "value": "A", + "type": "String", + "label": "Jump button name", "group": "Controls", - "extraInformation": [ - "Analog", - "360°", - "8 Directions" - ], - "name": "StickMode" + "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": "", + "quickCustomizationVisibility": "hidden", "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", + "", + "ControllerIdentifier", + "JumpButton", + "\"Down\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::Shooter3DMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D physics character", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Walk joystick", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A", + "type": "String", + "label": "Jump button name", + "group": "Controls", + "name": "JumpButton" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control camera rotations with a multitouch controller.", + "fullName": "First person camera multitouch controller mapper", + "name": "FirstPersonMultitouchMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "TODO It's probably a bad idea to rotate the object around Y." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CurrentRotationSpeedZ", "=", - "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": "SetNumberVariable" }, "parameters": [ - "Border", - "=", - "0", + "CurrentRotationSpeedY", "=", - "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", "" ] } @@ -13321,17 +13534,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", @@ -13339,105 +13560,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()", "" ] } @@ -13448,114 +13625,77 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "De/activate control of the joystick.", - "fullName": "De/activate control", - "functionType": "Action", - "name": "ActivateControl", - "sentence": "Activate control of _PARAM0_: _PARAM1_", + "description": "the maximum horizontal rotation speed of the object.", + "fullName": "Maximum horizontal rotation speed", + "functionType": "ExpressionAndCondition", + "group": "First person camera multitouch controller mapper horizontal rotation configuration", + "name": "HorizontalRotationSpeedMax", + "sentence": "the maximum horizontal rotation speed", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"ShouldActivate\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "no" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "GetArgumentAsBoolean" - }, - "parameters": [ - "\"ShouldActivate\"" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "ActivateBehavior" + "value": "SetReturnNumber" }, "parameters": [ - "Border", - "MultitouchJoystick", - "yes" + "HorizontalRotationSpeedMax" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Activate", - "name": "ShouldActivate", - "type": "yesorno" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if a stick is pressed.", - "fullName": "Stick pressed", - "functionType": "Condition", - "name": "IsPressed", - "sentence": "Stick _PARAM0_ is pressed", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationSpeedMax", + "name": "SetHorizontalRotationSpeedMax", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsPressed" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "!=" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetNumberVariable" }, "parameters": [ - "True" + "HorizontalRotationSpeedMax", + "=", + "Value" ] } ] @@ -13565,19 +13705,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the joystick force (from 0 to 1).", - "fullName": "Joystick force (deprecated)", + "description": "the horizontal rotation acceleration of the object.", + "fullName": "Horizontal rotation acceleration", "functionType": "ExpressionAndCondition", - "name": "JoystickForce", - "private": true, - "sentence": "the joystick force", + "group": "First person camera multitouch controller mapper horizontal rotation configuration", + "name": "HorizontalRotationAcceleration", + "sentence": "the horizontal rotation acceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -13588,7 +13733,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::JoystickForce()" + "HorizontalRotationAcceleration" ] } ] @@ -13601,18 +13746,23 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the strick force (from 0 to 1).", - "fullName": "Stick force", - "functionType": "ExpressionAndCondition", - "name": "StickForce", - "sentence": "the stick force", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationAcceleration", + "name": "SetHorizontalRotationAcceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -13620,34 +13770,39 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetNumberVariable" }, "parameters": [ - "Border.MultitouchJoystick::JoystickForce()" + "HorizontalRotationAcceleration", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the stick force on X axis (from -1 at the left to 1 at the right).", - "fullName": "Stick X force", + "description": "the horizontal rotation deceleration of the object.", + "fullName": "Horizontal rotation deceleration", "functionType": "ExpressionAndCondition", - "name": "StickForceX", - "sentence": "the stick X force", + "group": "First person camera multitouch controller mapper horizontal rotation configuration", + "name": "HorizontalRotationDeceleration", + "sentence": "the horizontal rotation deceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -13658,7 +13813,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::StickForceX()" + "HorizontalRotationDeceleration" ] } ] @@ -13671,18 +13826,23 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the stick force on Y axis (from -1 at the top to 1 at the bottom).", - "fullName": "Stick Y force", - "functionType": "ExpressionAndCondition", - "name": "StickForceY", - "sentence": "the stick Y force", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationDeceleration", + "name": "SetHorizontalRotationDeceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -13690,35 +13850,39 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetNumberVariable" }, "parameters": [ - "Border.MultitouchJoystick::StickForceY()" + "HorizontalRotationDeceleration", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Return the angle the joystick is pointing towards (from -180 to 180).", - "fullName": "Joystick angle (deprecated)", - "functionType": "Expression", - "name": "JoystickAngle", - "private": true, - "sentence": "", + "description": "the maximum vertical rotation speed of the object.", + "fullName": "Maximum vertical rotation speed", + "functionType": "ExpressionAndCondition", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalRotationSpeedMax", + "sentence": "the maximum vertical rotation speed", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -13729,7 +13893,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::JoystickAngle()" + "VerticalRotationSpeedMax" ] } ] @@ -13742,17 +13906,22 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Return the angle the stick is pointing towards (from -180 to 180).", - "fullName": "Stick angle", - "functionType": "Expression", - "name": "StickAngle", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationSpeedMax", + "name": "SetVerticalRotationSpeedMax", "sentence": "", "events": [ { @@ -13761,107 +13930,92 @@ "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetNumberVariable" }, "parameters": [ - "Border.MultitouchJoystick::JoystickAngle()" + "VerticalRotationSpeedMax", + "=", + "Value" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if joystick is pushed in a given direction.", - "fullName": "Joystick pushed in a direction (4-way movement)", - "functionType": "Condition", - "name": "IsDirectionPushed4Way", - "sentence": "_PARAM0_ is pushed in direction _PARAM1_", + "description": "the vertical rotation acceleration of the object.", + "fullName": "Vertical rotation acceleration", + "functionType": "ExpressionAndCondition", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalRotationAcceleration", + "sentence": "the vertical rotation acceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed4Way" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "GetArgumentAsString(\"Direction\")", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetReturnNumber" }, "parameters": [ - "True" + "VerticalRotationAcceleration" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", - "type": "stringWithSelector" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if joystick is pushed in a given direction.", - "fullName": "Joystick pushed in a direction (8-way movement)", - "functionType": "Condition", - "name": "IsDirectionPushed8Way", - "sentence": "_PARAM0_ is pushed in direction _PARAM1_", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationAcceleration", + "name": "SetVerticalRotationAcceleration", + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed8Way" - }, - "parameters": [ - "Border", - "MultitouchJoystick", - "GetArgumentAsString(\"Direction\")", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "SetNumberVariable" }, "parameters": [ - "True" + "VerticalRotationAcceleration", + "=", + "Value" ] } ] @@ -13871,25 +14025,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" }, { - "description": "Direction", - "name": "Direction", - "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", - "type": "stringWithSelector" + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the multitouch controller identifier (1, 2, 3, 4...).", - "fullName": "Multitouch controller identifier", + "description": "the vertical rotation deceleration of the object.", + "fullName": "Vertical rotation deceleration", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "ControllerIdentifier", - "sentence": "the multitouch controller identifier", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalRotationDeceleration", + "sentence": "the vertical rotation deceleration", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -13900,7 +14053,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyControllerIdentifier()" + "VerticalRotationDeceleration" ] } ] @@ -13913,8 +14066,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -13922,8 +14080,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "ControllerIdentifier", - "name": "SetControllerIdentifier", + "getterName": "VerticalRotationDeceleration", + "name": "SetVerticalRotationDeceleration", "sentence": "", "events": [ { @@ -13932,14 +14090,12 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + "value": "SetNumberVariable" }, "parameters": [ - "Border", - "MultitouchJoystick", + "VerticalRotationDeceleration", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "Value" ] } ] @@ -13949,19 +14105,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the joystick name of the object.", - "fullName": "Joystick name", + "description": "the minimum vertical camera angle of the object.", + "fullName": "Minimum vertical camera angle", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "JoystickIdentifier", - "sentence": "the joystick name", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalAngleMin", + "sentence": "the minimum vertical camera angle", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -13969,24 +14130,29 @@ "actions": [ { "type": { - "value": "SetReturnString" + "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyJoystickIdentifier()" + "VerticalAngleMin" ] } ] } ], "expressionType": { - "type": "string" + "type": "expression" }, "parameters": [ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -13994,8 +14160,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "JoystickIdentifier", - "name": "SetJoystickIdentifier", + "getterName": "VerticalAngleMin", + "name": "SetVerticalAngleMin", "sentence": "", "events": [ { @@ -14004,14 +14170,12 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + "value": "SetNumberVariable" }, "parameters": [ - "Border", - "MultitouchJoystick", + "VerticalAngleMin", "=", - "GetArgumentAsString(\"Value\")", - "" + "Value" ] } ] @@ -14021,19 +14185,24 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the dead zone radius of the joystick (range: 0 to 1). The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", - "fullName": "Dead zone radius", + "description": "the maximum vertical camera angle of the object.", + "fullName": "Maximum vertical camera angle", "functionType": "ExpressionAndCondition", - "group": "Multitouch Joystick configuration", - "name": "DeadZoneRadius", - "sentence": "the dead zone radius", + "group": "First person camera multitouch controller mapper vertical rotation configuration", + "name": "VerticalAngleMax", + "sentence": "the maximum vertical camera angle", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -14044,7 +14213,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Border.MultitouchJoystick::PropertyDeadZoneRadius()" + "VerticalAngleMax" ] } ] @@ -14057,8 +14226,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" } ], "objectGroups": [] @@ -14066,8 +14240,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "DeadZoneRadius", - "name": "SetDeadZoneRadius", + "getterName": "VerticalAngleMax", + "name": "SetVerticalAngleMax", "sentence": "", "events": [ { @@ -14076,14 +14250,92 @@ "actions": [ { "type": { - "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + "value": "SetNumberVariable" }, "parameters": [ - "Border", - "MultitouchJoystick", + "VerticalAngleMax", "=", - "GetArgumentAsNumber(\"Value\")", - "" + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the z position offset of the object.", + "fullName": "Z position offset", + "functionType": "ExpressionAndCondition", + "group": "First person camera multitouch controller mapper position configuration", + "name": "OffsetZ", + "sentence": "the z position offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "OffsetZ" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::FirstPersonMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "OffsetZ", + "name": "SetOffsetZ", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OffsetZ", + "=", + "Value" ] } ] @@ -14093,325 +14345,2952 @@ { "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", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "name": "Object3D" + }, { "value": "1", "type": "Number", - "label": "Multitouch controller identifier (1, 2, 3, 4...)", - "description": "", - "group": "", - "extraInformation": [], + "label": "Controller identifier (1, 2, 3, 4...)", "name": "ControllerIdentifier" }, { - "value": "Primary", + "value": "Secondary", "type": "Choice", - "label": "Joystick name", - "description": "", - "group": "", + "label": "Camera joystick", + "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": "", - "extraInformation": [], - "name": "DeadZoneRadius" + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "group": "Horizontal rotation", + "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", + "group": "Horizontal rotation", + "name": "HorizontalRotationAcceleration" }, { - "value": "Center-center", + "value": "720", "type": "Number", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [], - "hidden": true, - "name": "ThumbAnchorTarget" + "label": "Rotation deceleration", + "group": "Horizontal rotation", + "name": "HorizontalRotationDeceleration" }, { - "value": "true", - "type": "Boolean", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [ - "Thumb" - ], + "value": "120", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "group": "Vertical rotation", + "name": "VerticalRotationSpeedMax" + }, + { + "value": "240", + "type": "Number", + "label": "Rotation acceleration", + "group": "Vertical rotation", + "name": "VerticalRotationAcceleration" + }, + { + "value": "480", + "type": "Number", + "label": "Rotation deceleration", + "group": "Vertical rotation", + "name": "VerticalRotationDeceleration" + }, + { + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Minimum angle", + "group": "Vertical rotation", + "name": "VerticalAngleMin" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Maximum angle", + "group": "Vertical rotation", + "name": "VerticalAngleMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z position offset", + "group": "Position", + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Z", "hidden": true, - "name": "ThumbIsScaledProportionally" + "name": "CurrentRotationSpeedZ" }, { - "value": "Center-center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [], + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Y", "hidden": true, - "name": "ParentOrigin" + "name": "CurrentRotationSpeedY" } ], - "objects": [ + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a 3D physics car with a multitouch controller.", + "fullName": "3D car multitouch controller mapper", + "name": "PhysicsCar3DMultitouchMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "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::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "SteerJoystickIdentifier", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateSteeringStick" + }, + "parameters": [ + "Object", + "PhysicsCar3D", + "SpriteMultitouchJoystick::StickForceX(ControllerIdentifier, \"Primary\")" + ] } ] - } - ] - }, - { - "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": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "ControllerIdentifier", + "SpeedJoystickIdentifier", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateAcceleratorStick" + }, + "parameters": [ + "Object", + "PhysicsCar3D", + "-SpriteMultitouchJoystick::StickForceY(ControllerIdentifier, \"Secondary\")" + ] + } + ] + }, { - "name": "Idle", - "useMultipleDirections": false, - "directions": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [] + "type": { + "value": "SpriteMultitouchJoystick::IsButtonPressed" + }, + "parameters": [ + "", + "ControllerIdentifier", + "HandBrakeButton", + "\"Down\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateHandBrakeKey" + }, + "parameters": [ + "Object", + "PhysicsCar3D" + ] } ] } - ] - } - ], - "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": [ + ], + "parameters": [ { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::PhysicsCar3DMultitouchMapper", + "type": "behavior" } ], - "effects": [] + "objectGroups": [] } ], - "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": [ + "propertyDescriptors": [ { - "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", - "}" + "value": "", + "type": "Behavior", + "label": "3D physics car", + "extraInformation": [ + "Physics3D::PhysicsCar3D" ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ + "name": "PhysicsCar3D" + }, { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" }, { - "description": "Trigger button", - "name": "trigger", - "supplementaryInformation": "[\"LT\",\"RT\",\"L2\",\"R2\"]", - "type": "stringWithSelector" + "value": "Primary", + "type": "Choice", + "label": "Steer joystick", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "SteerJoystickIdentifier" + }, + { + "value": "Secondary", + "type": "Choice", + "label": "Speed joystick", + "group": "Controls", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "SpeedJoystickIdentifier" + }, + { + "value": "B", + "type": "String", + "label": "Hand brake button name", + "group": "Controls", + "name": "HandBrakeButton" } ], - "objectGroups": [] + "sharedPropertyDescriptors": [] }, { - "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", + "description": "Control a top-down character with a multitouch controller.", + "fullName": "Top-down multitouch controller mapper", + "name": "TopDownMultitouchMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "StickMode", + "=", + "\"Analog\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "StickMode", + "=", + "\"360°\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateStick" + }, + "parameters": [ + "Object", + "TopDownMovement", + "SpriteMultitouchJoystick::StickAngle(ControllerIdentifier, JoystickIdentifier)", + "sign(SpriteMultitouchJoystick::StickForce(ControllerIdentifier, JoystickIdentifier))" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "StickMode", + "=", + "\"8 Directions\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "TopDownMovementBehavior::DiagonalsAllowed" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TopDownMovementBehavior::DiagonalsAllowed" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"UpLeft\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"UpRight\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"DownLeft\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "", + "ControllerIdentifier", + "JoystickIdentifier", + "\"DownRight\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "TopDownMovementBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + }, + { + "type": { + "value": "TopDownMovementBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "TopDownMovement" + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "SpriteMultitouchJoystick::TopDownMultitouchMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "Top-down movement behavior", + "extraInformation": [ + "TopDownMovementBehavior::TopDownMovementBehavior" + ], + "name": "TopDownMovement" + }, + { + "value": "1", + "type": "Number", + "label": "Controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "extraInformation": [ + "Primary", + "Secondary" + ], + "name": "JoystickIdentifier" + }, + { + "value": "Analog", + "type": "Choice", + "label": "Stick mode", + "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", + "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": [], + "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": "BooleanVariable" + }, + "parameters": [ + "ShouldBeHiddenWhenReleased", + "True", + "" + ] + }, + { + "type": { + "inverted": true, + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::IsPressed" + }, + "parameters": [ + "Object", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Cache" + }, + "parameters": [ + "Object" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Object", + "no", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "ShouldBeHiddenWhenReleased", + "False", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::UpdateConfiguration" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Pass the object property values to the behavior.", + "fullName": "Update configuration", + "functionType": "Action", + "name": "UpdateConfiguration", + "private": true, + "sentence": "Update the configuration of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "ControllerIdentifier", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "JoystickIdentifier", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "DeadZoneRadius", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Show the joystick until it is released.", + "fullName": "Show and start pressing", + "functionType": "Action", + "name": "TeleportAndPress", + "sentence": "Show _PARAM0_ at the cursor position and start pressing", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "HasAnyTouchOrMouseStarted" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Object", + "=", + "Object.ParentTouchX(StartedTouchOrMouseId(0))", + "=", + "Object.ParentTouchY(StartedTouchOrMouseId(0))" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::SpriteMultitouchJoystick::ActivateControl" + }, + "parameters": [ + "Object", + "yes", + "" + ] + }, + { + "type": { + "value": "Montre" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "ShouldBeHiddenWhenReleased", + "True", + "" + ] + }, + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::ForceStartPressing" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "StartedTouchOrMouseId(0)", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the X position of a specified touch", + "fullName": "Touch X position (on parent)", + "functionType": "Expression", + "name": "ParentTouchX", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const touchId = eventsFunctionContext.getArgument(\"TouchId\");", + "eventsFunctionContext.returnValue = gdjs.evtTools.input.getTouchX(object.getInstanceContainer(), touchId, object.getLayer());" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Touch identifier", + "name": "TouchId", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Return the X position of a specified touch", + "fullName": "Touch X position (on parent)", + "functionType": "Expression", + "name": "ParentTouchY", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [] + }, + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const object = objects[0];", + "const touchId = eventsFunctionContext.getArgument(\"TouchId\");", + "eventsFunctionContext.returnValue = gdjs.evtTools.input.getTouchY(object.getInstanceContainer(), touchId, object.getLayer());" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Touch identifier", + "name": "TouchId", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "De/activate control of the joystick.", + "fullName": "De/activate control", + "functionType": "Action", + "name": "ActivateControl", + "sentence": "Activate control of _PARAM0_: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "ShouldActivate", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "ShouldActivate", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Activate", + "name": "ShouldActivate", + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Check if a stick is pressed.", + "fullName": "Stick pressed", + "functionType": "Condition", + "name": "IsPressed", + "sentence": "Stick _PARAM0_ is pressed", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsPressed" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "!=" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick force (from 0 to 1).", + "fullName": "Joystick force (deprecated)", + "functionType": "ExpressionAndCondition", + "name": "JoystickForce", + "private": true, + "sentence": "the joystick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickForce()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the strick force (from 0 to 1).", + "fullName": "Stick force", + "functionType": "ExpressionAndCondition", + "name": "StickForce", + "sentence": "the stick force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickForce()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the stick force on X axis (from -1 at the left to 1 at the right).", + "fullName": "Stick X force", + "functionType": "ExpressionAndCondition", + "name": "StickForceX", + "sentence": "the stick X force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::StickForceX()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the stick force on Y axis (from -1 at the top to 1 at the bottom).", + "fullName": "Stick Y force", + "functionType": "ExpressionAndCondition", + "name": "StickForceY", + "sentence": "the stick Y force", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::StickForceY()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the joystick is pointing towards (from -180 to 180).", + "fullName": "Joystick angle (deprecated)", + "functionType": "Expression", + "name": "JoystickAngle", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Return the angle the stick is pointing towards (from -180 to 180).", + "fullName": "Stick angle", + "functionType": "Expression", + "name": "StickAngle", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::JoystickAngle()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (4-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed4Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed4Way" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Check if joystick is pushed in a given direction.", + "fullName": "Joystick pushed in a direction (8-way movement)", + "functionType": "Condition", + "name": "IsDirectionPushed8Way", + "sentence": "_PARAM0_ is pushed in direction _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::IsDirectionPushed8Way" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "Direction", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + }, + { + "description": "Direction", + "name": "Direction", + "supplementaryInformation": "[\"Up\",\"Down\",\"Left\",\"Right\",\"UpLeft\",\"UpRight\",\"DownLeft\",\"DownRight\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "the multitouch controller identifier (1, 2, 3, 4...).", + "fullName": "Multitouch controller identifier", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "ControllerIdentifier", + "sentence": "the multitouch controller identifier", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyControllerIdentifier()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ControllerIdentifier", + "name": "SetControllerIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetControllerIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the joystick name of the object.", + "fullName": "Joystick name", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "JoystickIdentifier", + "sentence": "the joystick name", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyJoystickIdentifier()" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "JoystickIdentifier", + "name": "SetJoystickIdentifier", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetJoystickIdentifier" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the dead zone radius of the joystick (range: 0 to 1). The deadzone is an area for which movement on sticks won't be taken into account (instead, the stick will be considered as not moved).", + "fullName": "Dead zone radius", + "functionType": "ExpressionAndCondition", + "group": "Multitouch Joystick configuration", + "name": "DeadZoneRadius", + "sentence": "the dead zone radius", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Border.MultitouchJoystick::PropertyDeadZoneRadius()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DeadZoneRadius", + "name": "SetDeadZoneRadius", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SpriteMultitouchJoystick::MultitouchJoystick::SetDeadZoneRadius" + }, + "parameters": [ + "Border", + "MultitouchJoystick", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "SpriteMultitouchJoystick::SpriteMultitouchJoystick", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "1", + "type": "Number", + "label": "Multitouch controller identifier (1, 2, 3, 4...)", + "name": "ControllerIdentifier" + }, + { + "value": "Primary", + "type": "Choice", + "label": "Joystick name", + "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)", + "name": "DeadZoneRadius" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "extraInformation": [ + "Thumb" + ], + "hidden": true, + "name": "ThumbAnchorOrigin" + }, + { + "value": "Center-center", + "type": "Number", + "label": "", + "description": "Only used by the scene editor.", + "hidden": true, + "name": "ThumbAnchorTarget" + }, + { + "value": "true", + "type": "Boolean", + "label": "", + "description": "Only used by the scene editor.", + "extraInformation": [ + "Thumb" + ], + "hidden": true, + "name": "ThumbIsScaledProportionally" + }, + { + "value": "Center-center", + "type": "String", + "label": "", + "description": "Only used by the scene editor.", + "hidden": true, + "name": "ParentOrigin" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "hidden": true, + "name": "ShouldBeHiddenWhenReleased" + } + ], + "variants": [] + } + ] + }, + { + "author": "Bouh", + "category": "Input", + "extensionNamespace": "", + "fullName": "Gamepads (controllers)", + "gdevelopVersion": ">=5.5.222", + "helpPath": "/all-features/gamepad", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWdhbWVwYWQtdmFyaWFudC1vdXRsaW5lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTYsOUg4VjExSDEwVjEzSDhWMTVINlYxM0g0VjExSDZWOU0xOC41LDlBMS41LDEuNSAwIDAsMSAyMCwxMC41QTEuNSwxLjUgMCAwLDEgMTguNSwxMkExLjUsMS41IDAgMCwxIDE3LDEwLjVBMS41LDEuNSAwIDAsMSAxOC41LDlNMTUuNSwxMkExLjUsMS41IDAgMCwxIDE3LDEzLjVBMS41LDEuNSAwIDAsMSAxNS41LDE1QTEuNSwxLjUgMCAwLDEgMTQsMTMuNUExLjUsMS41IDAgMCwxIDE1LjUsMTJNMTcsNUE3LDcgMCAwLDEgMjQsMTJBNyw3IDAgMCwxIDE3LDE5QzE1LjA0LDE5IDEzLjI3LDE4LjIgMTIsMTYuOUMxMC43MywxOC4yIDguOTYsMTkgNywxOUE3LDcgMCAwLDEgMCwxMkE3LDcgMCAwLDEgNyw1SDE3TTcsN0E1LDUgMCAwLDAgMiwxMkE1LDUgMCAwLDAgNywxN0M4LjY0LDE3IDEwLjA5LDE2LjIxIDExLDE1SDEzQzEzLjkxLDE2LjIxIDE1LjM2LDE3IDE3LDE3QTUsNSAwIDAsMCAyMiwxMkE1LDUgMCAwLDAgMTcsN0g3WiIgLz48L3N2Zz4=", + "name": "Gamepads", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/gamepad-variant-outline.svg", + "shortDescription": "Add support for gamepads (or other controllers) to your game, giving access to information such as button presses, axis positions, trigger pressure, etc...", + "version": "0.8.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": [ + { + "name": "Buttons", + "type": "structure", + "children": [ + { + "name": "A or Cross", + "type": "string", + "value": "A" + }, + { + "name": "B or Circle", + "type": "string", + "value": "B" + }, + { + "name": "LB or L1", + "type": "string", + "value": "LB" + }, + { + "name": "LT or L2", + "type": "string", + "value": "LT" + }, + { + "name": "RB or R1", + "type": "string", + "value": "RB" + }, + { + "name": "RT or R2", + "type": "string", + "value": "RT" + }, + { + "name": "X or Square", + "type": "string", + "value": "X" + }, + { + "name": "Y or Triangle", + "type": "string", + "value": "Y" + } + ] + } + ], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onFirstSceneLoaded", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::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": "NumberVariable" + }, + "parameters": [ + "TargetedSpeed", + "<", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Reduce the speed to match the stick force." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "-", + "Acceleration * TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Turn back at least as fast as it would stop." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TargetedSpeed", + ">", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Reduce the speed to match the stick force." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "TargetedSpeed" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(TargetedSpeed, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "TargetedSpeed" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "+", + "Acceleration * TimeDelta()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Turn back at least as fast as it would stop." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(TargetedSpeed, CurrentSpeed + max(Acceleration , Deceleration) * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "TargetedSpeed", + "=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "min(0, CurrentSpeed + Acceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "CurrentSpeed", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "AcceleratedSpeed", + "=", + "max(0, CurrentSpeed - Acceleration * TimeDelta())" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "clamp(AcceleratedSpeed, -SpeedMax, SpeedMax)" + ] + } + ] + } + ], + "variables": [ + { + "name": "AcceleratedSpeed", + "type": "number", + "value": 0 + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Current speed", + "name": "CurrentSpeed", + "type": "expression" + }, + { + "description": "Targeted speed", + "name": "TargetedSpeed", + "type": "expression" + }, + { + "description": "Max speed", + "name": "SpeedMax", + "type": "expression" + }, + { + "description": "Acceleration", + "name": "Acceleration", + "type": "expression" + }, + { + "description": "Deceleration", + "name": "Deceleration", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Get the value of the pressure on a gamepad trigger.", + "fullName": "Pressure on a gamepad trigger", + "functionType": "Expression", + "name": "TriggerPressure", + "sentence": "Player _PARAM1_ push axis _PARAM2_ to _PARAM3_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "/** @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", @@ -14489,7 +17368,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Gamepads::StickAngle(GetArgumentAsNumber(\"player_ID\"), GetArgumentAsString(\"stick\"))" + "Gamepads::StickAngle(player_ID, stick)" ] } ] @@ -14697,10 +17576,336 @@ " }\r", " break;\r", "\r", - " default:\r", - " break;\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, @@ -14715,28 +17920,16 @@ "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": "", + "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", @@ -14744,16 +17937,11 @@ "/** @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", + "//Get function parameter\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\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 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", @@ -14761,8 +17949,31 @@ "//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", + "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": "", @@ -14770,30 +17981,21 @@ "eventsSheetExpanded": true } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Gamepad", + "name": "player_ID", "type": "expression" - }, - { - "description": "Stick: \"Left\" or \"Right\"", - "name": "Stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" } ], "objectGroups": [] }, { - "description": "Return the gamepad stick force on Y axis (from -1 at the top to 1 at the bottom).", - "fullName": "Stick Y force", - "functionType": "Expression", - "name": "StickForceY", - "sentence": "", + "description": "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", @@ -14802,25 +18004,31 @@ "const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);\r", "\r", "//Get function parameters\r", - "const playerId = eventsFunctionContext.getArgument(\"Gamepad\") - 1;\r", - "const stick = eventsFunctionContext.getArgument(\"Stick\").toLowerCase();\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", + "const controllerType = eventsFunctionContext.getArgument(\"controller_type\").toUpperCase();\r", "\r", "if (playerId < 0 || playerId > 4) {\r", - " console.error('Parameter gamepad identifier is not valid in expression: \"Value of a gamepad axis\"');\r", + " console.error('Parameter gamepad identifier in string expression: \"Last pressed button (LastButtonString)\", is not valid number, must be between 0 and 4.');\r", " return;\r", "}\r", - "if (stick != \"left\" && stick != \"right\") {\r", - " console.error('Parameter stick is not valid in expression: \"Value of a gamepad axis\"');\r", + "if (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", - "//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", + "if (gamepad !== null) { //Gamepad exist\r", + " //Get last btn id\r", + " const lastButtonUsedID = gdjs._extensionController.players[playerId].lastButtonUsed;\r", "\r", - "const axisIndex = stick === 'right' ? 3 : 1;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.getNormalizedAxisValue(gamepad.axes[axisIndex], playerId);\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, @@ -14828,29 +18036,65 @@ } ], "expressionType": { - "type": "expression" + "type": "string" }, "parameters": [ { "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Gamepad", + "name": "player_ID", "type": "expression" }, { - "description": "Stick: \"Left\" or \"Right\"", - "name": "Stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", + "description": "Controller type", + "name": "controller_type", + "supplementaryInformation": "[\"Xbox\",\"PS4\"]", "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", + "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_released", - "sentence": "Button _PARAM2_ of gamepad _PARAM1_ is released", + "name": "C_Button_pressed", + "sentence": "Button _PARAM2_ of gamepad _PARAM1_ is pressed", "events": [ { "type": "BuiltinCommonInstructions::JsCode", @@ -14863,11 +18107,12 @@ "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", + " 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 released\"');\r", + " console.error('Parameter button is not valid in condition: \"Gamepad button pressed\"');\r", + " eventsFunctionContext.returnValue = false;\r", " return;\r", "}\r", "\r", @@ -14950,40 +18195,371 @@ " break;\r", "\r", " default:\r", - " console.error('The button: ' + button + ' in condition: \"Gamepad button released\" is not valid.');\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 released\"');\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 released\"');\r", + " console.error('Buttons on the gamepad are not accessible in condition: \"Gamepad button pressed\"');\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", + "//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", - "//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", + "" + ], + "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": "", @@ -14991,111 +18567,99 @@ "eventsSheetExpanded": true } ], + "expressionType": { + "type": "string" + }, "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": "", + "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": [ - "//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;" + "/** @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 } ], - "expressionType": { - "type": "expression" - }, "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 any button is pressed on a gamepad.", - "fullName": "Any gamepad button pressed", + "description": "Check if a gamepad is connected.", + "fullName": "Gamepad connected", "functionType": "Condition", - "name": "C_Any_Button_pressed", - "sentence": "Any button of gamepad _PARAM1_ is pressed", + "name": "C_Controller_X_is_connected", + "sentence": "Gamepad _PARAM1_ is plugged and connected", "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", - "" + "/** @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, @@ -15112,43 +18676,40 @@ "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", + "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[]} */\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", + "/** @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": "", @@ -15156,1791 +18717,2323 @@ "eventsSheetExpanded": true } ], - "expressionType": { - "type": "string" - }, "parameters": [ { "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", + "name": "Player_ID", "type": "expression" }, { - "description": "Controller type", - "name": "controller_type", - "supplementaryInformation": "[\"Xbox\",\"PS4\"]", - "type": "stringWithSelector" + "description": "Time of the vibration, in seconds (optional, default value is 1)", + "name": "Duration", + "type": "expression" } ], "objectGroups": [] }, { - "description": "Return the number of gamepads.", - "fullName": "Gamepad count", - "functionType": "Expression", - "name": "GamepadCount", - "sentence": "", + "description": "Generate an advanced vibration on the specified controller. Incompatible with Firefox.", + "fullName": "Advanced gamepad vibration", + "functionType": "Action", + "name": "A_Advanced_Vibration_Controller", + "sentence": "Make gamepad _PARAM1_ vibrate for _PARAM2_ seconds with the vibration magnitude of _PARAM3_ and _PARAM4_", "events": [ { "type": "BuiltinCommonInstructions::JsCode", "inlineCode": [ - "const 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", - "" + "/** @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 } ], - "expressionType": { - "type": "expression" - }, - "parameters": [], + "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": "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", + "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[]} */\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", + "/** @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", - " //PS4\r", - " case 'PS_BUTTON':\r", - " buttonId = 16;\r", - " break;\r", - " case 'CLICK_TOUCHPAD':\r", - " buttonId = 17;\r", - " break;\r", + "//Get function parameters\r", + "const playerId = eventsFunctionContext.getArgument(\"player_ID\") - 1;\r", "\r", - " default:\r", - " console.error('The button: ' + button + ' in condition: \"Gamepad button pressed\" is not valid.');\r", - " eventsFunctionContext.returnValue = false;\r", - " break;\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", - "if (buttonId === undefined) {\r", - " console.error('There is no buttons valid in condition: \"Gamepad button pressed\"');\r", - " eventsFunctionContext.returnValue = false;\r", - " return;\r", - "}\r", + "for (let buttonId = 0; buttonId < gamepad.buttons.length; buttonId++) { //For each buttons on current frame.\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", + "\tif (buttonId === undefined) {\r", + "\t\teventsFunctionContext.returnValue = false;\r", + "\t\treturn;\r", + "\t}\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", + "\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" - }, - { - "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 + } + ], + "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": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "GamepadIdentifier", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "UseArrows", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Up\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + }, + { + "type": { + "value": "PlatformBehavior::SimulateLadderKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Down\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "UseLeftStick", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + }, + { + "type": { + "value": "PlatformBehavior::SimulateLadderKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "UseRightStick", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Left\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateLeftKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Right\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateRightKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Up\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateUpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + }, + { + "type": { + "value": "PlatformBehavior::SimulateLadderKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Down\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateDownKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "Buttons[JumpButton]", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "PlatformBehavior::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PlatformerCharacter" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::PlatformerGamepadMapper", + "type": "behavior" + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "objectGroups": [] } ], - "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": [ + "propertyDescriptors": [ { - "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", - "" + "value": "", + "type": "Behavior", + "label": "Platformer character behavior", + "extraInformation": [ + "PlatformBehavior::PlatformerObjectBehavior" ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ - { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "player_ID", - "type": "expression" + "name": "PlatformerCharacter" }, { - "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" + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "name": "GamepadIdentifier" }, { - "description": "Stick: \"Left\" or \"Right\"", - "name": "stick", - "supplementaryInformation": "[\"Left\",\"Right\"]", - "type": "stringWithSelector" + "value": "true", + "type": "Boolean", + "label": "Use directional pad", + "group": "Controls", + "name": "UseArrows" }, { - "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 left stick", + "group": "Controls", + "name": "UseLeftStick" + }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] + "value": "", + "type": "Boolean", + "label": "Use right stick", + "group": "Controls", + "name": "UseRightStick" }, { - "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", - "" + "value": "A or Cross", + "type": "Choice", + "label": "Jump button", + "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" } ], - "expressionType": { - "type": "expression" - }, - "parameters": [], - "objectGroups": [] + "sharedPropertyDescriptors": [] }, { - "description": "Return a string containing informations about the specified gamepad.", - "fullName": "Gamepad type", - "functionType": "StringExpression", - "name": "GamepadType", - "sentence": "Player _PARAM1_ use _PARAM2_ controller", - "events": [ + "description": "Control a 3D physics character with a gamepad.", + "fullName": "3D platformer gamepad mapper", + "name": "Platformer3DGamepadMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ { - "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)", - "" + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "GamepadIdentifier", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "GamepadIdentifier", + "JoystickIdentifier", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SetForwardAngle" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D", + "=", + "Gamepads::StickAngle(GamepadIdentifier, JoystickIdentifier) + CameraAngle(Object.Layer())" + ] + }, + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D", + "-90", + "Gamepads::StickForce(GamepadIdentifier, JoystickIdentifier)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "Buttons[JumpButton]", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + } + ] + } ], - "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", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::Platformer3DGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] } ], - "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": [ + "propertyDescriptors": [ { - "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;", - "}" + "value": "", + "type": "Behavior", + "label": "3D physics character", + "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)", + "name": "GamepadIdentifier" }, { - "description": "Type: \"Xbox\", \"PS4\", \"Steam\" or \"PS3\" (among other)", - "name": "controller_type", - "type": "string" + "value": "Left", + "type": "Choice", + "label": "Walk joystick", + "group": "Controls", + "extraInformation": [ + "Left", + "Right" + ], + "name": "JoystickIdentifier" + }, + { + "value": "A or Cross", + "type": "Choice", + "label": "Jump button", + "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": "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": "Control a 3D physics character with a gamepad.", + "fullName": "3D shooter gamepad mapper", + "name": "Shooter3DGamepadMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ { - "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];" + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "GamepadIdentifier", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::StickForce" + }, + "parameters": [ + "", + ">", + "0", + "GamepadIdentifier", + "WalkStick", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateStick" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D", + "Gamepads::StickAngle(GamepadIdentifier, WalkStick)", + "Gamepads::StickForce(GamepadIdentifier, WalkStick)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "Buttons[JumpButton]", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCharacter3D::SimulateJumpKey" + }, + "parameters": [ + "Object", + "PhysicsCharacter3D" + ] + } + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::Shooter3DGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] } ], - "parameters": [ + "propertyDescriptors": [ { - "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": "", + "type": "Behavior", + "label": "3D physics character", + "extraInformation": [ + "Physics3D::PhysicsCharacter3D" + ], + "name": "PhysicsCharacter3D" + }, { - "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": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "name": "GamepadIdentifier" + }, + { + "value": "Left", + "type": "Choice", + "label": "Walk joystick", + "group": "Controls", + "extraInformation": [ + "Left", + "Right" ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [ + "name": "WalkStick" + }, { - "description": "The gamepad identifier: 1, 2, 3 or 4", - "name": "Player_ID", - "type": "expression" + "value": "Right", + "type": "Choice", + "label": "Camera joystick", + "group": "Controls", + "extraInformation": [ + "Left", + "Right" + ], + "name": "CameraStick" }, { - "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", + "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 camera rotations with a gamepad.", + "fullName": "First person camera gamepad mapper", + "name": "FirstPersonGamepadMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "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::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "TODO It's probably a bad idea to rotate the object around Y." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CurrentRotationSpeedZ", + "=", + "Gamepads::AcceleratedSpeed(CurrentRotationSpeedZ, Gamepads::StickForceX(GamepadIdentifier, CameraStick) * HorizontalRotationSpeedMax, HorizontalRotationSpeedMax, HorizontalRotationAcceleration, HorizontalRotationDeceleration)" + ] + }, + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Object", + "+", + "CurrentRotationSpeedZ * TimeDelta()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CurrentRotationSpeedY", + "=", + "Gamepads::AcceleratedSpeed(CurrentRotationSpeedY, Gamepads::StickForceY(GamepadIdentifier, CameraStick) * VerticalRotationSpeedMax, VerticalRotationSpeedMax, VerticalRotationAcceleration, VerticalRotationDeceleration)" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "+", + "CurrentRotationSpeedY * TimeDelta()" + ] + }, + { + "type": { + "value": "Scene3D::Base3DBehavior::SetRotationY" + }, + "parameters": [ + "Object", + "Object3D", + "=", + "clamp(Object.Object3D::RotationY(), VerticalAngleMin, VerticalAngleMax)" + ] + }, + { + "type": { + "value": "Gamepads::FirstPersonGamepadMapper::LookFromObjectEyes" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Move the camera to look though _PARAM1_ eyes. The object must look to the right when all its angles are 0 and the top of its head be toward Z+.", + "fullName": "Look through object eyes", + "functionType": "Action", + "group": "Layers and cameras", + "name": "LookFromObjectEyes", + "private": true, + "sentence": "Move the camera to look though _PARAM0_ eyes", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "CentreCamera" + }, + "parameters": [ + "", + "Object", + "", + "Object.Layer()", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraZ" + }, + "parameters": [ + "", + "=", + "Object.Object3D::Z() + Object.Object3D::Depth() + OffsetZ", + "", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraRotationX" + }, + "parameters": [ + "", + "=", + "- Object.Object3D::RotationY() + 90", + "GetArgumentAsString(\"Layer\")", + "" + ] + }, + { + "type": { + "value": "Scene3D::SetCameraRotationY" + }, + "parameters": [ + "", + "=", + "Object.Object3D::RotationX()", + "GetArgumentAsString(\"Layer\")", + "" + ] + }, + { + "type": { + "value": "SetCameraAngle" + }, + "parameters": [ + "", + "=", + "Object.Angle() + 90", + "Object.Layer()", + "" + ] + } + ] + } ], - "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" + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "description": "Strong rumble magnitude (from 0 to 1)", - "name": "StrongMagnitude", - "type": "expression" + "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": [] }, { - "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;" + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationSpeedMax", + "name": "SetHorizontalRotationSpeedMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "HorizontalRotationSpeedMax", + "=", + "Value" + ] + } + ] + } ], - "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", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "description": "Strong rumble magnitude (from 0 to 1)", - "name": "StrongMagnitude", - "type": "expression" + "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": [] }, { - "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": [] + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationAcceleration", + "name": "SetHorizontalRotationAcceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "HorizontalRotationAcceleration", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] }, { - "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", - "};" + "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" + ] + } + ] + } ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": true - } - ], - "parameters": [], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onScenePostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [] + "expressionType": { + "type": "expression" + }, + "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;", - " }", - "", - "", - "}", - "" + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "HorizontalRotationDeceleration", + "name": "SetHorizontalRotationDeceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "HorizontalRotationDeceleration", + "=", + "Value" + ] + } + ] + } ], - "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": [] + "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": "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" + ] + } + ] + } ], - "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": "VerticalRotationSpeedMax", + "name": "SetVerticalRotationSpeedMax", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "VerticalRotationSpeedMax", + "=", + "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 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": [] + }, { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const playerId = eventsFunctionContext.getArgument(\"Player_ID\") - 1;\r", - "eventsFunctionContext.returnValue = gdjs._extensionController.players[playerId].rumble.strongMagnitude;" + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationAcceleration", + "name": "SetVerticalRotationAcceleration", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "VerticalRotationAcceleration", + "=", + "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 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": "Action", - "name": "doStepPreEvents", + "functionType": "ActionWithOperator", + "getterName": "VerticalRotationDeceleration", + "name": "SetVerticalRotationDeceleration", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "Gamepads::C_Controller_X_is_connected" + "value": "SetNumberVariable" }, "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "" + "VerticalRotationDeceleration", + "=", + "Value" ] } - ], - "actions": [], - "events": [ + ] + } + ], + "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::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": [ + "VerticalAngleMin" ] - }, + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "VerticalAngleMin", + "name": "SetVerticalAngleMin", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "VerticalAngleMin", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the maximum vertical camera angle of the object.", + "fullName": "Maximum vertical camera angle", + "functionType": "ExpressionAndCondition", + "group": "First person camera gamepad mapper vertical rotation configuration", + "name": "VerticalAngleMax", + "sentence": "the maximum vertical camera angle", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "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": "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::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": "SetNumberVariable" + }, + "parameters": [ + "VerticalAngleMax", + "=", + "Value" ] - }, + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the z position offset of the object.", + "fullName": "Z position offset", + "functionType": "ExpressionAndCondition", + "group": "First person camera gamepad mapper position configuration", + "name": "OffsetZ", + "sentence": "the z position offset", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "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": [ + "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", - "=", - "\"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": "SetNumberVariable" + }, + "parameters": [ + "OffsetZ", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "Gamepads::FirstPersonGamepadMapper", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "", + "type": "Behavior", + "label": "3D capability", + "extraInformation": [ + "Scene3D::Base3DBehavior" + ], + "name": "Object3D" + }, + { + "value": "1", + "type": "Number", + "label": "Gamepad identifier (1, 2, 3 or 4)", + "name": "GamepadIdentifier" + }, + { + "value": "Right", + "type": "Choice", + "label": "Camera joystick", + "extraInformation": [ + "Left", + "Right" + ], + "name": "CameraStick" + }, + { + "value": "180", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "group": "Horizontal rotation", + "name": "HorizontalRotationSpeedMax" + }, + { + "value": "360", + "type": "Number", + "label": "Rotation acceleration", + "group": "Horizontal rotation", + "name": "HorizontalRotationAcceleration" + }, + { + "value": "720", + "type": "Number", + "label": "Rotation deceleration", + "group": "Horizontal rotation", + "name": "HorizontalRotationDeceleration" + }, + { + "value": "120", + "type": "Number", + "unit": "AngularSpeed", + "label": "Maximum rotation speed", + "group": "Vertical rotation", + "name": "VerticalRotationSpeedMax" + }, + { + "value": "240", + "type": "Number", + "label": "Rotation acceleration", + "group": "Vertical rotation", + "name": "VerticalRotationAcceleration" + }, + { + "value": "480", + "type": "Number", + "label": "Rotation deceleration", + "group": "Vertical rotation", + "name": "VerticalRotationDeceleration" + }, + { + "value": "-90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Minimum angle", + "group": "Vertical rotation", + "name": "VerticalAngleMin" + }, + { + "value": "90", + "type": "Number", + "unit": "DegreeAngle", + "label": "Maximum angle", + "group": "Vertical rotation", + "name": "VerticalAngleMax" + }, + { + "value": "0", + "type": "Number", + "unit": "Pixel", + "label": "Z position offset", + "group": "Position", + "name": "OffsetZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Z", + "hidden": true, + "name": "CurrentRotationSpeedZ" + }, + { + "value": "0", + "type": "Number", + "unit": "AngularSpeed", + "label": "Current rotation speed Y", + "hidden": true, + "name": "CurrentRotationSpeedY" + } + ], + "sharedPropertyDescriptors": [] + }, + { + "description": "Control a 3D physics car with a gamepad.", + "fullName": "3D car gamepad mapper", + "name": "PhysicsCar3DGamepadMapper", + "objectType": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Controller_X_is_connected" + }, + "parameters": [ + "", + "GamepadIdentifier", + "" ] - }, + } + ], + "actions": [], + "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"X or Square\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" + "value": "BooleanVariable" }, "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"X\"", - "\"Left\"" + "UseArrows", + "True", + "" ] } ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "actions": [], + "events": [ { - "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"Y or Triangle\"" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Left\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateLeftKey" + }, + "parameters": [ + "Object", + "PhysicsCar3D" + ] + } ] }, { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"Y\"", - "\"Left\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "GamepadIdentifier", + "\"Right\"", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateRightKey" + }, + "parameters": [ + "Object", + "PhysicsCar3D" + ] + } ] } ] @@ -16950,35 +21043,44 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"LB or L1\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" + "value": "BooleanVariable" }, "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"LB\"", - "\"Left\"" + "UseLeftStick", + "True", + "" ] } ], - "actions": [ + "actions": [], + "events": [ { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "1", + "\"Left\"", + "\"Any\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateSteeringStick" + }, + "parameters": [ + "Object", + "PhysicsCar3D", + "Gamepads::StickForceX(GamepadIdentifier, \"Left\")" + ] + } ] } ] @@ -16988,35 +21090,44 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"RB or R1\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" + "value": "BooleanVariable" }, "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"RB\"", - "\"Left\"" + "UseRightStick", + "True", + "" ] } ], - "actions": [ + "actions": [], + "events": [ { - "type": { - "value": "PlatformBehavior::SimulateJumpKey" - }, - "parameters": [ - "Object", - "PlatformerCharacter" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Gamepads::C_Axis_pushed" + }, + "parameters": [ + "", + "1", + "\"Right\"", + "\"Any\"", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Physics3D::PhysicsCar3D::SimulateSteeringStick" + }, + "parameters": [ + "Object", + "PhysicsCar3D", + "Gamepads::StickForceX(GamepadIdentifier, \"Right\")" + ] + } ] } ] @@ -17026,35 +21137,44 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyJumpButton" - }, - "parameters": [ - "Object", - "Behavior", - "=", - "\"LT or L2\"" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "", - "Object.Behavior::PropertyGamepadIdentifier()", - "\"LT\"", - "\"Left\"" + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "1", + "\"LT\"", + "\"Up\"" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "1", + "\"RT\"", + "\"Up\"" + ] + } ] } ], "actions": [ { "type": { - "value": "PlatformBehavior::SimulateJumpKey" + "value": "Physics3D::PhysicsCar3D::SimulateAcceleratorStick" }, "parameters": [ "Object", - "PlatformerCharacter" + "PhysicsCar3D", + "Gamepads::TriggerPressure(GamepadIdentifier, \"RT\") - Gamepads::TriggerPressure(GamepadIdentifier, \"LT\")" ] } ] @@ -17062,25 +21182,14 @@ { "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\"", + "GamepadIdentifier", + "Buttons[HandBrakeButton]", "\"Left\"" ] } @@ -17088,11 +21197,11 @@ "actions": [ { "type": { - "value": "PlatformBehavior::SimulateJumpKey" + "value": "Physics3D::PhysicsCar3D::SimulateHandBrakeKey" }, "parameters": [ "Object", - "PlatformerCharacter" + "PhysicsCar3D" ] } ] @@ -17109,7 +21218,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "Gamepads::PlatformerGamepadMapper", + "supplementaryInformation": "Gamepads::PhysicsCar3DGamepadMapper", "type": "behavior" } ], @@ -17120,55 +21229,43 @@ { "value": "", "type": "Behavior", - "label": "Platformer character behavior", - "description": "", - "group": "", + "label": "3D physics car", "extraInformation": [ - "PlatformBehavior::PlatformerObjectBehavior" + "Physics3D::PhysicsCar3D" ], - "name": "PlatformerCharacter" + "name": "PhysicsCar3D" }, { "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": "A or Cross", + "value": "B or Circle", "type": "Choice", - "label": "Jump button", - "description": "", + "label": "Hand brake button", "group": "Controls", "extraInformation": [ "A or Cross", @@ -17180,7 +21277,7 @@ "LT or L2", "RT or R2" ], - "name": "JumpButton" + "name": "HandBrakeButton" } ], "sharedPropertyDescriptors": [] @@ -17190,6 +21287,7 @@ "fullName": "Top-down gamepad mapper", "name": "TopDownGamepadMapper", "objectType": "", + "quickCustomizationVisibility": "hidden", "eventsFunctions": [ { "fullName": "", @@ -17206,7 +21304,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "" ] } @@ -17218,11 +21316,12 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseArrows" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "UseArrows", + "True", + "" ] } ], @@ -17237,7 +21336,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Left\"", "\"Left\"" ] @@ -17264,7 +21363,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Right\"", "\"Left\"" ] @@ -17291,7 +21390,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Up\"", "\"Left\"" ] @@ -17318,7 +21417,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Down\"", "\"Left\"" ] @@ -17343,11 +21442,12 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseLeftStick" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "UseLeftStick", + "True", + "" ] } ], @@ -17358,11 +21458,10 @@ "conditions": [ { "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "StickMode", "=", "\"Analog\"" ] @@ -17376,8 +21475,8 @@ "parameters": [ "Object", "TopDownMovement", - "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")", - "Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Left\")" + "Gamepads::StickRotationValue(GamepadIdentifier, \"Left\")", + "Gamepads::StickForce(GamepadIdentifier, \"Left\")" ] } ] @@ -17387,11 +21486,10 @@ "conditions": [ { "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "StickMode", "=", "\"360°\"" ] @@ -17405,8 +21503,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\"))" ] } ] @@ -17416,11 +21514,10 @@ "conditions": [ { "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "StickMode", "=", "\"8 Directions\"" ] @@ -17437,7 +21534,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Left\"", "\"Left\"", "" @@ -17465,7 +21562,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Left\"", "\"Right\"", "" @@ -17493,7 +21590,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Left\"", "\"Up\"", "" @@ -17521,7 +21618,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Left\"", "\"Down\"", "" @@ -17549,11 +21646,12 @@ "conditions": [ { "type": { - "value": "Gamepads::PlatformerGamepadMapper::PropertyUseRightStick" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "UseRightStick", + "True", + "" ] } ], @@ -17564,11 +21662,10 @@ "conditions": [ { "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "StickMode", "=", "\"Analog\"" ] @@ -17582,8 +21679,8 @@ "parameters": [ "Object", "TopDownMovement", - "Gamepads::StickRotationValue(Object.Behavior::PropertyGamepadIdentifier(), \"Right\")", - "Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Right\")" + "Gamepads::StickRotationValue(GamepadIdentifier, \"Right\")", + "Gamepads::StickForce(GamepadIdentifier, \"Right\")" ] } ] @@ -17593,11 +21690,10 @@ "conditions": [ { "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "StickMode", "=", "\"360°\"" ] @@ -17611,7 +21707,7 @@ "parameters": [ "Object", "TopDownMovement", - "sign(Gamepads::StickForce(Object.Behavior::PropertyGamepadIdentifier(), \"Right\"))", + "sign(Gamepads::StickForce(GamepadIdentifier, \"Right\"))", "1" ] } @@ -17622,11 +21718,10 @@ "conditions": [ { "type": { - "value": "Gamepads::TopDownGamepadMapper::PropertyStickMode" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "StickMode", "=", "\"8 Directions\"" ] @@ -17643,7 +21738,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Right\"", "\"Left\"", "" @@ -17671,7 +21766,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Right\"", "\"Right\"", "" @@ -17699,7 +21794,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Right\"", "\"Up\"", "" @@ -17727,7 +21822,7 @@ }, "parameters": [ "", - "Object.Behavior::PropertyGamepadIdentifier()", + "GamepadIdentifier", "\"Right\"", "\"Down\"", "" @@ -17774,8 +21869,6 @@ "value": "", "type": "Behavior", "label": "Top-down movement behavior", - "description": "", - "group": "", "extraInformation": [ "TopDownMovementBehavior::TopDownMovementBehavior" ], @@ -17785,43 +21878,33 @@ "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", @@ -17841,17 +21924,18 @@ "category": "Movement", "extensionNamespace": "", "fullName": "Stick objects to others", + "gdevelopVersion": ">=5.5.222", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXN0aWNrZXItb3V0bGluZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik01LjUgMkMzLjYgMiAyIDMuNiAyIDUuNVYxOC41QzIgMjAuNCAzLjYgMjIgNS41IDIySDE2TDIyIDE2VjUuNUMyMiAzLjYgMjAuNCAyIDE4LjUgMkg1LjVNNS44IDRIMTguM0MxOS4zIDQgMjAuMSA0LjggMjAuMSA1LjhWMTVIMTguNkMxNi43IDE1IDE1LjEgMTYuNiAxNS4xIDE4LjVWMjBINS44QzQuOCAyMCA0IDE5LjIgNCAxOC4yVjUuOEM0IDQuOCA0LjggNCA1LjggNCIgLz48L3N2Zz4=", "name": "Sticker", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/sticker-outline.svg", "shortDescription": "Make objects follow the position and rotation of the object they are stuck to.", - "version": "0.5.1", + "version": "0.5.3", "description": [ "This extension can be useful to:", - "* Stick accessories to moving objects", - "* Animate a skeleton", - "* Delete an object with another one", + "- Stick accessories to moving objects", + "- Animate a skeleton", + "- Delete an object with another one", "", "An example allows to check it out ([open the project online](https://editor.gdevelop.io/?project=example://stick-objects))." ], @@ -17986,8 +22070,10 @@ " const deltaX = object.getCenterXInScene() - this.basisOldCenterXInScene;", " const deltaY = object.getCenterYInScene() - this.basisOldCenterYInScene;", " const angle = this.basisOldAngle * Math.PI / 180;", - " this.relativeRotatedX = (deltaX * Math.cos(angle) + deltaY * Math.sin(angle)) / this.basisOldWidth;", - " this.relativeRotatedY = (-deltaX * Math.sin(angle) + deltaY * Math.cos(angle)) / this.basisOldHeight;", + " const cosA = Math.cos(angle);", + " const sinA = Math.sin(angle);", + " this.relativeRotatedX = (deltaX * cosA + deltaY * sinA) / this.basisOldWidth;", + " this.relativeRotatedY = (-deltaX * sinA + deltaY * cosA) / this.basisOldHeight;", "", " // Save initial values to avoid calculus and rounding errors", " this.basisOriginalWidth = this.basisObject.getWidth();", @@ -18033,78 +22119,104 @@ " }", " this.followingDoneThisFrame = true;", " const basisObject = this.basisObject;", - " if (basisObject) {", - " // If the behavior on the basis object has a different name,", - " // the objects will still follow their basis objects", - " // but frame delays could happen.", - " const behaviorName = this.behavior.getName();", - " if (basisObject.hasBehavior(behaviorName)) {", - " const basisBehavior = basisObject.getBehavior(behaviorName);", - " if (basisBehavior.type === this.behavior.type) {", - " // Follow parents 1st to avoid frame delays", - " basisBehavior._sticker.followBasisObject();", - " }", + " if (!basisObject) {", + " return;", + " }", + " // If the behavior on the basis object has a different name,", + " // the objects will still follow their basis objects", + " // but frame delays could happen.", + " const behaviorName = this.behavior.getName();", + " if (basisObject.hasBehavior(behaviorName)) {", + " const basisBehavior = basisObject.getBehavior(behaviorName);", + " if (basisBehavior.type === this.behavior.type) {", + " // Follow parents 1st to avoid frame delays", + " basisBehavior._sticker.followBasisObject();", " }", + " }", + " if (this.behavior._getOnlyFollowPosition()) {", + " this.followPosition();", + " } else {", + " this.followTransformation();", + " }", + " this.updateOldCoordinates();", + " }", "", - " const object = this.behavior.owner;", - "", - " if (this.behavior._getOnlyFollowPosition()) {", - " if (object.getX() !== this.ownerOldX", - " || object.getY() !== this.ownerOldY) {", - " this.updateRelativeCoordinates();", - " }", - "", - " if (this.basisOldX !== basisObject.getX() ||", - " this.basisOldY !== basisObject.getY()) {", - " object.setPosition(", - " basisObject.getX() + this.relativeX,", - " basisObject.getY() + this.relativeY);", - " }", - " } else {", - " if (object.getX() !== this.ownerOldX", - " || object.getY() !== this.ownerOldY", - " || object.getAngle() !== this.ownerOldAngle", - " || object.getWidth() !== this.ownerOldWidth", - " || object.getHeight() !== this.ownerOldHeight) {", - " this.updateRelativeCoordinates();", - " }", + " followPosition() {", + " const object = this.behavior.owner;", + " const basisObject = this.basisObject;", + " if (!basisObject) {", + " return;", + " }", + " if (object.getX() !== this.ownerOldX", + " || object.getY() !== this.ownerOldY) {", + " this.updateRelativeCoordinates();", + " }", + " if (this.basisOldX !== basisObject.getX()", + " || this.basisOldY !== basisObject.getY()) {", + " object.setPosition(", + " basisObject.getX() + this.relativeX,", + " basisObject.getY() + this.relativeY);", + " }", + " }", "", - " // Follow basisObject", - " if (basisObject.getAngle() === this.basisOriginalAngle && this.basisOriginalAngle === 0) {", - " if (basisObject.getWidth() === this.basisOriginalWidth ||", - " basisObject.getHeight() === this.basisOriginalHeight) {", - " if (this.basisOldX !== basisObject.getX() ||", - " this.basisOldY !== basisObject.getY()) {", - " object.setPosition(", - " basisObject.getX() + this.relativeX,", - " basisObject.getY() + this.relativeY);", - " }", - " } else {", - " object.setCenterPositionInScene(", - " basisObject.getCenterXInScene() + this.relativeRotatedX * basisObject.getWidth(),", - " basisObject.getCenterYInScene() + this.relativeRotatedY * basisObject.getHeight());", + " followTransformation() {", + " const object = this.behavior.owner;", + " const basisObject = this.basisObject;", + " if (!basisObject) {", + " return;", + " }", + " if (object.getX() !== this.ownerOldX", + " || object.getY() !== this.ownerOldY", + " || object.getAngle() !== this.ownerOldAngle", + " || object.getWidth() !== this.ownerOldWidth", + " || object.getHeight() !== this.ownerOldHeight) {", + " this.updateRelativeCoordinates();", + " }", + " if (this.basisOldAngle !== this.basisObject.getAngle()", + " || this.basisOldWidth !== this.basisObject.getWidth()", + " || this.basisOldHeight !== this.basisObject.getHeight()", + " || this.basisOldCenterXInScene !== this.basisObject.getCenterXInScene()", + " || this.basisOldCenterYInScene !== this.basisObject.getCenterYInScene()) {", + " // Unproportional dimensions changes won't work as expected", + " // if the object angle is not null but nothing more can be done", + " // because there is no full affine transformation on objects.", + " if (basisObject.getWidth() !== this.basisOriginalWidth) {", + " object.setWidth(this.relativeWidth * basisObject.getWidth());", + " }", + " if (basisObject.getHeight() !== this.basisOriginalHeight) {", + " object.setHeight(this.relativeHeight * basisObject.getHeight());", + " }", + " // Follow basisObject", + " if (basisObject.getAngle() === this.basisOriginalAngle", + " && this.basisOriginalAngle === 0) {", + " if (basisObject.getWidth() === this.basisOriginalWidth", + " || basisObject.getHeight() === this.basisOriginalHeight) {", + " if (this.basisOldX !== basisObject.getX() ||", + " this.basisOldY !== basisObject.getY()) {", + " object.setPosition(", + " basisObject.getX() + this.relativeX,", + " basisObject.getY() + this.relativeY);", " }", " } else {", - " object.setAngle(basisObject.getAngle() + this.relativeAngle);", - "", - " const deltaX = this.relativeRotatedX * basisObject.getWidth();", - " const deltaY = this.relativeRotatedY * basisObject.getHeight();", - " const angle = -basisObject.getAngle() * Math.PI / 180;", - " object.setX(basisObject.getCenterXInScene() + object.getX() - object.getCenterXInScene() + deltaX * Math.cos(angle) + deltaY * Math.sin(angle));", - " object.setY(basisObject.getCenterYInScene() + object.getY() - object.getCenterYInScene() - deltaX * Math.sin(angle) + deltaY * Math.cos(angle));", - " }", - " // Unproportional dimensions changes won't work as expected", - " // if the object angle is not null but nothing more can be done", - " // because there is no full affine transformation on objects.", - " if (basisObject.getWidth() !== this.basisOriginalWidth) {", - " object.setWidth(this.relativeWidth * basisObject.getWidth());", + " object.setCenterPositionInScene(", + " basisObject.getCenterXInScene() + this.relativeRotatedX * basisObject.getWidth(),", + " basisObject.getCenterYInScene() + this.relativeRotatedY * basisObject.getHeight());", " }", - " if (basisObject.getHeight() !== this.basisOriginalHeight) {", - " object.setHeight(this.relativeHeight * basisObject.getHeight());", - " }", - " }", + " } else {", + " object.setAngle(basisObject.getAngle() + this.relativeAngle);", "", - " this.updateOldCoordinates();", + " const deltaX = this.relativeRotatedX * basisObject.getWidth();", + " const deltaY = this.relativeRotatedY * basisObject.getHeight();", + " const angle = -basisObject.getAngle() * Math.PI / 180;", + " const cosA = Math.cos(angle);", + " const sinA = Math.sin(angle);", + " object.setX(", + " basisObject.getCenterXInScene() + object.getX() - object.getCenterXInScene()", + " + deltaX * cosA + deltaY * sinA);", + " object.setY(", + " basisObject.getCenterYInScene() + object.getY() - object.getCenterYInScene()", + " - deltaX * sinA + deltaY * cosA);", + " }", " }", " }", "}", @@ -18179,6 +22291,7 @@ "fullName": "Sticker", "name": "Sticker", "objectType": "", + "quickCustomizationVisibility": "hidden", "eventsFunctions": [ { "fullName": "", @@ -18434,18 +22547,12 @@ "value": "", "type": "Boolean", "label": "Only follow the position", - "description": "", - "group": "", - "extraInformation": [], "name": "OnlyFollowPosition" }, { "value": "", "type": "Boolean", "label": "Destroy when the object it's stuck on is destroyed", - "description": "", - "group": "", - "extraInformation": [], "name": "IsDestroyedWithParent" } ], @@ -18459,12 +22566,13 @@ "category": "Movement", "extensionNamespace": "", "fullName": "Platformer character animator", + "gdevelopVersion": ">=5.5.222", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGc+DQoJPHBhdGggZD0iTTIzLDExYzIuMiwwLDQtMS44LDQtNHMtMS44LTQtNC00cy00LDEuOC00LDRTMjAuOCwxMSwyMywxMXoiLz4NCgk8cGF0aCBkPSJNMzAuOCwxMi40Yy0wLjMtMC40LTEtMC41LTEuNC0wLjJsLTIuOSwyLjNjLTAuOCwwLjctMiwwLjYtMi43LTAuMmwtNy45LTcuOWMtMS42LTEuNi00LjEtMS42LTUuNywwTDcuMyw5LjMNCgkJYy0wLjQsMC40LTAuNCwxLDAsMS40czEsMC40LDEuNCwwbDIuOC0yLjhjMC44LTAuOCwyLjEtMC44LDIuOSwwbDEuNiwxLjZMMTEuNiwxNGMtMSwxLTEuNCwyLjMtMS4xLDMuN2MwLjIsMS4xLDAuOSwyLDEuOCwyLjYNCgkJbC0xLjYsMS42Yy0wLjQsMC40LTEsMC40LTEuNCwwbC0zLjYtMy42Yy0wLjQtMC40LTEtMC40LTEuNCwwcy0wLjQsMSwwLDEuNGwzLjYsMy42YzAuNiwwLjYsMS4zLDAuOSwyLjEsMC45czEuNi0wLjMsMi4xLTAuOQ0KCQlsMi4xLTIuMWwyLjUsMWMwLjcsMC4zLDEuMiwxLDEuMiwxLjh2NmMwLDAuNiwwLjQsMSwxLDFzMS0wLjQsMS0xdi02YzAtMS42LTEtMy4xLTIuNS0zLjdsLTEuNy0wLjdsNS4yLTUuMmwxLjQsMS40DQoJCWMwLjgsMC44LDEuOCwxLjIsMi45LDEuMmMwLjksMCwxLjgtMC4zLDIuNS0wLjlsMi45LTIuM0MzMS4xLDEzLjQsMzEuMSwxMi44LDMwLjgsMTIuNHoiLz4NCjwvZz4NCjwvc3ZnPg0K", "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.2.0", "description": [ "Automatically change the animations and horizontal flipping of a platformer character based on movement and interaction with platform objects.", "", @@ -18514,11 +22622,12 @@ "conditions": [ { "type": { - "value": "PlatformerCharacterAnimator::PlatformerCharacterAnimator::PropertyEnableHorizontalFlipping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "EnableHorizontalFlipping", + "True", + "" ] } ], @@ -18631,11 +22740,12 @@ "conditions": [ { "type": { - "value": "PlatformerCharacterAnimator::PlatformerCharacterAnimator::PropertyEnableAnimationChanges" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "EnableAnimationChanges", + "True", + "" ] } ], @@ -18669,7 +22779,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyJumpAnimationName()" + "JumpAnimationName" ] } ] @@ -18702,7 +22812,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyFallAnimationName()" + "FallAnimationName" ] } ] @@ -18750,7 +22860,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyRunAnimationName()" + "RunAnimationName" ] } ] @@ -18784,7 +22894,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyIdleAnimationName()" + "IdleAnimationName" ] } ] @@ -18825,7 +22935,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyClimbAnimationName()" + "ClimbAnimationName" ] } ] @@ -18968,11 +23078,12 @@ "conditions": [ { "type": { - "value": "PlatformerCharacterAnimator::PlatformerCharacterAnimator::PropertyEnableHorizontalFlipping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "EnableHorizontalFlipping", + "True", + "" ] } ], @@ -19073,11 +23184,12 @@ "conditions": [ { "type": { - "value": "PlatformerCharacterAnimator::PlatformerCharacterAnimator::PropertyEnableAnimationChanges" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "EnableAnimationChanges", + "True", + "" ] } ], @@ -19105,7 +23217,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyJumpAnimationName()" + "JumpAnimationName" ] } ] @@ -19132,7 +23244,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyFallAnimationName()" + "FallAnimationName" ] } ] @@ -19174,7 +23286,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyRunAnimationName()" + "RunAnimationName" ] } ] @@ -19202,7 +23314,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyIdleAnimationName()" + "IdleAnimationName" ] } ] @@ -19236,7 +23348,7 @@ "Object", "Animation", "=", - "Object.Behavior::PropertyClimbAnimationName()" + "ClimbAnimationName" ] } ] @@ -19354,11 +23466,11 @@ "actions": [ { "type": { - "value": "PlatformerCharacterAnimator::PlatformerCharacterAnimator::SetPropertyEnableAnimationChanges" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", + "EnableAnimationChanges", + "False", "" ] } @@ -19369,22 +23481,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"EnableAnimationChanges\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "PlatformerCharacterAnimator::PlatformerCharacterAnimator::SetPropertyEnableAnimationChanges" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "EnableAnimationChanges", + "True", + "" ] } ] @@ -19405,7 +23519,7 @@ { "defaultValue": "yes", "description": "Change animations automatically", - "name": "EnableAnimationChanges", + "name": "Value", "optional": true, "type": "yesorno" } @@ -19425,11 +23539,11 @@ "actions": [ { "type": { - "value": "PlatformerCharacterAnimator::PlatformerCharacterAnimator::SetPropertyEnableHorizontalFlipping" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", + "EnableHorizontalFlipping", + "False", "" ] } @@ -19440,22 +23554,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"EnableHorizontalFlipping\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "PlatformerCharacterAnimator::PlatformerCharacterAnimator::SetPropertyEnableHorizontalFlipping" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "EnableHorizontalFlipping", + "True", + "" ] } ] @@ -19476,7 +23592,7 @@ { "defaultValue": "yes", "description": "Enable horizontal flipping", - "name": "EnableHorizontalFlipping", + "name": "Value", "optional": true, "type": "yesorno" } @@ -19497,13 +23613,12 @@ "actions": [ { "type": { - "value": "PlatformerCharacterAnimator::PlatformerCharacterAnimator::SetPropertyIdleAnimationName" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "IdleAnimationName", "=", - "GetArgumentAsString(\"AnimationName\")" + "Value" ] } ] @@ -19523,7 +23638,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -19543,13 +23658,12 @@ "actions": [ { "type": { - "value": "PlatformerCharacterAnimator::PlatformerCharacterAnimator::SetPropertyRunAnimationName" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "RunAnimationName", "=", - "GetArgumentAsString(\"AnimationName\")" + "Value" ] } ] @@ -19569,7 +23683,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -19589,13 +23703,12 @@ "actions": [ { "type": { - "value": "PlatformerCharacterAnimator::PlatformerCharacterAnimator::SetPropertyJumpAnimationName" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "JumpAnimationName", "=", - "GetArgumentAsString(\"AnimationName\")" + "Value" ] } ] @@ -19615,7 +23728,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -19635,13 +23748,12 @@ "actions": [ { "type": { - "value": "PlatformerCharacterAnimator::PlatformerCharacterAnimator::SetPropertyFallAnimationName" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "FallAnimationName", "=", - "GetArgumentAsString(\"AnimationName\")" + "Value" ] } ] @@ -19661,7 +23773,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -19681,13 +23793,12 @@ "actions": [ { "type": { - "value": "PlatformerCharacterAnimator::PlatformerCharacterAnimator::SetPropertyClimbAnimationName" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "ClimbAnimationName", "=", - "GetArgumentAsString(\"AnimationName\")" + "Value" ] } ] @@ -19707,7 +23818,7 @@ }, { "description": "Animation name", - "name": "AnimationName", + "name": "Value", "type": "string" } ], @@ -19719,71 +23830,53 @@ "value": "true", "type": "Boolean", "label": "Enable animation changes", - "description": "", - "group": "", - "extraInformation": [], "name": "EnableAnimationChanges" }, { "value": "true", "type": "Boolean", "label": "Enable horizontal flipping", - "description": "", - "group": "", - "extraInformation": [], "name": "EnableHorizontalFlipping" }, { "value": "Idle", "type": "String", "label": "\"Idle\" animation name ", - "description": "", "group": "Animation names", - "extraInformation": [], "name": "IdleAnimationName" }, { "value": "Run", "type": "String", "label": "\"Run\" animation name", - "description": "", "group": "Animation names", - "extraInformation": [], "name": "RunAnimationName" }, { "value": "Jump", "type": "String", "label": "\"Jump\" animation name", - "description": "", "group": "Animation names", - "extraInformation": [], "name": "JumpAnimationName" }, { "value": "Fall", "type": "String", "label": "\"Fall\" animation name", - "description": "", "group": "Animation names", - "extraInformation": [], "name": "FallAnimationName" }, { "value": "Climb", "type": "String", "label": "\"Climb\" animation name", - "description": "", "group": "Animation names", - "extraInformation": [], "name": "ClimbAnimationName" }, { "value": "", "type": "Behavior", "label": "Platformer character", - "description": "", - "group": "", "extraInformation": [ "PlatformBehavior::PlatformerObjectBehavior" ], @@ -19793,8 +23886,6 @@ "value": "", "type": "Behavior", "label": "Animatable capacity", - "description": "", - "group": "", "extraInformation": [ "AnimatableCapability::AnimatableBehavior" ], @@ -19804,8 +23895,6 @@ "value": "", "type": "Behavior", "label": "Flippable capacity", - "description": "", - "group": "", "extraInformation": [ "FlippableCapability::FlippableBehavior" ], @@ -19822,6 +23911,7 @@ "category": "User interface", "extensionNamespace": "", "fullName": "Resource bar (separated units)", + "gdevelopVersion": "", "helpPath": "/objects/resource-bar", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWRvdHMtaG9yaXpvbnRhbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNiwxMkEyLDIgMCAwLDEgMTgsMTBBMiwyIDAgMCwxIDIwLDEyQTIsMiAwIDAsMSAxOCwxNEEyLDIgMCAwLDEgMTYsMTJNMTAsMTJBMiwyIDAgMCwxIDEyLDEwQTIsMiAwIDAsMSAxNCwxMkEyLDIgMCAwLDEgMTIsMTRBMiwyIDAgMCwxIDEwLDEyTTQsMTJBMiwyIDAgMCwxIDYsMTBBMiwyIDAgMCwxIDgsMTJBMiwyIDAgMCwxIDYsMTRBMiwyIDAgMCwxIDQsMTJaIiAvPjwvc3ZnPg==", "name": "TiledUnitsBar", @@ -20469,27 +24559,18 @@ "value": "1", "type": "Number", "label": "Value", - "description": "", - "group": "", - "extraInformation": [], "name": "Value" }, { "value": "3", "type": "Number", "label": "Maximum value", - "description": "", - "group": "", - "extraInformation": [], "name": "MaxValue" }, { "value": "", "type": "Number", "label": "Previous high value", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "PreviousHighValue" }, @@ -20497,9 +24578,6 @@ "value": "1", "type": "Number", "label": "Previous high value conservation duration (in seconds)", - "description": "", - "group": "", - "extraInformation": [], "name": "PreviousHighValueDuration" } ], @@ -20519,6 +24597,100 @@ "fullName": "Resource bar (separated units)", "isUsingLegacyInstancesRenderer": true, "name": "TiledUnitsBar", + "objects": [ + { + "assetStoreId": "", + "height": 32, + "name": "FillBar", + "texture": "", + "type": "TiledSpriteObject::TiledSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "ResourceBar", + "type": "TiledUnitsBar::ResourceBar", + "Value": 1, + "MaxValue": 3, + "PreviousValue": 0 + } + ] + }, + { + "assetStoreId": "", + "height": 32, + "name": "Bar", + "texture": "", + "type": "TiledSpriteObject::TiledSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [] + }, + { + "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": "FillBar" + }, + { + "objectName": "Bar" + }, + { + "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": [], "eventsFunctions": [ { "fullName": "", @@ -21290,18 +25462,12 @@ "value": "3", "type": "Number", "label": "Maximum value", - "description": "", - "group": "", - "extraInformation": [], "name": "MaxValue" }, { "value": "3", "type": "Number", "label": "Initial value", - "description": "", - "group": "", - "extraInformation": [], "name": "InitialValue" }, { @@ -21309,8 +25475,6 @@ "type": "Number", "label": "", "description": "It's used to detect a change at hot reload.", - "group": "", - "extraInformation": [], "hidden": true, "name": "PreviousInitialValue" }, @@ -21319,16 +25483,12 @@ "type": "Number", "label": "Unit width", "description": "How much pixels to show for a value of 1.", - "group": "", - "extraInformation": [], "name": "UnitWidth" }, { "value": "true", "type": "Boolean", "label": "Show the background", - "description": "", - "group": "", "extraInformation": [ "Background" ], @@ -21338,8 +25498,6 @@ "value": "0", "type": "Number", "label": "Bar left margin", - "description": "", - "group": "", "extraInformation": [ "FillBar", "Bar" @@ -21350,8 +25508,6 @@ "value": "0", "type": "Number", "label": "Bar right margin", - "description": "", - "group": "", "extraInformation": [ "FillBar", "Bar" @@ -21363,7 +25519,6 @@ "type": "String", "label": "", "description": "Only used by the scene editor.", - "group": "", "extraInformation": [ "FillBar", "Bar" @@ -21376,7 +25531,6 @@ "type": "String", "label": "", "description": "Only used by the scene editor.", - "group": "", "extraInformation": [ "Background" ], @@ -21384,100 +25538,7 @@ "name": "BarVerticalAnchorTarget" } ], - "objects": [ - { - "assetStoreId": "", - "height": 32, - "name": "FillBar", - "texture": "", - "type": "TiledSpriteObject::TiledSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "ResourceBar", - "type": "TiledUnitsBar::ResourceBar", - "Value": 1, - "MaxValue": 3, - "PreviousValue": 0 - } - ] - }, - { - "assetStoreId": "", - "height": 32, - "name": "Bar", - "texture": "", - "type": "TiledSpriteObject::TiledSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [] - }, - { - "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": "FillBar" - }, - { - "objectName": "Bar" - }, - { - "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": [] + "variants": [] } ] }, @@ -21486,17 +25547,18 @@ "category": "Movement", "extensionNamespace": "", "fullName": "Screen wrap", + "gdevelopVersion": ">=5.5.222", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLW1vbml0b3Itc2NyZWVuc2hvdCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik05LDZINVYxMEg3VjhIOU0xOSwxMEgxN1YxMkgxNVYxNEgxOU0yMSwxNkgzVjRIMjFNMjEsMkgzQzEuODksMiAxLDIuODkgMSw0VjE2QTIsMiAwIDAsMCAzLDE4SDEwVjIwSDhWMjJIMTZWMjBIMTRWMThIMjFBMiwyIDAgMCwwIDIzLDE2VjRDMjMsMi44OSAyMi4xLDIgMjEsMiIgLz48L3N2Zz4=", "name": "ScreenWrap", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/monitor-screenshot.svg", "shortDescription": "Teleport object when it moves off the screen and immediately appear on the opposite side while maintaining speed and trajectory.", - "version": "0.2.4", + "version": "0.3.2", "description": [ "The teleport happens when the center point of the object crosses a border (this can be adjusted with an offset).", - "By default, the borders of the wrapping area match the screen size, but they can alo be changed.", + "By default, the borders of the wrapping area match the screen size, but they can also be changed.", "", - "The Asteroid-like example uses this extension ([open the project online](https://editor.gdevelop.io/?project=example://space-asteroid))." + "The Asteroid-like example uses this extension ([open the project online](https://editor.gdevelop.io/?project=example://space-asteroids))." ], "origin": { "identifier": "ScreenWrap", @@ -21523,6 +25585,7 @@ "fullName": "Screen Wrap", "name": "ScreenWrap", "objectType": "", + "quickCustomizationVisibility": "hidden", "eventsFunctions": [ { "fullName": "", @@ -21544,11 +25607,10 @@ "conditions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::PropertyBorderBottom" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BorderBottom", "=", "0" ] @@ -21573,11 +25635,10 @@ "conditions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::PropertyBorderRight" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BorderRight", "=", "0" ] @@ -21647,11 +25708,12 @@ "conditions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::PropertyHorizontalWrapping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HorizontalWrapping", + "True", + "" ] } ], @@ -21667,7 +25729,7 @@ "parameters": [ "Object", "<", - "Object.Behavior::PropertyBorderLeft() - (Object.Width()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderLeft - (Object.Width()/2) - TriggerOffset" ] } ], @@ -21679,7 +25741,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderRight() - (Object.Width()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderRight - (Object.Width()/2) + TriggerOffset" ] } ] @@ -21694,7 +25756,7 @@ "parameters": [ "Object", ">", - "Object.Behavior::PropertyBorderRight() - (Object.Width()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderRight - (Object.Width()/2) + TriggerOffset" ] } ], @@ -21706,7 +25768,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderLeft() - (Object.Width()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderLeft - (Object.Width()/2) - TriggerOffset" ] } ] @@ -21718,11 +25780,12 @@ "conditions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::PropertyVerticalWrapping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "VerticalWrapping", + "True", + "" ] } ], @@ -21738,7 +25801,7 @@ "parameters": [ "Object", "<", - "Object.Behavior::PropertyBorderTop() - (Object.Height()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderTop - (Object.Height()/2) - TriggerOffset" ] } ], @@ -21750,7 +25813,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderBottom() - (Object.Height()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderBottom - (Object.Height()/2) + TriggerOffset" ] } ] @@ -21765,7 +25828,7 @@ "parameters": [ "Object", ">", - "Object.Behavior::PropertyBorderBottom() - (Object.Height()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderBottom - (Object.Height()/2) + TriggerOffset" ] } ], @@ -21777,7 +25840,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderTop() - (Object.Height()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderTop - (Object.Height()/2) - TriggerOffset" ] } ] @@ -21816,11 +25879,12 @@ { "type": { "inverted": true, - "value": "ScreenWrap::ScreenWrap::PropertyHorizontalWrapping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HorizontalWrapping", + "True", + "" ] } ], @@ -21840,11 +25904,12 @@ "conditions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::PropertyHorizontalWrapping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HorizontalWrapping", + "True", + "" ] } ], @@ -21888,11 +25953,12 @@ { "type": { "inverted": true, - "value": "ScreenWrap::ScreenWrap::PropertyVerticalWrapping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "VerticalWrapping", + "True", + "" ] } ], @@ -21912,11 +25978,12 @@ "conditions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::PropertyVerticalWrapping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "VerticalWrapping", + "True", + "" ] } ], @@ -21960,22 +26027,24 @@ { "type": { "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"EnableHorizontalWrapping\"" + "EnableHorizontalWrapping", + "True", + "" ] } ], "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyHorizontalWrapping" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "HorizontalWrapping", + "False", + "" ] } ] @@ -21985,22 +26054,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"EnableHorizontalWrapping\"" + "EnableHorizontalWrapping", + "True", + "" ] } ], "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyHorizontalWrapping" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "HorizontalWrapping", + "True", + "" ] } ] @@ -22039,22 +26110,24 @@ { "type": { "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"EnableVerticalWrapping\"" + "EnableVerticalWrapping", + "True", + "" ] } ], "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyVerticalWrapping" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "VerticalWrapping", + "False", + "" ] } ] @@ -22064,22 +26137,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"EnableVerticalWrapping\"" + "EnableVerticalWrapping", + "True", + "" ] } ], "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyVerticalWrapping" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "VerticalWrapping", + "True", + "" ] } ] @@ -22121,7 +26196,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderTop()" + "BorderTop" ] } ] @@ -22161,7 +26236,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderLeft()" + "BorderLeft" ] } ] @@ -22201,7 +26276,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderRight()" + "BorderRight" ] } ] @@ -22241,7 +26316,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderBottom()" + "BorderBottom" ] } ] @@ -22281,7 +26356,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTriggerOffset()" + "TriggerOffset" ] } ] @@ -22318,13 +26393,12 @@ "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyBorderTop" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BorderTop", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22363,13 +26437,12 @@ "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyBorderLeft" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BorderLeft", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22408,13 +26481,12 @@ "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyBorderBottom" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BorderBottom", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22453,13 +26525,12 @@ "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyBorderRight" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BorderRight", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22498,13 +26569,12 @@ "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrap::SetPropertyTriggerOffset" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TriggerOffset", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -22536,18 +26606,12 @@ "value": "true", "type": "Boolean", "label": "Horizontal wrapping", - "description": "", - "group": "", - "extraInformation": [], "name": "HorizontalWrapping" }, { "value": "true", "type": "Boolean", "label": "Vertical wrapping", - "description": "", - "group": "", - "extraInformation": [], "name": "VerticalWrapping" }, { @@ -22555,9 +26619,6 @@ "type": "Number", "unit": "Pixel", "label": "Top border of wrapped area (Y)", - "description": "", - "group": "", - "extraInformation": [], "name": "BorderTop" }, { @@ -22565,9 +26626,6 @@ "type": "Number", "unit": "Pixel", "label": "Left border of wrapped area (X)", - "description": "", - "group": "", - "extraInformation": [], "name": "BorderLeft" }, { @@ -22576,8 +26634,6 @@ "unit": "Pixel", "label": "Right border of wrapped area (X)", "description": "If blank, the value will be the scene width.", - "group": "", - "extraInformation": [], "name": "BorderRight" }, { @@ -22586,8 +26642,6 @@ "unit": "Pixel", "label": "Bottom border of wrapped area (Y)", "description": "If blank, the value will be scene height.", - "group": "", - "extraInformation": [], "name": "BorderBottom" }, { @@ -22595,9 +26649,6 @@ "type": "Number", "unit": "Pixel", "label": "Number of pixels past the center where the object teleports and appears", - "description": "", - "group": "", - "extraInformation": [], "name": "TriggerOffset" } ], @@ -22608,6 +26659,7 @@ "fullName": "Screen Wrap (physics objects)", "name": "ScreenWrapPhysics", "objectType": "", + "quickCustomizationVisibility": "hidden", "eventsFunctions": [ { "fullName": "", @@ -22629,11 +26681,10 @@ "conditions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::PropertyBorderBottom" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BorderBottom", "=", "0" ] @@ -22658,11 +26709,10 @@ "conditions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::PropertyBorderRight" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BorderRight", "=", "0" ] @@ -22765,7 +26815,7 @@ "parameters": [ "Object", "<", - "Object.Behavior::PropertyBorderLeft() - (Object.Width()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderLeft - (Object.Width()/2) - TriggerOffset" ] } ], @@ -22787,7 +26837,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderRight() - (Object.Width()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderRight - (Object.Width()/2) + TriggerOffset" ] }, { @@ -22812,7 +26862,7 @@ "parameters": [ "Object", ">", - "Object.Behavior::PropertyBorderRight() - (Object.Width()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderRight - (Object.Width()/2) + TriggerOffset" ] } ], @@ -22834,7 +26884,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderLeft() - (Object.Width()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderLeft - (Object.Width()/2) - TriggerOffset" ] }, { @@ -22877,7 +26927,7 @@ "parameters": [ "Object", "<", - "Object.Behavior::PropertyBorderTop() - (Object.Height()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderTop - (Object.Height()/2) - TriggerOffset" ] } ], @@ -22899,7 +26949,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderBottom() - (Object.Height()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderBottom - (Object.Height()/2) + TriggerOffset" ] }, { @@ -22924,7 +26974,7 @@ "parameters": [ "Object", ">", - "Object.Behavior::PropertyBorderBottom() - (Object.Height()/2) + Object.Behavior::PropertyTriggerOffset()" + "BorderBottom - (Object.Height()/2) + TriggerOffset" ] } ], @@ -22946,7 +26996,7 @@ "parameters": [ "Object", "=", - "Object.Behavior::PropertyBorderTop() - (Object.Height()/2) - Object.Behavior::PropertyTriggerOffset()" + "BorderTop - (Object.Height()/2) - TriggerOffset" ] }, { @@ -22995,11 +27045,12 @@ { "type": { "inverted": true, - "value": "ScreenWrap::ScreenWrapPhysics::PropertyHorizontalWrapping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HorizontalWrapping", + "True", + "" ] } ], @@ -23019,11 +27070,12 @@ "conditions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::PropertyHorizontalWrapping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HorizontalWrapping", + "True", + "" ] } ], @@ -23067,11 +27119,12 @@ { "type": { "inverted": true, - "value": "ScreenWrap::ScreenWrapPhysics::PropertyVerticalWrapping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "VerticalWrapping", + "True", + "" ] } ], @@ -23091,11 +27144,12 @@ "conditions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::PropertyVerticalWrapping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "VerticalWrapping", + "True", + "" ] } ], @@ -23139,22 +27193,24 @@ { "type": { "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"EnableHorizontalWrapping\"" + "EnableHorizontalWrapping", + "True", + "" ] } ], "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyHorizontalWrapping" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "HorizontalWrapping", + "False", + "" ] } ] @@ -23164,22 +27220,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"EnableHorizontalWrapping\"" + "EnableHorizontalWrapping", + "True", + "" ] } ], "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyHorizontalWrapping" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "HorizontalWrapping", + "True", + "" ] } ] @@ -23218,22 +27276,24 @@ { "type": { "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"EnableVerticalWrapping\"" + "EnableVerticalWrapping", + "True", + "" ] } ], "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyVerticalWrapping" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "VerticalWrapping", + "False", + "" ] } ] @@ -23243,22 +27303,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"EnableVerticalWrapping\"" + "EnableVerticalWrapping", + "True", + "" ] } ], "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyVerticalWrapping" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "VerticalWrapping", + "True", + "" ] } ] @@ -23300,7 +27362,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderTop()" + "BorderTop" ] } ] @@ -23340,7 +27402,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderLeft()" + "BorderLeft" ] } ] @@ -23380,7 +27442,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderRight()" + "BorderRight" ] } ] @@ -23420,7 +27482,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBorderBottom()" + "BorderBottom" ] } ] @@ -23460,7 +27522,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTriggerOffset()" + "TriggerOffset" ] } ] @@ -23497,13 +27559,12 @@ "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyBorderTop" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BorderTop", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23542,13 +27603,12 @@ "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyBorderLeft" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BorderLeft", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23587,13 +27647,12 @@ "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyBorderBottom" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BorderBottom", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23632,13 +27691,12 @@ "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyBorderRight" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BorderRight", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23677,13 +27735,12 @@ "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyTriggerOffset" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TriggerOffset", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -23722,33 +27779,30 @@ "actions": [ { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyAngularVelocity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AngularVelocity", "=", "Object.RequiredPhysicsBehavior::AngularVelocity()" ] }, { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyLinearVelocityX" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "LinearVelocityX", "=", "Object.RequiredPhysicsBehavior::LinearVelocityX()" ] }, { "type": { - "value": "ScreenWrap::ScreenWrapPhysics::SetPropertyLinearVelocityY" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "LinearVelocityY", "=", "Object.RequiredPhysicsBehavior::LinearVelocityY()" ] @@ -23790,7 +27844,7 @@ "Object", "RequiredPhysicsBehavior", "=", - "Object.Behavior::PropertyAngularVelocity()" + "AngularVelocity" ] }, { @@ -23801,7 +27855,7 @@ "Object", "RequiredPhysicsBehavior", "=", - "Object.Behavior::PropertyLinearVelocityX()" + "LinearVelocityX" ] }, { @@ -23812,7 +27866,7 @@ "Object", "RequiredPhysicsBehavior", "=", - "Object.Behavior::PropertyLinearVelocityY()" + "LinearVelocityY" ] } ] @@ -23839,8 +27893,6 @@ "value": "", "type": "Behavior", "label": "Physics Behavior", - "description": "", - "group": "", "extraInformation": [ "Physics2::Physics2Behavior" ], @@ -23850,18 +27902,12 @@ "value": "true", "type": "Boolean", "label": "Horizontal wrapping", - "description": "", - "group": "", - "extraInformation": [], "name": "HorizontalWrapping" }, { "value": "true", "type": "Boolean", "label": "Vertical wrapping", - "description": "", - "group": "", - "extraInformation": [], "name": "VerticalWrapping" }, { @@ -23869,9 +27915,6 @@ "type": "Number", "unit": "Pixel", "label": "Top border of wrapped area (Y)", - "description": "", - "group": "", - "extraInformation": [], "name": "BorderTop" }, { @@ -23879,9 +27922,6 @@ "type": "Number", "unit": "Pixel", "label": "Left border of wrapped area (X)", - "description": "", - "group": "", - "extraInformation": [], "name": "BorderLeft" }, { @@ -23890,8 +27930,6 @@ "unit": "Pixel", "label": "Right border of wrapped area (X)", "description": "If blank, the value will be the scene width.", - "group": "", - "extraInformation": [], "name": "BorderRight" }, { @@ -23900,8 +27938,6 @@ "unit": "Pixel", "label": "Bottom border of wrapped area (Y)", "description": "If blank, the value will be scene height.", - "group": "", - "extraInformation": [], "name": "BorderBottom" }, { @@ -23909,18 +27945,12 @@ "type": "Number", "unit": "Pixel", "label": "Number of pixels past the center where the object teleports and appears", - "description": "", - "group": "", - "extraInformation": [], "name": "TriggerOffset" }, { "value": "0", "type": "Number", "label": "Angular Velocity", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "AngularVelocity" }, @@ -23928,9 +27958,6 @@ "value": "0", "type": "Number", "label": "Linear Velocity X", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "LinearVelocityX" }, @@ -23938,9 +27965,6 @@ "value": "0", "type": "Number", "label": "Linear Velocity Y", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "LinearVelocityY" } @@ -23951,16 +27975,17 @@ "eventsBasedObjects": [] }, { - "author": "Entropy", + "author": "", "category": "Movement", "extensionNamespace": "", "fullName": "Advanced platformer movements", + "gdevelopVersion": ">=5.5.222", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGNpcmNsZSBjbGFzcz0ic3QwIiBjeD0iMjMiIGN5PSI3IiByPSIzIi8+DQo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNOCwxMGwyLjgtMi44QzEyLDYsMTQsNiwxNS4yLDcuMmw3LjksNy45YzEuMSwxLjEsMi44LDEuMiw0LjEsMC4yTDMwLDEzIi8+DQo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMTcsMTBsLTQuNyw0LjdjLTEuNSwxLjUtMSw0LjIsMSw1bDMuOSwxLjVjMS4xLDAuNCwxLjksMS41LDEuOSwyLjd2NiIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTE0LDIwbC0yLjYsMi42Yy0wLjgsMC44LTIuMSwwLjgtMi44LDBMNSwxOSIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjE2IiB5MT0iMTgiIHgyPSIyMSIgeTI9IjEzIi8+DQo8L3N2Zz4NCg==", "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.2.4", "description": [ "This extension provides behaviors to:", "", @@ -24037,11 +28062,10 @@ "conditions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::PropertyCoyoteTimeFrameDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CoyoteTimeFrameDuration", ">", "0" ] @@ -24067,11 +28091,12 @@ { "type": { "inverted": true, - "value": "AdvancedJump::AdvancedJump::PropertyWasInTheAir" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "WasInTheAir", + "True", + "" ] }, { @@ -24105,12 +28130,12 @@ }, { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyCanCoyoteJump" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "CanCoyoteJump", + "True", + "" ] } ], @@ -24139,11 +28164,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::PropertyCanCoyoteJump" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "CanCoyoteJump", + "True", + "" ] } ], @@ -24172,7 +28198,7 @@ "Object", "\"__CoyoteTime_CoyoteJump\"", ">=", - "Object.Behavior::PropertyCoyoteTimeFrameDuration()" + "CoyoteTimeFrameDuration" ] } ], @@ -24188,12 +28214,12 @@ }, { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyCanCoyoteJump" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "CanCoyoteJump", + "False", + "" ] } ], @@ -24245,12 +28271,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyCanCoyoteJump" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "CanCoyoteJump", + "False", + "" ] } ], @@ -24368,11 +28394,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::PropertyAreFloorJumpCountedAsAirJump" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "AreFloorJumpCountedAsAirJump", + "True", + "" ] }, { @@ -24388,11 +28415,10 @@ "actions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyAirJumpCount" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AirJumpCount", "+", "1" ] @@ -24409,7 +28435,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Floor jump: \" + ToString(Object.Behavior::PropertyAirJumpCountMaximum() - Object.Behavior::PropertyAirJumpCount()) + \" + 0\"", + "\"Floor jump: \" + ToString(AirJumpCountMaximum - AirJumpCount) + \" + 0\"", "\"info\"", "\"AirJump\"" ] @@ -24446,12 +28472,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyWasJumpKeyReleased" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "WasJumpKeyReleased", + "True", + "" ] } ], @@ -24513,12 +28539,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyWasJumpKeyReleased" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "WasJumpKeyReleased", + "True", + "" ] } ], @@ -24533,7 +28559,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Jump released: \" + ToString(Object.Behavior::PropertyAirJumpCountMaximum() - Object.Behavior::PropertyAirJumpCount()) + \" + 0\"", + "\"Jump released: \" + ToString(AirJumpCountMaximum - AirJumpCount) + \" + 0\"", "\"info\"", "\"AirJump\"" ] @@ -24581,23 +28607,22 @@ "actions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyAirJumpCount" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AirJumpCount", "=", "0" ] }, { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyWasJumpKeyReleased" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "False" + "WasJumpKeyReleased", + "False", + "" ] } ], @@ -24655,22 +28680,22 @@ }, { "type": { - "value": "AdvancedJump::AdvancedJump::PropertyAirJumpCount" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AirJumpCount", "<", - "Object.Behavior::PropertyAirJumpCountMaximum()" + "AirJumpCountMaximum" ] }, { "type": { - "value": "AdvancedJump::AdvancedJump::PropertyWasJumpKeyReleased" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "WasJumpKeyReleased", + "True", + "" ] } ], @@ -24686,21 +28711,20 @@ }, { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyWasJumpKeyReleased" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "False" + "WasJumpKeyReleased", + "False", + "" ] }, { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyAirJumpCount" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AirJumpCount", "+", "1" ] @@ -24717,7 +28741,7 @@ "value": "DebuggerTools::ConsoleLog" }, "parameters": [ - "\"Jump allowed: \" + ToString(Object.Behavior::PropertyAirJumpCountMaximum() - Object.Behavior::PropertyAirJumpCount()) + \" + 1\"", + "\"Jump allowed: \" + ToString(AirJumpCountMaximum - AirJumpCount) + \" + 1\"", "\"info\"", "\"AirJump\"" ] @@ -24895,11 +28919,10 @@ "conditions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::PropertyCoyoteTimeFrameDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CoyoteTimeFrameDuration", "<=", "0" ] @@ -24924,13 +28947,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyCoyoteTimeFrameDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CoyoteTimeFrameDuration", "=", - "GetArgumentAsNumber(\"CoyoteTime\")" + "Value" ] } ] @@ -24951,7 +28973,7 @@ { "description": "Duration", "longDescription": "Coyote time duration in seconds.", - "name": "CoyoteTime", + "name": "Value", "type": "expression" } ], @@ -24984,11 +29006,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::PropertyCanCoyoteJump" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "CanCoyoteJump", + "True", + "" ] } ], @@ -25033,12 +29056,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyWasInTheAir" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "WasInTheAir", + "False", + "" ] } ] @@ -25080,12 +29103,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyWasInTheAir" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "WasInTheAir", + "True", + "" ] } ] @@ -25123,7 +29146,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAirJumpCountMaximum()" + "AirJumpCountMaximum" ] } ] @@ -25175,7 +29198,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0, Object.Behavior::PropertyAirJumpCountMaximum() - Object.Behavior::PropertyAirJumpCount())" + "max(0, AirJumpCountMaximum - AirJumpCount)" ] } ] @@ -25211,7 +29234,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "clamp(1 + Object.Behavior::PropertyAirJumpCountMaximum() - Object.Behavior::PropertyAirJumpCount(), 0, Object.Behavior::PropertyAirJumpCountMaximum())" + "clamp(1 + AirJumpCountMaximum - AirJumpCount, 0, AirJumpCountMaximum)" ] } ] @@ -25249,13 +29272,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyAirJumpCountMaximum" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AirJumpCountMaximum", "=", - "GetArgumentAsNumber(\"AirJumpCountMaximum\")" + "Value" ] } ] @@ -25275,7 +29297,7 @@ }, { "description": "Number of air jumps", - "name": "AirJumpCountMaximum", + "name": "Value", "type": "expression" } ], @@ -25295,11 +29317,10 @@ "actions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyAirJumpCount" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AirJumpCount", "+", "1" ] @@ -25335,12 +29356,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyWasJumpKeyReleased" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "False" + "WasJumpKeyReleased", + "False", + "" ] } ] @@ -25377,11 +29398,10 @@ "actions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyAirJumpCount" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AirJumpCount", "=", "0" ] @@ -25415,12 +29435,12 @@ }, { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyWasJumpKeyReleased" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "WasJumpKeyReleased", + "True", + "" ] } ] @@ -25454,12 +29474,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::SetPropertyWasJumpKeyReleased" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "False" + "WasJumpKeyReleased", + "False", + "" ] } ] @@ -25493,11 +29513,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::AdvancedJump::PropertyAreFloorJumpCountedAsAirJump" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "AreFloorJumpCountedAsAirJump", + "True", + "" ] } ], @@ -25534,8 +29555,6 @@ "value": "", "type": "Behavior", "label": "Platformer character behavior", - "description": "", - "group": "", "extraInformation": [ "PlatformBehavior::PlatformerObjectBehavior" ], @@ -25546,18 +29565,14 @@ "type": "Number", "unit": "Second", "label": "Coyote time duration", - "description": "", "group": "Coyote time", - "extraInformation": [], "name": "CoyoteTimeFrameDuration" }, { "value": "", "type": "Boolean", "label": "Can coyote jump", - "description": "", "group": "Coyote time", - "extraInformation": [], "hidden": true, "name": "CanCoyoteJump" }, @@ -25565,9 +29580,7 @@ "value": "", "type": "Boolean", "label": "Was in the air", - "description": "", "group": "Coyote time", - "extraInformation": [], "hidden": true, "name": "WasInTheAir" }, @@ -25575,27 +29588,21 @@ "value": "1", "type": "Number", "label": "Number of air jumps", - "description": "", "group": "Air jump", - "extraInformation": [], "name": "AirJumpCountMaximum" }, { "value": "", "type": "Boolean", "label": "Floor jumps count as air jumps", - "description": "", "group": "Air jump", - "extraInformation": [], "name": "AreFloorJumpCountedAsAirJump" }, { "value": "0", "type": "Number", "label": "", - "description": "", "group": "Air jump", - "extraInformation": [], "hidden": true, "name": "AirJumpCount" }, @@ -25603,9 +29610,7 @@ "value": "", "type": "Boolean", "label": "", - "description": "", "group": "Air jump", - "extraInformation": [], "hidden": true, "name": "WasJumpKeyReleased" } @@ -25663,11 +29668,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::WallJump::PropertyWasInTheAir" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "WasInTheAir", + "True", + "" ] } ], @@ -25703,23 +29709,24 @@ { "type": { "inverted": true, - "value": "AdvancedJump::WallJump::PropertyHasJustWallJump" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HasJustWallJump", + "True", + "" ] } ], "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyIsWallJumping" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsWallJumping", + "False", + "" ] }, { @@ -25755,12 +29762,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyWasInTheAir" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "WasInTheAir", + "False", + "" ] } ] @@ -25798,12 +29805,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyWasInTheAir" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "WasInTheAir", + "True", + "" ] } ] @@ -25822,11 +29829,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::WallJump::PropertyIsWallJumping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsWallJumping", + "True", + "" ] } ], @@ -25870,11 +29878,12 @@ "subInstructions": [ { "type": { - "value": "AdvancedJump::WallJump::PropertyIsJumpingLeft" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsJumpingLeft", + "True", + "" ] }, { @@ -25898,11 +29907,12 @@ { "type": { "inverted": true, - "value": "AdvancedJump::WallJump::PropertyIsJumpingLeft" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsJumpingLeft", + "True", + "" ] }, { @@ -25923,12 +29933,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyIsWallJumping" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsWallJumping", + "False", + "" ] }, { @@ -25976,12 +29986,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyIsAgainstWall" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsAgainstWall", + "False", + "" ] } ] @@ -25991,11 +30001,10 @@ "conditions": [ { "type": { - "value": "AdvancedJump::WallJump::PropertyPreviousX" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PreviousX", "=", "Object.X()" ] @@ -26070,12 +30079,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyIsAgainstWall" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsAgainstWall", + "True", + "" ] }, { @@ -26107,11 +30116,11 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyIsJumpingLeft" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", + "IsJumpingLeft", + "False", "" ] } @@ -26134,12 +30143,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyIsJumpingLeft" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsJumpingLeft", + "True", + "" ] } ] @@ -26164,11 +30173,10 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyPreviousX" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PreviousX", "=", "Object.X()" ] @@ -26193,12 +30201,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyHasJustWallJump" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "HasJustWallJump", + "False", + "" ] } ] @@ -26214,11 +30222,12 @@ "subInstructions": [ { "type": { - "value": "AdvancedJump::WallJump::PropertyIsAgainstWall" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsAgainstWall", + "True", + "" ] }, { @@ -26228,7 +30237,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyJumpTimeFrame()", + "JumpTimeFrame", "" ] } @@ -26259,7 +30268,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyJumpTimeFrame()", + "JumpTimeFrame", "\"Jump\"", "" ] @@ -26288,12 +30297,12 @@ }, { "type": { - "value": "AdvancedJump::WallJump::SetPropertyIsWallJumping" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsWallJumping", + "True", + "" ] }, { @@ -26319,12 +30328,12 @@ }, { "type": { - "value": "AdvancedJump::WallJump::SetPropertyHasJustWallJump" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "HasJustWallJump", + "True", + "" ] }, { @@ -26343,11 +30352,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::WallJump::PropertyIsJumpingLeft" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsJumpingLeft", + "True", + "" ] } ], @@ -26360,7 +30370,7 @@ "Object", "PlatformerCharacter", "=", - "-Object.Behavior::PropertyWallJumpSpeedX()" + "-WallJumpSpeedX" ] } ] @@ -26371,11 +30381,12 @@ { "type": { "inverted": true, - "value": "AdvancedJump::WallJump::PropertyIsJumpingLeft" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsJumpingLeft", + "True", + "" ] } ], @@ -26388,7 +30399,7 @@ "Object", "PlatformerCharacter", "=", - "Object.Behavior::PropertyWallJumpSpeedX()" + "WallJumpSpeedX" ] } ] @@ -26431,11 +30442,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::WallJump::PropertyIsWallJumping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsWallJumping", + "True", + "" ] }, { @@ -26446,7 +30458,7 @@ "Object", "\"__WallJump_TimeFromJumpStart\"", "<=", - "Object.Behavior::PropertySideSpeedSustainTime()" + "SideSpeedSustainTime" ] } ], @@ -26457,11 +30469,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::WallJump::PropertyIsJumpingLeft" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsJumpingLeft", + "True", + "" ] } ], @@ -26474,7 +30487,7 @@ "Object", "PlatformerCharacter", "=", - "-Object.Behavior::PropertyWallJumpSpeedX()" + "-WallJumpSpeedX" ] } ] @@ -26485,11 +30498,12 @@ { "type": { "inverted": true, - "value": "AdvancedJump::WallJump::PropertyIsJumpingLeft" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsJumpingLeft", + "True", + "" ] } ], @@ -26502,7 +30516,7 @@ "Object", "PlatformerCharacter", "=", - "Object.Behavior::PropertyWallJumpSpeedX()" + "WallJumpSpeedX" ] } ] @@ -26527,11 +30541,12 @@ { "type": { "inverted": true, - "value": "AdvancedJump::WallJump::PropertyIsAgainstWall" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsAgainstWall", + "True", + "" ] }, { @@ -26566,12 +30581,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyMovedAwayFromTheWall" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "MovedAwayFromTheWall", + "True", + "" ] } ] @@ -26581,11 +30596,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::WallJump::PropertyIsAgainstWall" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsAgainstWall", + "True", + "" ] }, { @@ -26605,11 +30621,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::WallJump::PropertyMovedAwayFromTheWall" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "MovedAwayFromTheWall", + "True", + "" ] } ], @@ -26621,18 +30638,18 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyWallSlidingSpeedAbsorption()", + "WallSlidingSpeedAbsorption", "" ] }, { "type": { - "value": "AdvancedJump::WallJump::SetPropertyMovedAwayFromTheWall" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "MovedAwayFromTheWall", + "False", + "" ] } ], @@ -26678,21 +30695,23 @@ "conditions": [ { "type": { - "value": "AdvancedJump::WallJump::PropertyAutomaticSliding" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "AutomaticSliding", + "True", + "" ] }, { "type": { "inverted": true, - "value": "AdvancedJump::WallJump::PropertyIsWallJumping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsWallJumping", + "True", + "" ] } ], @@ -26788,11 +30807,12 @@ { "type": { "inverted": true, - "value": "AdvancedJump::WallJump::PropertyIsAgainstWall" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsAgainstWall", + "True", + "" ] }, { @@ -26806,6 +30826,15 @@ ] } ] + }, + { + "type": { + "value": "AjoutObjConcern" + }, + "parameters": [ + "", + "Object" + ] } ], "actions": [ @@ -26867,11 +30896,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::WallJump::PropertyHasJustWallJump" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HasJustWallJump", + "True", + "" ] } ], @@ -26928,11 +30958,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::WallJump::PropertyIsWallJumping" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsWallJumping", + "True", + "" ] } ], @@ -26989,11 +31020,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::WallJump::PropertyIsAgainstWall" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsAgainstWall", + "True", + "" ] } ], @@ -27138,7 +31170,7 @@ "Object", "\"__WallJump_IsAgainstWall\"", "<=", - "GetArgumentAsNumber(\"TimeFrame\")" + "TimeFrame" ] } ], @@ -27194,7 +31226,7 @@ }, "parameters": [ "Object", - "\"__WallJump_KeyPressed_\" + GetArgumentAsString(\"Key\")" + "\"__WallJump_KeyPressed_\" + Key" ] } ] @@ -27240,7 +31272,7 @@ }, "parameters": [ "Object", - "\"__WallJump_KeyPressed_\" + GetArgumentAsString(\"Key\")" + "\"__WallJump_KeyPressed_\" + Key" ] } ] @@ -27299,9 +31331,9 @@ }, "parameters": [ "Object", - "\"__WallJump_KeyPressed_\" + GetArgumentAsString(\"Key\")", + "\"__WallJump_KeyPressed_\" + Key", "<=", - "GetArgumentAsNumber(\"TimeFrame\")" + "TimeFrame" ] } ], @@ -27370,10 +31402,12 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"EnableSideSpeed\"" + "EnableSideSpeed", + "True", + "" ] } ], @@ -27385,7 +31419,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyWallJumpAccelerationX()", + "WallJumpAccelerationX", "\"WallJumpLeap\"", "" ] @@ -27403,7 +31437,7 @@ "Object", "PlatformerCharacter", "<", - "Object.Behavior::PropertyWallJumpSpeedX()" + "WallJumpSpeedX" ] } ], @@ -27415,7 +31449,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyWallJumpSpeedX()", + "WallJumpSpeedX", "\"WallJumpLeap\"", "" ] @@ -27442,10 +31476,12 @@ { "type": { "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"EnableSideSpeed\"" + "EnableSideSpeed", + "True", + "" ] } ], @@ -27510,10 +31546,12 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"EnableWallSliding\"" + "EnableWallSliding", + "True", + "" ] } ], @@ -27525,7 +31563,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyWallSlidingGravity()", + "WallSlidingGravity", "\"WallJumpSliding\"", "" ] @@ -27537,7 +31575,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyWallSlidingMaxFallingSpeed()", + "WallSlidingMaxFallingSpeed", "\"WallJumpSliding\"", "" ] @@ -27562,10 +31600,12 @@ { "type": { "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"EnableWallSliding\"" + "EnableWallSliding", + "True", + "" ] } ], @@ -27634,7 +31674,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()" ] } ] @@ -27677,7 +31717,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyJumpTimeFrame()" + "JumpTimeFrame" ] } ] @@ -27715,13 +31755,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyJumpTimeFrame" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "JumpTimeFrame", "=", - "GetArgumentAsNumber(\"JumpTimeFrame\")" + "Value" ] } ] @@ -27741,8 +31780,8 @@ }, { "description": "Jump detection time frame (in seconds)", - "name": "JumpTimeFrame", - "type": "objectList" + "name": "Value", + "type": "expression" } ], "objectGroups": [] @@ -27764,7 +31803,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyWallJumpSpeedX()" + "WallJumpSpeedX" ] } ] @@ -27802,13 +31841,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyWallJumpSpeedX" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "WallJumpSpeedX", "=", - "GetArgumentAsNumber(\"WallJumpSpeedX\")" + "Value" ] } ] @@ -27828,7 +31866,7 @@ }, { "description": "Side speed", - "name": "WallJumpSpeedX", + "name": "Value", "type": "expression" } ], @@ -27851,7 +31889,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyWallJumpAccelerationX()" + "WallJumpAccelerationX" ] } ] @@ -27889,13 +31927,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyWallJumpAccelerationX" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "WallJumpAccelerationX", "=", - "GetArgumentAsNumber(\"WallJumpAccelerationX\")" + "Value" ] } ] @@ -27915,7 +31952,7 @@ }, { "description": "Side acceleration", - "name": "WallJumpAccelerationX", + "name": "Value", "type": "expression" } ], @@ -27938,7 +31975,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyWallSlidingGravity()" + "WallSlidingGravity" ] } ] @@ -27976,13 +32013,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyWallSlidingGravity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "WallSlidingGravity", "=", - "GetArgumentAsNumber(\"WallSlidingGravity\")" + "Value" ] } ] @@ -28002,7 +32038,7 @@ }, { "description": "Gravity", - "name": "WallSlidingGravity", + "name": "Value", "type": "expression" } ], @@ -28025,7 +32061,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyWallSlidingMaxFallingSpeed()" + "WallSlidingMaxFallingSpeed" ] } ] @@ -28063,13 +32099,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyWallSlidingGravity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "WallSlidingMaxFallingSpeed", "=", - "GetArgumentAsNumber(\"WallSlidingMaxFallingSpeed\")" + "Value" ] } ] @@ -28089,7 +32124,7 @@ }, { "description": "Maximum falling speed", - "name": "WallSlidingMaxFallingSpeed", + "name": "Value", "type": "expression" } ], @@ -28112,7 +32147,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyWallSlidingSpeedAbsorption()" + "WallSlidingSpeedAbsorption" ] } ] @@ -28150,13 +32185,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::WallJump::SetPropertyWallSlidingSpeedAbsorption" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "WallSlidingSpeedAbsorption", "=", - "Firebase::GetRemoteConfigNumber(\"WallSlidingSpeedAbsorption\")" + "Value" ] } ] @@ -28176,7 +32210,7 @@ }, { "description": "Impact speed absorption", - "name": "WallSlidingSpeedAbsorption", + "name": "Value", "type": "expression" } ], @@ -28188,8 +32222,6 @@ "value": "", "type": "Behavior", "label": "Platformer character behavior", - "description": "", - "group": "", "extraInformation": [ "PlatformBehavior::PlatformerObjectBehavior" ], @@ -28199,8 +32231,6 @@ "value": "", "type": "Behavior", "label": "Platformer character configuration stack", - "description": "", - "group": "", "extraInformation": [ "AdvancedJump::PlatformerConfigurationStack" ], @@ -28211,9 +32241,7 @@ "type": "Number", "unit": "Second", "label": "Jump detection time frame", - "description": "", "group": "Wall jump", - "extraInformation": [], "name": "JumpTimeFrame" }, { @@ -28221,9 +32249,7 @@ "type": "Number", "unit": "PixelSpeed", "label": "Side speed", - "description": "", "group": "Wall jump", - "extraInformation": [], "name": "WallJumpSpeedX" }, { @@ -28231,9 +32257,7 @@ "type": "Number", "unit": "PixelAcceleration", "label": "Side acceleration", - "description": "", "group": "Wall jump", - "extraInformation": [], "name": "WallJumpAccelerationX" }, { @@ -28241,9 +32265,7 @@ "type": "Number", "unit": "Second", "label": "Side speed sustain time", - "description": "", "group": "Wall jump", - "extraInformation": [], "name": "SideSpeedSustainTime" }, { @@ -28251,9 +32273,7 @@ "type": "Number", "unit": "PixelAcceleration", "label": "Gravity", - "description": "", "group": "Wall sliding", - "extraInformation": [], "name": "WallSlidingGravity" }, { @@ -28261,9 +32281,7 @@ "type": "Number", "unit": "PixelSpeed", "label": "Maximum falling speed", - "description": "", "group": "Wall sliding", - "extraInformation": [], "name": "WallSlidingMaxFallingSpeed" }, { @@ -28271,9 +32289,7 @@ "type": "Number", "unit": "PixelSpeed", "label": "Impact speed absorption", - "description": "", "group": "Wall sliding", - "extraInformation": [], "name": "WallSlidingSpeedAbsorption" }, { @@ -28281,27 +32297,20 @@ "type": "Number", "unit": "PixelSpeed", "label": "Minimal falling speed", - "description": "", "group": "Wall sliding", - "extraInformation": [], "name": "WallSlidingFallingSpeedMin" }, { "value": "", "type": "Boolean", "label": "Keep sliding without holding a key", - "description": "", "group": "Wall sliding", - "extraInformation": [], "name": "AutomaticSliding" }, { "value": "", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "PreviousX" }, @@ -28309,9 +32318,6 @@ "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "IsAgainstWall" }, @@ -28319,9 +32325,6 @@ "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "WasLeftOrRightPressed" }, @@ -28329,9 +32332,6 @@ "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "IsWallJumping" }, @@ -28339,9 +32339,6 @@ "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "IsJumpingLeft" }, @@ -28349,9 +32346,6 @@ "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "WasInTheAir" }, @@ -28359,9 +32353,6 @@ "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "HasJustWallJump" }, @@ -28369,9 +32360,6 @@ "value": "true", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "MovedAwayFromTheWall" } @@ -28416,11 +32404,12 @@ }, { "type": { - "value": "AdvancedJump::DiveDash::PropertyIsDiving" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsDiving", + "True", + "" ] } ], @@ -28438,12 +32427,12 @@ }, { "type": { - "value": "AdvancedJump::DiveDash::SetPropertyIsDiving" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsDiving", + "False", + "" ] } ] @@ -28514,7 +32503,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyDiveMaxFallingSpeed()", + "DiveMaxFallingSpeed", "\"DiveDash\"", "" ] @@ -28526,7 +32515,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyDiveGravity()", + "DiveGravity", "\"DiveDash\"", "" ] @@ -28539,17 +32528,17 @@ "Object", "PlatformerCharacter", "=", - "Object.Behavior::PropertyDiveInitialFallingSpeed()" + "DiveInitialFallingSpeed" ] }, { "type": { - "value": "AdvancedJump::DiveDash::SetPropertyIsDiving" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsDiving", + "True", + "" ] } ] @@ -28609,11 +32598,12 @@ { "type": { "inverted": true, - "value": "AdvancedJump::DiveDash::PropertyIsDiving" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsDiving", + "True", + "" ] } ], @@ -28656,11 +32646,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::DiveDash::PropertyIsDiving" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsDiving", + "True", + "" ] } ], @@ -28697,8 +32688,6 @@ "value": "", "type": "Behavior", "label": "Platformer character behavior", - "description": "", - "group": "", "extraInformation": [ "PlatformBehavior::PlatformerObjectBehavior" ], @@ -28708,8 +32697,6 @@ "value": "", "type": "Behavior", "label": "Platformer character configuration stack", - "description": "", - "group": "", "extraInformation": [ "AdvancedJump::PlatformerConfigurationStack" ], @@ -28720,9 +32707,6 @@ "type": "Number", "unit": "PixelSpeed", "label": "Maximum falling speed", - "description": "", - "group": "", - "extraInformation": [], "name": "DiveMaxFallingSpeed" }, { @@ -28730,9 +32714,6 @@ "type": "Number", "unit": "PixelSpeed", "label": "Initial falling speed", - "description": "", - "group": "", - "extraInformation": [], "name": "DiveInitialFallingSpeed" }, { @@ -28740,18 +32721,12 @@ "type": "Number", "unit": "PixelAcceleration", "label": "Gravity", - "description": "", - "group": "", - "extraInformation": [], "name": "DiveGravity" }, { "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "IsDiving" } @@ -28772,76 +32747,16 @@ "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "PlatformBehavior::PlatformerObjectBehavior::IsUsingControl" - }, - "parameters": [ - "Object", - "PlatformerCharacter", - "\"Left\"" - ] - }, - { - "type": { - "value": "PlatformBehavior::PlatformerObjectBehavior::IsUsingControl" - }, - "parameters": [ - "Object", - "PlatformerCharacter", - "\"Right\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "AdvancedJump::HorizontalDash::SetPropertyLastDirectionIsLeft" - }, - "parameters": [ - "Object", - "Behavior", - "no" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "PlatformBehavior::PlatformerObjectBehavior::IsUsingControl" - }, - "parameters": [ - "Object", - "PlatformerCharacter", - "\"Left\"" - ] - }, - { - "type": { - "inverted": true, - "value": "PlatformBehavior::PlatformerObjectBehavior::IsUsingControl" - }, - "parameters": [ - "Object", - "PlatformerCharacter", - "\"Right\"" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "AdvancedJump::HorizontalDash::SetPropertyLastDirectionIsLeft" + "value": "AdvancedJump::HorizontalDash::UpdateLastDirection" }, "parameters": [ "Object", "Behavior", - "yes" + "" ] } ] @@ -28863,11 +32778,12 @@ { "type": { "inverted": true, - "value": "AdvancedJump::HorizontalDash::PropertyDashKeyIsPressed" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "DashKeyIsPressed", + "True", + "" ] }, { @@ -28879,19 +32795,19 @@ "Object", "\"__PlatformerDash_CoolDown\"", "<", - "Object.Behavior::PropertyCoolDownDuration()" + "CoolDownDuration" ] } ], "actions": [ { "type": { - "value": "AdvancedJump::HorizontalDash::SetPropertyCanDash" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "CanDash", + "True", + "" ] } ] @@ -28956,11 +32872,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::HorizontalDash::PropertyIsSustainning" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsSustainning", + "True", + "" ] } ], @@ -29054,7 +32971,7 @@ "Object", "\"__PlatformerDash_SustainTime\"", ">", - "Object.Behavior::PropertyDashSustainDurationMax()" + "DashSustainDurationMax" ] }, { @@ -29065,12 +32982,12 @@ "subInstructions": [ { "type": { - "inverted": true, - "value": "AdvancedJump::HorizontalDash::PropertyDashKeyIsPressed" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "DashKeyIsPressed", + "False", + "" ] }, { @@ -29080,23 +32997,32 @@ "parameters": [ "Object", "\"__PlatformerDash_SustainTime\"", - "<=", - "Object.Behavior::PropertyDashSustainDurationMin()" + ">", + "DashSustainDurationMin" ] } ] } ] + }, + { + "type": { + "value": "AjoutObjConcern" + }, + "parameters": [ + "", + "Object" + ] } ], "actions": [ { "type": { - "value": "AdvancedJump::HorizontalDash::SetPropertyIsSustainning" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", + "IsSustainning", + "False", "" ] }, @@ -29107,7 +33033,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyDashDecceleration()", + "DashDecceleration", "\"HorizontalDash\"", "" ] @@ -29136,7 +33062,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyDashGravity()", + "DashGravity", "\"HorizontalDashGravity\"", "" ] @@ -29182,11 +33108,12 @@ { "type": { "inverted": true, - "value": "AdvancedJump::HorizontalDash::PropertyIsSustainning" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsSustainning", + "True", + "" ] } ], @@ -29308,12 +33235,112 @@ "actions": [ { "type": { - "value": "AdvancedJump::HorizontalDash::SetPropertyDashKeyIsPressed" + "value": "SetBooleanVariable" + }, + "parameters": [ + "DashKeyIsPressed", + "False", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "AdvancedJump::HorizontalDash", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Update the last direction used by the character.", + "fullName": "Update last direction", + "functionType": "Action", + "name": "UpdateLastDirection", + "private": true, + "sentence": "Update last direction used by _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PlatformBehavior::PlatformerObjectBehavior::IsUsingControl" }, "parameters": [ "Object", - "Behavior", - "no" + "PlatformerCharacter", + "\"Left\"" + ] + }, + { + "type": { + "value": "PlatformBehavior::PlatformerObjectBehavior::IsUsingControl" + }, + "parameters": [ + "Object", + "PlatformerCharacter", + "\"Right\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "LastDirectionIsLeft", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "PlatformBehavior::PlatformerObjectBehavior::IsUsingControl" + }, + "parameters": [ + "Object", + "PlatformerCharacter", + "\"Left\"" + ] + }, + { + "type": { + "inverted": true, + "value": "PlatformBehavior::PlatformerObjectBehavior::IsUsingControl" + }, + "parameters": [ + "Object", + "PlatformerCharacter", + "\"Right\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "LastDirectionIsLeft", + "True", + "" ] } ] @@ -29347,12 +33374,12 @@ "actions": [ { "type": { - "value": "AdvancedJump::HorizontalDash::SetPropertyDashKeyIsPressed" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "DashKeyIsPressed", + "True", + "" ] } ] @@ -29362,11 +33389,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::HorizontalDash::PropertyCanDash" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "CanDash", + "True", + "" ] } ], @@ -29382,12 +33410,12 @@ }, { "type": { - "value": "AdvancedJump::HorizontalDash::SetPropertyIsSustainning" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsSustainning", + "True", + "" ] }, { @@ -29417,7 +33445,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyDashSustainGravity()", + "DashSustainGravity", "\"HorizontalDashGravity\"", "" ] @@ -29429,7 +33457,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyDashSustainSpeedMax()", + "DashSustainSpeedMax", "\"HorizontalDash\"", "" ] @@ -29441,7 +33469,7 @@ "parameters": [ "Object", "PlatformerConfigurationStack", - "Object.Behavior::PropertyDashSustainAcceleration()", + "DashSustainAcceleration", "\"HorizontalDash\"", "" ] @@ -29460,12 +33488,22 @@ }, { "type": { - "value": "AdvancedJump::HorizontalDash::SetPropertyCanDash" + "value": "SetBooleanVariable" + }, + "parameters": [ + "CanDash", + "False", + "" + ] + }, + { + "type": { + "value": "AdvancedJump::HorizontalDash::UpdateLastDirection" }, "parameters": [ "Object", "Behavior", - "no" + "" ] } ], @@ -29475,11 +33513,12 @@ "conditions": [ { "type": { - "value": "AdvancedJump::HorizontalDash::PropertyLastDirectionIsLeft" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "LastDirectionIsLeft", + "True", + "" ] } ], @@ -29492,7 +33531,7 @@ "Object", "PlatformerCharacter", "=", - "-Object.Behavior::PropertyDashInitialSpeed()" + "-DashInitialSpeed" ] } ] @@ -29503,11 +33542,12 @@ { "type": { "inverted": true, - "value": "AdvancedJump::HorizontalDash::PropertyLastDirectionIsLeft" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "LastDirectionIsLeft", + "True", + "" ] } ], @@ -29520,7 +33560,7 @@ "Object", "PlatformerCharacter", "=", - "Object.Behavior::PropertyDashInitialSpeed()" + "DashInitialSpeed" ] } ] @@ -29761,8 +33801,6 @@ "value": "", "type": "Behavior", "label": "Platformer character behavior", - "description": "", - "group": "", "extraInformation": [ "PlatformBehavior::PlatformerObjectBehavior" ], @@ -29772,8 +33810,6 @@ "value": "", "type": "Behavior", "label": "Platformer charcacter configuration stack", - "description": "", - "group": "", "extraInformation": [ "AdvancedJump::PlatformerConfigurationStack" ], @@ -29783,90 +33819,65 @@ "value": "500", "type": "Number", "label": "Initial speed", - "description": "", - "group": "", - "extraInformation": [], "name": "DashInitialSpeed" }, { "value": "0", "type": "Number", "label": "Sustain minimum duration", - "description": "", "group": "Sustain", - "extraInformation": [], "name": "DashSustainDurationMin" }, { "value": "0.25", "type": "Number", "label": "Sustain maxiumum duration", - "description": "", "group": "Sustain", - "extraInformation": [], "name": "DashSustainDurationMax" }, { "value": "1500", "type": "Number", "label": "Sustain acceleration", - "description": "", "group": "Sustain", - "extraInformation": [], "name": "DashSustainAcceleration" }, { "value": "750", "type": "Number", "label": "Sustain maxiumum speed", - "description": "", "group": "Sustain", - "extraInformation": [], "name": "DashSustainSpeedMax" }, { "value": "0", "type": "Number", "label": "Sustain gravity", - "description": "", "group": "Sustain", - "extraInformation": [], "name": "DashSustainGravity" }, { "value": "3000", "type": "Number", "label": "Decceleration", - "description": "", - "group": "", - "extraInformation": [], "name": "DashDecceleration" }, { "value": "1000", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "name": "DashGravity" }, { "value": "0.25", "type": "Number", "label": "Cool down duration", - "description": "", - "group": "", - "extraInformation": [], "name": "CoolDownDuration" }, { "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "LastDirectionIsLeft" }, @@ -29874,9 +33885,6 @@ "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "DashKeyIsPressed" }, @@ -29884,9 +33892,6 @@ "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "IsSustainning" }, @@ -29894,9 +33899,6 @@ "value": "true", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "CanDash" } @@ -30244,8 +34246,8 @@ "Object", "Behavior", "\"gravity\"", - "GetArgumentAsNumber(\"SettingValue\")", - "GetArgumentAsString(\"Identifier\")", + "SettingValue", + "Identifier", "" ] }, @@ -30257,7 +34259,7 @@ "Object", "PlatformerCharacter", "=", - "GetArgumentAsNumber(\"SettingValue\")" + "SettingValue" ] } ] @@ -30307,8 +34309,8 @@ "Object", "Behavior", "\"deceleration\"", - "GetArgumentAsNumber(\"SettingValue\")", - "GetArgumentAsString(\"Identifier\")", + "SettingValue", + "Identifier", "" ] }, @@ -30320,7 +34322,7 @@ "Object", "PlatformerCharacter", "=", - "GetArgumentAsNumber(\"SettingValue\")" + "SettingValue" ] } ] @@ -30370,8 +34372,8 @@ "Object", "Behavior", "\"maxSpeed\"", - "GetArgumentAsNumber(\"SettingValue\")", - "GetArgumentAsString(\"Identifier\")", + "SettingValue", + "Identifier", "" ] }, @@ -30383,7 +34385,7 @@ "Object", "PlatformerCharacter", "=", - "GetArgumentAsNumber(\"SettingValue\")" + "SettingValue" ] } ] @@ -30433,8 +34435,8 @@ "Object", "Behavior", "\"acceleration\"", - "GetArgumentAsNumber(\"SettingValue\")", - "GetArgumentAsString(\"Identifier\")", + "SettingValue", + "Identifier", "" ] }, @@ -30446,7 +34448,7 @@ "Object", "PlatformerCharacter", "=", - "GetArgumentAsNumber(\"SettingValue\")" + "SettingValue" ] } ] @@ -30496,8 +34498,8 @@ "Object", "Behavior", "\"maxFallSpeed\"", - "GetArgumentAsNumber(\"SettingValue\")", - "GetArgumentAsString(\"Identifier\")", + "SettingValue", + "Identifier", "" ] }, @@ -30509,7 +34511,7 @@ "Object", "PlatformerCharacter", "=", - "GetArgumentAsNumber(\"SettingValue\")", + "SettingValue", "yes" ] } @@ -30547,8 +34549,6 @@ "value": "", "type": "Behavior", "label": "Platformer character behavior", - "description": "", - "group": "", "extraInformation": [ "PlatformBehavior::PlatformerObjectBehavior" ], @@ -30565,12 +34565,13 @@ "category": "User interface", "extensionNamespace": "", "fullName": "Panel sprite button", + "gdevelopVersion": ">=5.5.222", "helpPath": "/objects/button", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI5LDIzSDNjLTEuMSwwLTItMC45LTItMlYxMWMwLTEuMSwwLjktMiwyLTJoMjZjMS4xLDAsMiwwLjksMiwydjEwQzMxLDIyLjEsMzAuMSwyMywyOSwyM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMywxOUwxMywxOWMtMS4xLDAtMi0wLjktMi0ydi0yYzAtMS4xLDAuOS0yLDItMmgwYzEuMSwwLDIsMC45LDIsMnYyQzE1LDE4LjEsMTQuMSwxOSwxMywxOXoiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIxOCIgeTE9IjEzIiB4Mj0iMTgiIHkyPSIxOSIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIxIiB5MT0iMTMiIHgyPSIxOCIgeTI9IjE3Ii8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMjEiIHkxPSIxOSIgeDI9IjE5IiB5Mj0iMTYiLz4NCjwvc3ZnPg0K", "name": "PanelSpriteButton", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg", "shortDescription": "A button that can be customized.", - "version": "1.4.4", + "version": "1.5.0", "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.", "", @@ -30631,11 +34632,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Validated\"" ] @@ -30644,11 +34644,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] @@ -30682,12 +34681,12 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyMouseIsInside" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "MouseIsInside", + "False", + "" ] } ] @@ -30697,11 +34696,12 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyShouldCheckHovering" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "ShouldCheckHovering", + "True", + "" ] }, { @@ -30718,12 +34718,12 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyMouseIsInside" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "MouseIsInside", + "True", + "" ] } ] @@ -30746,12 +34746,12 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchIsInside" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "TouchIsInside", + "False", + "" ] } ] @@ -30761,11 +34761,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyTouchId" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "!=", "0" ] @@ -30776,20 +34775,20 @@ }, "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)" ] } ], "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchIsInside" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "TouchIsInside", + "True", + "" ] } ] @@ -30821,11 +34820,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyIndex" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "Index", "=", "0" ] @@ -30847,31 +34845,30 @@ }, "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)" ] } ], "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchIsInside" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "TouchIsInside", + "True", + "" ] } ], @@ -30913,11 +34910,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -30932,11 +34928,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyIndex" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "Index", "+", "1" ] @@ -30965,20 +34960,20 @@ { "type": { "inverted": true, - "value": "PanelSpriteButton::ButtonFSM::PropertyMouseIsInside" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "MouseIsInside", + "True", + "" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Hovered\"" ] @@ -30987,11 +34982,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] @@ -31003,20 +34997,20 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyMouseIsInside" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "MouseIsInside", + "True", + "" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] @@ -31025,11 +35019,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Hovered\"" ] @@ -31042,20 +35035,20 @@ { "type": { "inverted": true, - "value": "PanelSpriteButton::ButtonFSM::PropertyTouchIsInside" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "TouchIsInside", + "True", + "" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -31064,11 +35057,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedOutside\"" ] @@ -31080,20 +35072,20 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyTouchIsInside" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "TouchIsInside", + "True", + "" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedOutside\"" ] @@ -31102,11 +35094,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -31134,18 +35125,17 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", "0" ] @@ -31157,11 +35147,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -31170,11 +35159,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Validated\"" ] @@ -31187,11 +35175,10 @@ { "type": { "inverted": true, - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -31199,11 +35186,10 @@ { "type": { "inverted": true, - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Validated\"" ] @@ -31212,11 +35198,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] @@ -31299,22 +35284,20 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", "0" ] @@ -31349,11 +35332,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] @@ -31398,11 +35380,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Validated\"" ] @@ -31447,11 +35428,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Hovered\"" ] @@ -31496,11 +35476,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Hovered\"" ] @@ -31522,11 +35501,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedOutside\"" ] @@ -31571,11 +35549,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -31620,11 +35597,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedOutside\"" ] @@ -31673,7 +35649,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -31704,8 +35680,6 @@ "type": "Boolean", "label": "", "description": "Should check hovering", - "group": "", - "extraInformation": [], "hidden": true, "name": "ShouldCheckHovering" }, @@ -31713,8 +35687,6 @@ "value": "Idle", "type": "Choice", "label": "State", - "description": "", - "group": "", "extraInformation": [ "Idle", "Hovered", @@ -31729,9 +35701,6 @@ "value": "0", "type": "Number", "label": "Touch id", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TouchId" }, @@ -31739,9 +35708,6 @@ "value": "", "type": "Boolean", "label": "Touch is inside", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TouchIsInside" }, @@ -31749,9 +35715,6 @@ "value": "", "type": "Boolean", "label": "Mouse is inside", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "MouseIsInside" }, @@ -31759,9 +35722,6 @@ "value": "", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "Index" } @@ -31782,6 +35742,165 @@ "fullName": "Button (panel sprite)", "isUsingLegacyInstancesRenderer": true, "name": "PanelSpriteButton", + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Label", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Text", + "font": "", + "textAlignment": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Text", + "font": "", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 20, + "color": "0;0;0" + } + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Idle", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [ + { + "folded": true, + "name": "State", + "type": "string", + "value": "Idle" + } + ], + "effects": [], + "behaviors": [ + { + "name": "ButtonFSM", + "type": "PanelSpriteButton::ButtonFSM", + "ShouldCheckHovering": true + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Hovered", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Pressed", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Label" + }, + { + "objectName": "Idle" + }, + { + "objectName": "Hovered" + }, + { + "objectName": "Pressed" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [], "eventsFunctions": [ { "fullName": "", @@ -32074,10 +36193,10 @@ }, { "type": { - "value": "PanelSpriteButton::PanelSpriteButton::PropertyHoveredFadeOutDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", + "HoveredFadeOutDuration", ">", "0" ] @@ -32105,10 +36224,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::PanelSpriteButton::PropertyHoveredFadeOutDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", + "HoveredFadeOutDuration", "=", "0" ] @@ -32409,66 +36528,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 + } ] } ] @@ -32735,7 +36871,7 @@ "parameters": [ "Label", "=", - "GetArgumentAsString(\"LabelText\")" + "LabelText" ] }, { @@ -32766,11 +36902,11 @@ "objectGroups": [] }, { - "description": "Return the label text.", + "description": "the label text.", "fullName": "Label text", - "functionType": "StringExpression", + "functionType": "ExpressionAndCondition", "name": "LabelText", - "sentence": "", + "sentence": "the label text", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -32964,10 +37100,12 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"ShouldActivate\"" + "ShouldActivate", + "True", + "" ] } ], @@ -32990,10 +37128,12 @@ { "type": { "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"ShouldActivate\"" + "ShouldActivate", + "True", + "" ] } ], @@ -33074,16 +37214,12 @@ "value": "0", "type": "Number", "label": "Label offset on Y axis when pressed", - "description": "", - "group": "", - "extraInformation": [], "name": "PressedLabelOffsetY" }, { "value": "0", "type": "Number", "label": "Left padding", - "description": "", "group": "Padding", "extraInformation": [ "Label" @@ -33094,7 +37230,6 @@ "value": "0", "type": "Number", "label": "Right padding", - "description": "", "group": "Padding", "extraInformation": [ "Label" @@ -33102,196 +37237,33 @@ "name": "RightPadding" }, { - "value": "0", - "type": "Number", - "label": "Top padding", - "description": "", - "group": "Padding", - "extraInformation": [ - "Label" - ], - "name": "TopPadding" - }, - { - "value": "0", - "type": "Number", - "label": "Bottom padding", - "description": "", - "group": "Padding", - "extraInformation": [ - "Label" - ], - "name": "BottomPadding" - }, - { - "value": "0.25", - "type": "Number", - "label": "Hovered fade out duration (in seconds)", - "description": "", - "group": "", - "extraInformation": [], - "name": "HoveredFadeOutDuration" - } - ], - "objects": [ - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "Label", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [], - "string": "Text", - "font": "", - "textAlignment": "", - "characterSize": 20, - "color": { - "b": 0, - "g": 0, - "r": 0 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Text", - "font": "", - "textAlignment": "", - "verticalTextAlignment": "top", - "characterSize": 20, - "color": "0;0;0" - } - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Idle", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [ - { - "folded": true, - "name": "State", - "type": "string", - "value": "Idle" - } - ], - "effects": [], - "behaviors": [ - { - "name": "ButtonFSM", - "type": "PanelSpriteButton::ButtonFSM", - "ShouldCheckHovering": true - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Hovered", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ] + "value": "0", + "type": "Number", + "label": "Top padding", + "group": "Padding", + "extraInformation": [ + "Label" + ], + "name": "TopPadding" }, { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Pressed", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Label" - }, - { - "objectName": "Idle" - }, - { - "objectName": "Hovered" - }, - { - "objectName": "Pressed" - } - ] - }, - "objectsGroups": [], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } + "value": "0", + "type": "Number", + "label": "Bottom padding", + "group": "Padding", + "extraInformation": [ + "Label" ], - "effects": [] + "name": "BottomPadding" + }, + { + "value": "0.25", + "type": "Number", + "label": "Hovered fade out duration (in seconds)", + "name": "HoveredFadeOutDuration" } ], - "instances": [] + "variants": [] } ] }, @@ -33300,17 +37272,22 @@ "category": "User interface", "extensionNamespace": "", "fullName": "Player avatar", + "gdevelopVersion": ">=5.5.222", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwO30NCjwvc3R5bGU+DQo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjIuNywyMi45Yy0yLjItMC41LTMuNy0yLjUtMy43LTQuN2MxLjgtMSwzLTMsMy01LjJ2MGMwLTEuMSwwLjktMiwyLTJoMGwwLTIuM2MwLTIuOC0yLjEtNS40LTQuOS01LjcNCgljLTItMC4yLTMuOCwwLjYtNC45LDIuMWMtMC44LTAuMi0xLjYtMC4xLTIuNiwwLjZjLTEsMC44LTEuNiwyLTEuNiwzLjNsMCwxdjEuNXYxLjNjMCwyLjIsMS4yLDQuMywzLDUuNHYwYzAsMi4zLTEuNiw0LjItMy44LDQuOA0KCWMtMi42LDAuNy00LjUsMi44LTUuMSw1LjRDNC4xLDI4LjcsNC4zLDI5LDQuNywyOWwyMi43LDBjMC40LDAsMC42LTAuMywwLjUtMC43QzI3LjMsMjUuNywyNS4zLDIzLjYsMjIuNywyMi45eiIvPg0KPC9zdmc+DQo=", "name": "PlayerAvatar", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Users/1f89f002e87f1e836320f69725d21e3294e7e2e18ff7dd645c6973e9775d24c3_Users_avatar_user_profile_male.svg", "shortDescription": "Display player avatars according to their GDevelop account.", - "version": "1.0.0", + "version": "1.1.0", "description": "An object that displays a player avatar according to their GDevelop account. It can be used for multiplayer games.", + "origin": { + "identifier": "PlayerAvatar", + "name": "gdevelop-extension-store" + }, "tags": [ - "UI", - "Avatar", - "GDevelop" + "ui", + "avatar", + "gdevelop" ], "authorIds": [ "2OwwM8ToR9dx9RJ2sAKTcrLmCB92" @@ -33406,6 +37383,207 @@ "fullName": "Multiplayer Avatar", "isUsingLegacyInstancesRenderer": false, "name": "PlayerAvatar", + "objects": [ + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Avatar", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "assets\\unknown.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 200, + "y": 0 + }, + { + "x": 200, + "y": 200 + }, + { + "x": 0, + "y": 200 + } + ] + ] + } + ] + } + ] + } + ] + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Border", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "Border", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "assets\\avatar_border_white.png", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 200, + "y": 0 + }, + { + "x": 200, + "y": 200 + }, + { + "x": 0, + "y": 200 + } + ] + ] + } + ] + } + ] + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Avatar" + }, + { + "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": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 100, + "keepRatio": true, + "layer": "", + "name": "Avatar", + "persistentUuid": "39e3ba66-0223-4d8b-a78e-a45d367c277d", + "width": 100, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 100, + "keepRatio": true, + "layer": "", + "name": "Border", + "persistentUuid": "4dc03ef7-9424-4db7-b752-a44ba07ddd10", + "width": 100, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], "eventsFunctions": [ { "fullName": "", @@ -33419,10 +37597,12 @@ { "type": { "inverted": true, - "value": "PlayerAvatar::PlayerAvatar::PropertyBorderEnabled" + "value": "BooleanVariable" }, "parameters": [ - "Object" + "BorderEnabled", + "True", + "" ] } ], @@ -33596,9 +37776,6 @@ "type": "Number", "unit": "Dimensionless", "label": "Lobby player number", - "description": "", - "group": "", - "extraInformation": [], "name": "PlayerNumber" }, { @@ -33606,222 +37783,17 @@ "type": "Boolean", "label": "Border enabled", "description": "Enable the border on the avatar.", - "group": "", - "extraInformation": [], "name": "BorderEnabled" }, { "value": "", "type": "String", "label": "Player unique ID", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "UserID" } ], - "objects": [ - { - "adaptCollisionMaskAutomatically": true, - "assetStoreId": "", - "name": "Avatar", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [], - "animations": [ - { - "name": "", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": true, - "image": "assets\\unknown.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [ - [ - { - "x": 0, - "y": 0 - }, - { - "x": 200, - "y": 0 - }, - { - "x": 200, - "y": 200 - }, - { - "x": 0, - "y": 200 - } - ] - ] - } - ] - } - ] - } - ] - }, - { - "adaptCollisionMaskAutomatically": true, - "assetStoreId": "", - "name": "Border", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [], - "animations": [ - { - "name": "Border", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "metadata": "{\"pskl\":{}}", - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": true, - "image": "assets\\avatar_border_white.png", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [ - [ - { - "x": 0, - "y": 0 - }, - { - "x": 200, - "y": 0 - }, - { - "x": 200, - "y": 200 - }, - { - "x": 0, - "y": 200 - } - ] - ] - } - ] - } - ] - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Avatar" - }, - { - "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": [ - { - "angle": 0, - "customSize": true, - "depth": 0, - "height": 100, - "keepRatio": true, - "layer": "", - "name": "Avatar", - "persistentUuid": "39e3ba66-0223-4d8b-a78e-a45d367c277d", - "width": 100, - "x": 0, - "y": 0, - "zOrder": 1, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 0, - "height": 100, - "keepRatio": true, - "layer": "", - "name": "Border", - "persistentUuid": "4dc03ef7-9424-4db7-b752-a44ba07ddd10", - "width": 100, - "x": 0, - "y": 0, - "zOrder": 2, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ] + "variants": [] } ] } From 53fa401f03ae9a897ce526ea51e68c16882028bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 15 Jul 2025 19:31:28 +0200 Subject: [PATCH 6/9] Use a variant --- .../multiplayer-platformer-arrow-fight.json | 1320 ++++++++++------- 1 file changed, 770 insertions(+), 550 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 15e6d5a65..1ddf75395 100644 --- a/examples/multiplayer-platformer-arrow-fight/multiplayer-platformer-arrow-fight.json +++ b/examples/multiplayer-platformer-arrow-fight/multiplayer-platformer-arrow-fight.json @@ -1869,25 +1869,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": "", @@ -3539,7 +3520,7 @@ "assetStoreId": "", "name": "ArrowBar", "type": "TiledUnitsBar::TiledUnitsBar", - "variant": "", + "variant": "Arrow bar", "variables": [], "effects": [], "behaviors": [ @@ -5383,9 +5364,6 @@ { "objectName": "JumpThrough" }, - { - "objectName": "Tile" - }, { "objectName": "LevelTiles" } @@ -5548,57 +5526,28 @@ "type": "BuiltinCommonInstructions::Group", "events": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Setting ownership if there are multiple players in the game" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "type": "BuiltinCommonInstructions::ForEach", + "object": "Player", + "conditions": [], + "actions": [ { "type": { - "value": "Multiplayer::PlayersInLobbyCount" + "value": "Multiplayer::MultiplayerObjectBehavior::SetPlayerObjectOwnership" }, "parameters": [ - ">", - "1" + "Player", + "MultiplayerObject", + "=", + "Player.PlayerNumber" ] - } - ], - "actions": [], - "events": [ + }, { - "type": "BuiltinCommonInstructions::ForEach", - "object": "Player", - "conditions": [], - "actions": [ - { - "type": { - "value": "Multiplayer::MultiplayerObjectBehavior::SetPlayerObjectOwnership" - }, - "parameters": [ - "Player", - "MultiplayerObject", - "=", - "Player.PlayerNumber" - ] - }, - { - "type": { - "value": "ChangeColor" - }, - "parameters": [ - "Player", - "Player.Color" - ] - } + "type": { + "value": "ChangeColor" + }, + "parameters": [ + "Player", + "Player.Color" ] } ] @@ -5623,7 +5572,7 @@ "value": "Multiplayer::PlayersInLobbyCount" }, "parameters": [ - "=", + "<=", "1" ] } @@ -5634,17 +5583,7 @@ "type": "BuiltinCommonInstructions::ForEach", "object": "Player", "conditions": [], - "actions": [ - { - "type": { - "value": "ChangeColor" - }, - "parameters": [ - "Player", - "Player.Color" - ] - } - ], + "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -5657,20 +5596,18 @@ "Player", "PlayerNumber", "=", - "Multiplayer::CurrentPlayerNumber()" + "1" ] } ], "actions": [ { "type": { - "value": "Multiplayer::MultiplayerObjectBehavior::SetPlayerObjectOwnership" + "value": "Multiplayer::MultiplayerObjectBehavior::TakeObjectOwnership" }, "parameters": [ "Player", - "MultiplayerObject", - "=", - "Player.PlayerNumber" + "MultiplayerObject" ] } ] @@ -5686,7 +5623,7 @@ "Player", "PlayerNumber", "!=", - "Multiplayer::CurrentPlayerNumber()" + "1" ] } ], @@ -5828,7 +5765,6 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "folded": true, "name": "Controls", "source": "", "type": "BuiltinCommonInstructions::Group", @@ -6425,7 +6361,6 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "folded": true, "name": "Arrows", "source": "", "type": "BuiltinCommonInstructions::Group", @@ -6454,7 +6389,7 @@ "ArrowBar", "MultiplayerObject", "=", - "Player.PlayerNumber" + "Player.MultiplayerObject::PlayerObjectOwnership()" ] } ], @@ -6697,7 +6632,7 @@ "Arrow", "MultiplayerObject", "=", - "Player.PlayerNumber" + "Player.MultiplayerObject::PlayerObjectOwnership()" ] }, { @@ -7055,7 +6990,6 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "folded": true, "name": "Bot controls", "source": "", "type": "BuiltinCommonInstructions::Group", @@ -7486,7 +7420,6 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "folded": true, "name": "Player drop out", "source": "", "type": "BuiltinCommonInstructions::Group", @@ -7544,7 +7477,6 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "folded": true, "name": "Pause game", "source": "", "type": "BuiltinCommonInstructions::Group", @@ -7720,7 +7652,6 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "folded": true, "name": "Death", "source": "", "type": "BuiltinCommonInstructions::Group", @@ -23911,13 +23842,13 @@ "category": "User interface", "extensionNamespace": "", "fullName": "Resource bar (separated units)", - "gdevelopVersion": "", + "gdevelopVersion": ">=5.5.230", "helpPath": "/objects/resource-bar", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWRvdHMtaG9yaXpvbnRhbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNiwxMkEyLDIgMCAwLDEgMTgsMTBBMiwyIDAgMCwxIDIwLDEyQTIsMiAwIDAsMSAxOCwxNEEyLDIgMCAwLDEgMTYsMTJNMTAsMTJBMiwyIDAgMCwxIDEyLDEwQTIsMiAwIDAsMSAxNCwxMkEyLDIgMCAwLDEgMTIsMTRBMiwyIDAgMCwxIDEwLDEyTTQsMTJBMiwyIDAgMCwxIDYsMTBBMiwyIDAgMCwxIDgsMTJBMiwyIDAgMCwxIDYsMTRBMiwyIDAgMCwxIDQsMTJaIiAvPjwvc3ZnPg==", "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": "2.0.0", "description": [ "A bar that represents a resource in the game (health, mana, ammo, etc).", "", @@ -23942,10 +23873,109 @@ "gqDaZjCfevOOxBYkK6zlhtZnXCg1", "q8ubdigLvIRXLxsJDDTaokO41mc2" ], + "changelog": [ + { + "version": "2.0.0", + "breaking": "- Resource bars now use variants, you will have to make some adjustments to existing resource bars in your project by following this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/)." + } + ], "dependencies": [], "globalVariables": [], "sceneVariables": [], - "eventsFunctions": [], + "eventsFunctions": [ + { + "description": "left anchor", + "fullName": "Left anchor", + "functionType": "ExpressionAndCondition", + "name": "LeftEdgeAnchor", + "private": true, + "sentence": "Left anchor of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._TiledUnitsBarExtension = gdjs._TiledUnitsBarExtension || {", + " anchors: [\"None\", \"Min\", \"Max\", \"Proportional\", \"Center\"]", + "}", + "const { anchors } = gdjs._TiledUnitsBarExtension;", + "", + "const object = objects[0];", + "/** @type {gdjs.AnchorRuntimeBehavior} */", + "const anchor = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Anchor\"));", + "eventsFunctionContext.returnValue = anchors[anchor._leftEdgeAnchor] || \"None\";", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "supplementaryInformation": "[\"None\",\"Min\",\"Max\",\"Proportional\",\"Center\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Anchor", + "name": "Anchor", + "supplementaryInformation": "AnchorBehavior::AnchorBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "left anchor", + "fullName": "Right anchor", + "functionType": "ExpressionAndCondition", + "name": "RightEdgeAnchor", + "private": true, + "sentence": "Right anchor of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._TiledUnitsBarExtension = gdjs._TiledUnitsBarExtension || {", + " anchors: [\"None\", \"Min\", \"Max\", \"Proportional\", \"Center\"]", + "}", + "const { anchors } = gdjs._TiledUnitsBarExtension;", + "", + "const object = objects[0];", + "/** @type {gdjs.AnchorRuntimeBehavior} */", + "const anchor = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Anchor\"));", + "eventsFunctionContext.returnValue = anchors[anchor._rightEdgeAnchor] || \"None\";", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "supplementaryInformation": "[\"None\",\"Min\",\"Max\",\"Proportional\",\"Center\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Anchor", + "name": "Anchor", + "supplementaryInformation": "AnchorBehavior::AnchorBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], "eventsBasedBehaviors": [ { "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", @@ -24033,7 +24063,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Value" + "CurrentValue" ] } ] @@ -24070,11 +24100,10 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentValue", "=", "clamp(Value, 0, MaxValue)" ] @@ -24086,11 +24115,10 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "Value", "<", "PreviousHighValue" ] @@ -24113,11 +24141,10 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "Value", ">=", "PreviousHighValue" ] @@ -24206,11 +24233,10 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyMaxValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxValue", "=", "Value" ] @@ -24245,11 +24271,10 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentValue", "=", "0" ] @@ -24294,11 +24319,10 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentValue", "=", "MaxValue" ] @@ -24384,13 +24408,12 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyPreviousHighValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PreviousHighValue", "=", - "Value" + "CurrentValue" ] } ] @@ -24465,11 +24488,10 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyPreviousHighValueDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PreviousHighValueDuration", "=", "Value" ] @@ -24510,7 +24532,7 @@ "Object", "Behavior", "!=", - "Value", + "CurrentValue", "" ] }, @@ -24559,7 +24581,7 @@ "value": "1", "type": "Number", "label": "Value", - "name": "Value" + "name": "CurrentValue" }, { "value": "3", @@ -24586,8 +24608,8 @@ ], "eventsBasedObjects": [ { - "areaMaxX": 64, - "areaMaxY": 64, + "areaMaxX": 96, + "areaMaxY": 32, "areaMaxZ": 64, "areaMinX": 0, "areaMinY": 0, @@ -24595,7 +24617,8 @@ "defaultName": "ResourceBar", "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", "fullName": "Resource bar (separated units)", - "isUsingLegacyInstancesRenderer": true, + "isInnerAreaFollowingParentSize": true, + "isUsingLegacyInstancesRenderer": false, "name": "TiledUnitsBar", "objects": [ { @@ -24608,6 +24631,16 @@ "variables": [], "effects": [], "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + }, { "name": "ResourceBar", "type": "TiledUnitsBar::ResourceBar", @@ -24626,7 +24659,18 @@ "width": 32, "variables": [], "effects": [], - "behaviors": [] + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + } + ] }, { "assetStoreId": "", @@ -24636,13 +24680,24 @@ "name": "Background", "rightMargin": 0, "texture": "", - "tiled": true, + "tiled": false, "topMargin": 0, "type": "PanelSpriteObject::PanelSprite", "width": 32, "variables": [], "effects": [], - "behaviors": [] + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] } ], "objectsFolderStructure": { @@ -24690,7 +24745,58 @@ "effects": [] } ], - "instances": [], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 32, + "keepRatio": true, + "layer": "", + "name": "Background", + "persistentUuid": "b13e773c-6941-4f67-b198-030f29c8b679", + "width": 96, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 26, + "keepRatio": true, + "layer": "", + "name": "Bar", + "persistentUuid": "caf6fdad-096d-4247-b23b-6cc1a89ce9f8", + "width": 90, + "x": 3, + "y": 3, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 26, + "layer": "", + "name": "FillBar", + "persistentUuid": "4b784a8f-dbae-4d8b-a287-628642416d10", + "width": 60, + "x": 3, + "y": 3, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], "eventsFunctions": [ { "fullName": "", @@ -24716,124 +24822,33 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::SetPropertyPreviousInitialValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", + "PreviousInitialValue", "=", "InitialValue" ] } ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Create the child-object instances." - }, + } + ], + "parameters": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "Background", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "Bar", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "FillBar", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Background", - "=", - "1" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Bar", - "=", - "2" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "FillBar", - "=", - "3" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "TiledUnitsBar::TiledUnitsBar::PropertyShowBackground" - }, - "parameters": [ - "Object" - ] - } - ], - "actions": [ - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Background" - ] - } - ] - }, + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -24848,7 +24863,14 @@ }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], "actions": [ { "type": { @@ -24897,11 +24919,13 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" + "value": "TiledUnitsBar::TiledUnitsBar::SetUnitWidth" }, "parameters": [ "Object", - "" + "=", + "UnitWidth", + "Object.PropertyMaxValue()" ] }, { @@ -24922,10 +24946,10 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::PropertyInitialValue" + "value": "NumberVariable" }, "parameters": [ - "Object", + "InitialValue", "!=", "PreviousInitialValue" ] @@ -24934,10 +24958,10 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::SetPropertyPreviousInitialValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", + "PreviousInitialValue", "=", "InitialValue" ] @@ -24967,135 +24991,31 @@ "objectGroups": [] }, { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", + "description": "the value of the object.", + "fullName": "Value", + "functionType": "ExpressionAndCondition", + "group": "Resource bar", + "name": "Value", + "sentence": "the value", "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Resize", - "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" }, - "comment": "Children instances must be resized when the button size change:\n- background is resized to take the full dimensions of the button\n- the bar size is refreshed according to the value\n\nThe scale is set back to 1 because it means that the parent instance has the same dimensions as the union of its children instances." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Width()", - "!=", - "max(Background.BoundingBoxRight(), Bar.BoundingBoxRight()) - min(Background.BoundingBoxLeft(), Bar.BoundingBoxLeft())" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Height()", - "!=", - "max(Background.BoundingBoxBottom(), Bar.BoundingBoxBottom()) - min(Background.BoundingBoxTop(), Bar.BoundingBoxTop())" - ] - } - ] - } - ], - "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)" - ] - }, - { - "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" - }, - "parameters": [ - "Object", - "" - ] - } + "parameters": [ + "FillBar.ResourceBar::Value()" ] } - ], - "parameters": [] + ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", @@ -25107,65 +25027,47 @@ "objectGroups": [] }, { - "description": "Center the bar according to the button configuration. This is used in doStepPostEvents when the button is resized.", "fullName": "", - "functionType": "Action", - "name": "CenterBar", - "private": true, - "sentence": "Center the bar of _PARAM0_", + "functionType": "ActionWithOperator", + "getterName": "Value", + "name": "SetValue", + "sentence": "", "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The value is clamped by the behavior. This is why Object.Value() is used instead of Value directly." + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "SetCenter" + "value": "TiledUnitsBar::ResourceBar::SetValue" }, "parameters": [ - "Bar", - "=", - "Background.CenterX()", + "FillBar", + "ResourceBar", "=", - "Background.CenterY()" - ] - }, - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Bar", - "+", - "0" + "Value", + "" ] }, { "type": { - "value": "MettreY" + "value": "TiledUnitsBar::TiledUnitsBar::UpdateBarWidth" }, "parameters": [ - "Bar", - "+", - "0" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "MettreXY" - }, - "parameters": [ - "FillBar", - "=", - "Bar.X()", - "=", - "Bar.Y()" + "Object", + "" ] } ] @@ -25177,17 +25079,23 @@ "name": "Object", "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "TiledUnitsBar::ResourceBar", + "type": "behavior" } ], "objectGroups": [] }, { - "description": "the value of the object.", - "fullName": "Value", + "description": "the maximum value of the object.", + "fullName": "Maximum value", "functionType": "ExpressionAndCondition", - "group": "Resource bar", - "name": "Value", - "sentence": "the value", + "group": "Resource bar configuration", + "name": "MaxValue", + "sentence": "the maximum value", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -25198,7 +25106,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "FillBar.ResourceBar::Value()" + "FillBar.ResourceBar::MaxValue()" ] } ] @@ -25220,8 +25128,8 @@ { "fullName": "", "functionType": "ActionWithOperator", - "getterName": "Value", - "name": "SetValue", + "getterName": "MaxValue", + "name": "SetMaxValue", "sentence": "", "events": [ { @@ -25230,7 +25138,7 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetValue" + "value": "TiledUnitsBar::ResourceBar::SetMaxValue" }, "parameters": [ "FillBar", @@ -25242,13 +25150,13 @@ }, { "type": { - "value": "ResizableCapability::ResizableBehavior::SetWidth" + "value": "TiledUnitsBar::TiledUnitsBar::SetValue" }, "parameters": [ - "FillBar", - "Resizable", + "Object", "=", - "Value * Object.PropertyUnitWidth()" + "Object.Value()", + "" ] } ] @@ -25271,31 +25179,39 @@ "objectGroups": [] }, { - "description": "the maximum value of the object.", - "fullName": "Maximum value", - "functionType": "ExpressionAndCondition", - "group": "Resource bar configuration", - "name": "MaxValue", - "sentence": "the maximum value", + "description": "Check if the bar is empty.", + "fullName": "Empty", + "functionType": "Condition", + "group": "Resource bar", + "name": "IsEmpty", + "sentence": "_PARAM0_ bar is empty", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "TiledUnitsBar::ResourceBar::IsEmpty" + }, + "parameters": [ + "FillBar", + "ResourceBar", + "=" + ] + } + ], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "SetReturnBoolean" }, "parameters": [ - "FillBar.ResourceBar::PropertyMaxValue()" + "True" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", @@ -25307,96 +25223,115 @@ "objectGroups": [] }, { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "MaxValue", - "name": "SetMaxValue", - "sentence": "", + "description": "Check if the bar is full.", + "fullName": "Full", + "functionType": "Condition", + "group": "Resource bar", + "name": "IsFull", + "sentence": "_PARAM0_ bar is full", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetMaxValue" + "value": "TiledUnitsBar::ResourceBar::IsFull" }, "parameters": [ "FillBar", "ResourceBar", - "=", - "Value", - "" + "=" ] - }, + } + ], + "actions": [ { "type": { - "value": "ResizableCapability::ResizableBehavior::SetWidth" + "value": "SetReturnBoolean" }, "parameters": [ - "Bar", - "Resizable", - "=", - "Value * Object.PropertyUnitWidth()" + "True" ] - }, + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the unit width of the object. How much pixels to show for a value of 1.", + "fullName": "Unit width", + "functionType": "ExpressionAndCondition", + "group": "Resource bar configuration", + "name": "UnitWidth", + "private": true, + "sentence": "the unit width", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" + "value": "SetReturnNumber" }, "parameters": [ - "Object", - "" + "UnitWidth" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "TiledUnitsBar::ResourceBar", - "type": "behavior" } ], "objectGroups": [] }, { - "description": "Check if the bar is empty.", - "fullName": "Empty", - "functionType": "Condition", - "group": "Resource bar", - "name": "IsEmpty", - "sentence": "_PARAM0_ bar is empty", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "UnitWidth", + "name": "SetUnitWidth", + "private": true, + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::IsEmpty" + "value": "SetNumberVariable" }, "parameters": [ - "FillBar", - "ResourceBar", - "=" + "UnitWidth", + "=", + "Value" ] - } - ], - "actions": [ + }, { "type": { - "value": "SetReturnBoolean" + "value": "TiledUnitsBar::TiledUnitsBar::UpdateBarWidth" }, "parameters": [ - "True" + "Object", + "" ] } ] @@ -25413,35 +25348,202 @@ "objectGroups": [] }, { - "description": "Check if the bar is full.", - "fullName": "Full", - "functionType": "Condition", - "group": "Resource bar", - "name": "IsFull", - "sentence": "_PARAM0_ bar is full", + "description": "Update the bar width.", + "fullName": "Bar width", + "functionType": "Action", + "name": "UpdateBarWidth", + "private": true, + "sentence": "Update the bar width of _PARAM0_", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::IsFull" + "value": "SetNumberVariable" }, "parameters": [ - "FillBar", - "ResourceBar", - "=" + "NewWidth", + "=", + "Object.MaxValue() * UnitWidth" ] } ], - "actions": [ + "events": [ { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TiledUnitsBar::LeftEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Center\"", + "Bar", + "Anchor", + "" + ] + }, + { + "type": { + "value": "TiledUnitsBar::RightEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Center\"", + "Bar", + "Anchor", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Bar", + "-", + "(NewWidth - Bar.Width()) / 2" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TiledUnitsBar::LeftEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + }, + { + "type": { + "value": "TiledUnitsBar::RightEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Bar", + "-", + "NewWidth - Bar.Width()" + ] + } ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "Bar", + "Resizable", + "=", + "NewWidth" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "FillBar", + "Resizable", + "=", + "Object.Value() * UnitWidth" + ] + }, + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "FillBar", + "=", + "Bar.X()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TiledUnitsBar::LeftEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + }, + { + "type": { + "value": "TiledUnitsBar::RightEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "FillBar", + "=", + "Bar.X() + Bar.Width() - FillBar.Width()" + ] + } + ] + } + ], + "variables": [ + { + "name": "NewWidth", + "type": "number", + "value": 0 } ] } @@ -25461,12 +25563,14 @@ { "value": "3", "type": "Number", + "unit": "Dimensionless", "label": "Maximum value", "name": "MaxValue" }, { "value": "3", "type": "Number", + "unit": "Dimensionless", "label": "Initial value", "name": "InitialValue" }, @@ -25481,64 +25585,180 @@ { "value": "24", "type": "Number", + "unit": "Pixel", "label": "Unit width", "description": "How much pixels to show for a value of 1.", "name": "UnitWidth" - }, - { - "value": "true", - "type": "Boolean", - "label": "Show the background", - "extraInformation": [ - "Background" - ], - "name": "ShowBackground" - }, - { - "value": "0", - "type": "Number", - "label": "Bar left margin", - "extraInformation": [ - "FillBar", - "Bar" - ], - "name": "BarLeftPadding" - }, - { - "value": "0", - "type": "Number", - "label": "Bar right margin", - "extraInformation": [ - "FillBar", - "Bar" - ], - "name": "BarRightPadding" - }, - { - "value": "Center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "extraInformation": [ - "FillBar", - "Bar" - ], - "hidden": true, - "name": "BarVerticalAnchorOrigin" - }, - { - "value": "Center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "extraInformation": [ - "Background" - ], - "hidden": true, - "name": "BarVerticalAnchorTarget" } ], - "variants": [] + "variants": [ + { + "areaMaxX": 21, + "areaMaxY": 10, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "Arrow bar", + "objects": [ + { + "assetStoreId": "", + "height": 10, + "name": "FillBar", + "texture": "assets\\Arrow_symbol.png", + "type": "TiledSpriteObject::TiledSprite", + "width": 21, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "ResourceBar", + "type": "TiledUnitsBar::ResourceBar", + "Value": 1, + "MaxValue": 3, + "PreviousValue": 0 + } + ] + }, + { + "assetStoreId": "", + "height": 10, + "name": "Bar", + "texture": "assets\\Arrow_symbol_Background.png", + "type": "TiledSpriteObject::TiledSprite", + "width": 21, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Background", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "FillBar" + }, + { + "objectName": "Bar" + }, + { + "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": [ + { + "angle": 0, + "customSize": false, + "height": 26, + "layer": "", + "name": "Bar", + "persistentUuid": "caf6fdad-096d-4247-b23b-6cc1a89ce9f8", + "width": 90, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 10, + "layer": "", + "name": "FillBar", + "persistentUuid": "4b784a8f-dbae-4d8b-a287-628642416d10", + "width": 21, + "x": 0, + "y": 0, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ] + } + ] } ] }, From 5795aa4831771687a0ef643ed4c8136ecd129147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 15 Jul 2025 19:34:43 +0200 Subject: [PATCH 7/9] Update extensions --- .../tower-defense-war/tower-defense-war.json | 3118 +++++++---------- 1 file changed, 1315 insertions(+), 1803 deletions(-) diff --git a/examples/tower-defense-war/tower-defense-war.json b/examples/tower-defense-war/tower-defense-war.json index 81b847a0a..6f05301b2 100644 --- a/examples/tower-defense-war/tower-defense-war.json +++ b/examples/tower-defense-war/tower-defense-war.json @@ -1,9 +1,9 @@ { "firstLayout": "GameScene", "gdVersion": { - "build": 212, + "build": 236, "major": 5, - "minor": 4, + "minor": 5, "revision": 0 }, "properties": { @@ -18,7 +18,6 @@ "scaleMode": "linear", "sizeOnStartupMode": "", "templateSlug": "tile-based-city-builder", - "useExternalSourceFiles": false, "version": "1.0.0", "name": "Tower Defense War", "description": "A tower defense game example that shows users how to select, deselect, and purchase towers. Create instances of enemies using arrays, and moving enemies along a path using their own object arrays and point objects in scene.", @@ -105,7 +104,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/desktop-icon-512.png", "kind": "image", "metadata": "", @@ -114,7 +112,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/android-icon-192.png", "kind": "image", "metadata": "", @@ -123,7 +120,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/android-icon-144.png", "kind": "image", "metadata": "", @@ -132,7 +128,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/android-icon-96.png", "kind": "image", "metadata": "", @@ -141,7 +136,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/android-icon-72.png", "kind": "image", "metadata": "", @@ -150,7 +144,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/android-icon-48.png", "kind": "image", "metadata": "", @@ -159,7 +152,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/android-icon-36.png", "kind": "image", "metadata": "", @@ -168,7 +160,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/android-windowSplashScreenAnimatedIcon.png", "kind": "image", "metadata": "", @@ -177,7 +168,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-1024.png", "kind": "image", "metadata": "", @@ -186,7 +176,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-180.png", "kind": "image", "metadata": "", @@ -195,7 +184,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-167.png", "kind": "image", "metadata": "", @@ -204,7 +192,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-152.png", "kind": "image", "metadata": "", @@ -213,7 +200,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-144.png", "kind": "image", "metadata": "", @@ -222,7 +208,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-120.png", "kind": "image", "metadata": "", @@ -231,7 +216,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-114.png", "kind": "image", "metadata": "", @@ -240,7 +224,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-100.png", "kind": "image", "metadata": "", @@ -249,7 +232,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-87.png", "kind": "image", "metadata": "", @@ -258,7 +240,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-80.png", "kind": "image", "metadata": "", @@ -267,7 +248,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-76.png", "kind": "image", "metadata": "", @@ -276,7 +256,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-72.png", "kind": "image", "metadata": "", @@ -285,7 +264,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-60.png", "kind": "image", "metadata": "", @@ -294,7 +272,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-58.png", "kind": "image", "metadata": "", @@ -303,7 +280,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-57.png", "kind": "image", "metadata": "", @@ -312,7 +288,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-50.png", "kind": "image", "metadata": "", @@ -321,7 +296,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-40.png", "kind": "image", "metadata": "", @@ -330,7 +304,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-29.png", "kind": "image", "metadata": "", @@ -339,7 +312,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/ios-icon-20.png", "kind": "image", "metadata": "", @@ -348,7 +320,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Tower1_Icon.png", "kind": "image", "metadata": "", @@ -357,7 +328,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/TowerHead1.png", "kind": "image", "metadata": "", @@ -366,7 +336,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/TowerBase.png", "kind": "image", "metadata": "", @@ -375,7 +344,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Enemy1.png", "kind": "image", "metadata": "", @@ -384,7 +352,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/EnemySpawnMarker.png", "kind": "image", "metadata": "{\"localFilePath\":\"EnemySpawnMarker.png\",\"extension\":\".png\"}", @@ -393,7 +360,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/PointMarker.png", "kind": "image", "metadata": "{\"localFilePath\":\"PointMarker.png\",\"extension\":\".png\"}", @@ -402,7 +368,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Bullet.png", "kind": "image", "metadata": "", @@ -411,7 +376,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Flat Heart Empty.png", "kind": "image", "metadata": "", @@ -424,7 +388,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Flat Heart Filled.png", "kind": "image", "metadata": "", @@ -437,7 +400,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Grey Button_Hovered.png", "kind": "image", "metadata": "", @@ -450,7 +412,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Grey Button_Idle.png", "kind": "image", "metadata": "", @@ -463,7 +424,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Grey Button_Pressed.png", "kind": "image", "metadata": "", @@ -476,7 +436,6 @@ } }, { - "alwaysLoaded": false, "file": "assets/Grey Button_Idle.png", "kind": "image", "metadata": "", @@ -485,7 +444,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/Grey Button_Hovered.png", "kind": "image", "metadata": "", @@ -494,7 +452,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "assets/Grey Button_Pressed.png", "kind": "image", "metadata": "", @@ -503,7 +460,6 @@ "userAdded": false }, { - "alwaysLoaded": false, "file": "thumbnail.png", "kind": "image", "metadata": "", @@ -512,7 +468,6 @@ "userAdded": true }, { - "alwaysLoaded": false, "file": "assets/towerDefense_tilesheet.png", "kind": "image", "metadata": "", @@ -891,6 +846,7 @@ "assetStoreId": "5f0df6131c9646dcbe98798196db5b6d806eb25564f86d2e119a084d1e20bf74", "name": "Tower1_Icon", "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "", "variables": [], "effects": [ { @@ -979,6 +935,7 @@ "text": "", "font": "ArchitectsDaughter.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 22, "color": "255;255;255" } @@ -1192,6 +1149,7 @@ "text": "Gold: 0", "font": "", "textAlignment": "left", + "verticalTextAlignment": "top", "characterSize": 40, "color": "255;255;255" } @@ -1233,6 +1191,7 @@ "text": "Left click on icon to select/build\nRight click to deselect", "font": "", "textAlignment": "left", + "verticalTextAlignment": "top", "characterSize": 40, "color": "255;255;255" } @@ -1436,6 +1395,7 @@ "assetStoreId": "5f0df6131c9646dcbe98798196db5b6d806eb25564f86d2e119a084d1e20bf74", "name": "NextWaveButton", "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "", "variables": [], "effects": [], "behaviors": [], @@ -1499,6 +1459,7 @@ "text": "Next Wave", "font": "ArchitectsDaughter.ttf", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 22, "color": "0;0;0" } @@ -1525,24 +1486,25 @@ "fillOpacity": 50, "outlineSize": 1, "outlineOpacity": 50, + "absoluteCoordinates": true, + "clearBetweenFrames": true, + "antialiasing": "none", "fillColor": { - "b": 117, + "r": 255, "g": 117, - "r": 255 + "b": 117 }, "outlineColor": { - "b": 117, + "r": 255, "g": 117, - "r": 255 - }, - "absoluteCoordinates": true, - "clearBetweenFrames": true, - "antialiasing": "none" + "b": 117 + } }, { "assetStoreId": "c807d51d4bab0016401aef4d64d10d137f5ac8738ffa15865e1bc81435b9720b", "name": "FlatHeartBar", "type": "TiledUnitsBar::TiledUnitsBar", + "variant": "", "variables": [], "effects": [], "behaviors": [], @@ -1578,6 +1540,7 @@ "assetStoreId": "bfab3a269992cf43081e2cb8053c28aaef11f2f9e0d0cbdc00207ea271f69c2c", "name": "GreyButton", "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "", "variables": [], "effects": [], "behaviors": [], @@ -1641,6 +1604,7 @@ "text": "Button", "font": "", "textAlignment": "center", + "verticalTextAlignment": "top", "characterSize": 60, "color": "72;72;79" } @@ -2838,6 +2802,7 @@ "category": "User interface", "extensionNamespace": "", "fullName": "Resource bar (separated units)", + "gdevelopVersion": "", "helpPath": "/objects/resource-bar", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWRvdHMtaG9yaXpvbnRhbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNiwxMkEyLDIgMCAwLDEgMTgsMTBBMiwyIDAgMCwxIDIwLDEyQTIsMiAwIDAsMSAxOCwxNEEyLDIgMCAwLDEgMTYsMTJNMTAsMTJBMiwyIDAgMCwxIDEyLDEwQTIsMiAwIDAsMSAxNCwxMkEyLDIgMCAwLDEgMTIsMTRBMiwyIDAgMCwxIDEwLDEyTTQsMTJBMiwyIDAgMCwxIDYsMTBBMiwyIDAgMCwxIDgsMTJBMiwyIDAgMCwxIDYsMTRBMiwyIDAgMCwxIDQsMTJaIiAvPjwvc3ZnPg==", "name": "TiledUnitsBar", @@ -3485,27 +3450,18 @@ "value": "1", "type": "Number", "label": "Value", - "description": "", - "group": "", - "extraInformation": [], "name": "Value" }, { "value": "3", "type": "Number", "label": "Maximum value", - "description": "", - "group": "", - "extraInformation": [], "name": "MaxValue" }, { "value": "", "type": "Number", "label": "Previous high value", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "PreviousHighValue" }, @@ -3513,9 +3469,6 @@ "value": "1", "type": "Number", "label": "Previous high value conservation duration (in seconds)", - "description": "", - "group": "", - "extraInformation": [], "name": "PreviousHighValueDuration" } ], @@ -3533,7 +3486,102 @@ "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", + "objects": [ + { + "assetStoreId": "", + "height": 32, + "name": "FillBar", + "texture": "", + "type": "TiledSpriteObject::TiledSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "ResourceBar", + "type": "TiledUnitsBar::ResourceBar", + "Value": 1, + "MaxValue": 3, + "PreviousValue": 0 + } + ] + }, + { + "assetStoreId": "", + "height": 32, + "name": "Bar", + "texture": "", + "type": "TiledSpriteObject::TiledSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [] + }, + { + "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": "FillBar" + }, + { + "objectName": "Bar" + }, + { + "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": [], "eventsFunctions": [ { "fullName": "", @@ -4300,18 +4348,12 @@ "value": "3", "type": "Number", "label": "Maximum value", - "description": "", - "group": "", - "extraInformation": [], "name": "MaxValue" }, { "value": "3", "type": "Number", "label": "Initial value", - "description": "", - "group": "", - "extraInformation": [], "name": "InitialValue" }, { @@ -4319,8 +4361,6 @@ "type": "Number", "label": "", "description": "It's used to detect a change at hot reload.", - "group": "", - "extraInformation": [], "hidden": true, "name": "PreviousInitialValue" }, @@ -4329,16 +4369,12 @@ "type": "Number", "label": "Unit width", "description": "How much pixels to show for a value of 1.", - "group": "", - "extraInformation": [], "name": "UnitWidth" }, { "value": "true", "type": "Boolean", "label": "Show the background", - "description": "", - "group": "", "extraInformation": [ "Background" ], @@ -4348,8 +4384,6 @@ "value": "0", "type": "Number", "label": "Bar left margin", - "description": "", - "group": "", "extraInformation": [ "FillBar", "Bar" @@ -4360,8 +4394,6 @@ "value": "0", "type": "Number", "label": "Bar right margin", - "description": "", - "group": "", "extraInformation": [ "FillBar", "Bar" @@ -4373,7 +4405,6 @@ "type": "String", "label": "", "description": "Only used by the scene editor.", - "group": "", "extraInformation": [ "FillBar", "Bar" @@ -4386,7 +4417,6 @@ "type": "String", "label": "", "description": "Only used by the scene editor.", - "group": "", "extraInformation": [ "Background" ], @@ -4394,100 +4424,7 @@ "name": "BarVerticalAnchorTarget" } ], - "objects": [ - { - "assetStoreId": "", - "height": 32, - "name": "FillBar", - "texture": "", - "type": "TiledSpriteObject::TiledSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "ResourceBar", - "type": "TiledUnitsBar::ResourceBar", - "Value": 1, - "MaxValue": 3, - "PreviousValue": 0 - } - ] - }, - { - "assetStoreId": "", - "height": 32, - "name": "Bar", - "texture": "", - "type": "TiledSpriteObject::TiledSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [] - }, - { - "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": "FillBar" - }, - { - "objectName": "Bar" - }, - { - "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": [] + "variants": [] } ] }, @@ -4496,12 +4433,13 @@ "category": "Game mechanic", "extensionNamespace": "", "fullName": "Health points and damage", + "gdevelopVersion": ">=5.5.222", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWhlYXJ0LWhhbGYtZnVsbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNi41LDVDMTUsNSAxMy41OCw1LjkxIDEzLDcuMlYxNy43NEMxNy4yNSwxMy44NyAyMCwxMS4yIDIwLDguNUMyMCw2LjUgMTguNSw1IDE2LjUsNU0xNi41LDNDMTkuNTgsMyAyMiw1LjQxIDIyLDguNUMyMiwxMi4yNyAxOC42LDE1LjM2IDEzLjQ1LDIwLjAzTDEyLDIxLjM1TDEwLjU1LDIwLjAzQzUuNCwxNS4zNiAyLDEyLjI3IDIsOC41QzIsNS40MSA0LjQyLDMgNy41LDNDOS4yNCwzIDEwLjkxLDMuODEgMTIsNS4wOEMxMy4wOSwzLjgxIDE0Ljc2LDMgMTYuNSwzWiIgLz48L3N2Zz4=", "name": "Health", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/heart-half-full.svg", "shortDescription": "Manage health (life) points, shield and armor.", - "version": "0.3.1", + "version": "0.4.0", "description": [ "Manage health (life) points, shield and armor. ", "", @@ -4574,7 +4512,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyHealth()", + "Health", "" ] } @@ -4637,22 +4575,20 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyHealthRegenRate" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HealthRegenRate", "!=", "0" ] }, { "type": { - "value": "Health::Health::PropertyCurrentHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "<", "Object.Behavior::MaxHealth()" ] @@ -4665,20 +4601,19 @@ "Object", "\"__Health.TimeSinceLastHit\"", ">", - "Object.Behavior::PropertyHealthRegenDelay()" + "HealthRegenDelay" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "+", - "Object.Behavior::PropertyHealthRegenRate() * TimeDelta()" + "HealthRegenRate * TimeDelta()" ] } ], @@ -4700,11 +4635,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", ">", "Object.Behavior::MaxHealth()" ] @@ -4713,13 +4647,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "=", - "Object.Behavior::PropertyMaxHealth()" + "MaxHealth" ] } ] @@ -4744,32 +4677,32 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsHealthJustDamaged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsHealthJustDamaged", + "False", + "" ] }, { "type": { - "value": "Health::Health::SetPropertyIsJustHealed" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsJustHealed", + "False", + "" ] }, { "type": { - "value": "Health::Health::SetPropertyIsJustDodged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsJustDodged", + "False", + "" ] } ] @@ -4815,24 +4748,22 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyShieldRegenRate" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldRegenRate", "!=", "0" ] }, { "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "<", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] }, { @@ -4843,7 +4774,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", ">", - "Object.Behavior::PropertyShieldRegenDelay()" + "ShieldRegenDelay" ] } ], @@ -4854,11 +4785,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", "0" ] @@ -4883,13 +4813,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "+", - "Object.Behavior::PropertyShieldRegenRate() * TimeDelta()" + "ShieldRegenRate * TimeDelta()" ] } ] @@ -4911,26 +4840,24 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", ">", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ] @@ -4973,11 +4900,10 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", "0" ] @@ -5002,12 +4928,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsShieldJustDamaged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsShieldJustDamaged", + "False", + "" ] } ] @@ -5081,13 +5007,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "=", - "GetArgumentAsNumber(\"DamageValue\")" + "DamageValue" ] } ], @@ -5123,28 +5048,27 @@ "parameters": [ "RandomFloatInRange(0,1)", "<", - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsJustDodged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsJustDodged", + "True", + "" ] }, { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "=", "0" ] @@ -5168,19 +5092,20 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"UseArmor\"" + "UseArmor", + "True", + "" ] }, { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", ">", "0" ] @@ -5203,13 +5128,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "=", - "max(0,Object.Behavior::PropertyDamageToBeApplied() - Object.Behavior::PropertyFlatDamageReduction())" + "max(0,DamageToBeApplied - FlatDamageReduction)" ] } ] @@ -5231,22 +5155,20 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyPercentDamageReduction" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PercentDamageReduction", ">", "0" ] }, { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", ">", "0" ] @@ -5255,13 +5177,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "*", - "1 - min(1, Object.Behavior::PropertyPercentDamageReduction())" + "1 - min(1, PercentDamageReduction)" ] } ] @@ -5300,10 +5221,12 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"UseShield\"" + "UseShield", + "True", + "" ] }, { @@ -5318,11 +5241,10 @@ }, { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", ">", "0" ] @@ -5331,12 +5253,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsShieldJustDamaged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsShieldJustDamaged", + "True", + "" ] }, { @@ -5368,46 +5290,42 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "<=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "-", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { "type": { - "value": "Health::Health::SetPropertyShieldDamageTaken" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDamageTaken", "=", - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] }, { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "=", "0" ] @@ -5431,26 +5349,24 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", ">", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldDamageTaken" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDamageTaken", "=", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ], @@ -5460,33 +5376,32 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyBlockExcessDamage" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "BlockExcessDamage", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "=", "0" ] }, { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", "0" ] @@ -5511,33 +5426,32 @@ { "type": { "inverted": true, - "value": "Health::Health::PropertyBlockExcessDamage" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "BlockExcessDamage", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", "-", - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] }, { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", "0" ] @@ -5565,11 +5479,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyDamageToBeApplied" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageToBeApplied", ">", "0" ] @@ -5610,7 +5523,7 @@ "parameters": [ "Object", "Behavior", - "Object.Behavior::PropertyCurrentHealth() - Object.Behavior::PropertyDamageToBeApplied()", + "CurrentHealth - DamageToBeApplied", "" ] } @@ -5678,7 +5591,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCurrentHealth()" + "CurrentHealth" ] } ] @@ -5716,13 +5629,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -5744,11 +5656,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyMaxHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxHealth", ">", "0" ] @@ -5757,13 +5668,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "=", - "min(Object.Behavior::PropertyCurrentHealth(), Object.Behavior::PropertyMaxHealth())" + "min(CurrentHealth, MaxHealth)" ] } ] @@ -5809,7 +5719,7 @@ "parameters": [ "Object", "Behavior", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -5870,11 +5780,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyMaxHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxHealth", "=", "0" ] @@ -5883,13 +5792,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HealToBeApplied", "=", - "GetArgumentAsNumber(\"HealValue\")" + "HealValue" ] } ] @@ -5911,11 +5819,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyMaxHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxHealth", ">", "0" ] @@ -5923,24 +5830,24 @@ { "type": { "inverted": true, - "value": "Health::Health::PropertyAllowOverHealing" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "AllowOverHealing", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealToBeApplied" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HealToBeApplied", "=", - "min(GetArgumentAsNumber(\"HealValue\"),Object.Behavior::PropertyMaxHealth() - Object.Behavior::PropertyCurrentHealth())" + "min(HealValue,MaxHealth - CurrentHealth)" ] } ] @@ -5963,13 +5870,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "+", - "Object.Behavior::PropertyHealToBeApplied()" + "HealToBeApplied" ] } ] @@ -5992,12 +5898,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsJustHealed" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsJustHealed", + "True", + "" ] } ] @@ -6043,7 +5949,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxHealth()" + "MaxHealth" ] } ] @@ -6080,13 +5986,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyMaxHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxHealth", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6108,11 +6013,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", ">", "Object.Behavior::MaxHealth()" ] @@ -6121,11 +6025,10 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentHealth" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "=", "Object.Behavior::MaxHealth()" ] @@ -6174,7 +6077,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -6218,7 +6121,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenRate()" + "HealthRegenRate" ] } ] @@ -6255,13 +6158,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealthRegenRate" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HealthRegenRate", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6308,7 +6210,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -6352,7 +6254,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDamageCooldown()" + "DamageCooldown" ] } ] @@ -6389,13 +6291,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyDamageCooldown" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageCooldown", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6442,7 +6343,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -6486,7 +6387,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealthRegenDelay()" + "HealthRegenDelay" ] } ] @@ -6523,13 +6424,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHealthRegenDelay" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HealthRegenDelay", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6576,7 +6476,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -6620,7 +6520,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyChanceToDodge()" + "ChanceToDodge" ] } ] @@ -6657,13 +6557,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyChanceToDodge" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ChanceToDodge", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6710,7 +6609,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -6754,7 +6653,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFlatDamageReduction()" + "FlatDamageReduction" ] } ] @@ -6791,13 +6690,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyFlatDamageReduction" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FlatDamageReduction", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6844,7 +6742,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -6888,7 +6786,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPercentDamageReduction()" + "PercentDamageReduction" ] } ] @@ -6925,13 +6823,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyPercentDamageReduction" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PercentDamageReduction", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -6978,7 +6875,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -7019,12 +6916,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyAllowOverHealing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "AllowOverHealing", + "False", + "" ] } ] @@ -7034,22 +6931,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Value\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyAllowOverHealing" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "AllowOverHealing", + "True", + "" ] } ] @@ -7090,12 +6989,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyHitAtLeastOnce" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "HitAtLeastOnce", + "False", + "" ] } ] @@ -7105,22 +7004,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Value\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyHitAtLeastOnce" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "HitAtLeastOnce", + "True", + "" ] } ] @@ -7161,12 +7062,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsHealthJustDamaged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "IsHealthJustDamaged", + "False", + "" ] } ] @@ -7176,22 +7077,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Value\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyIsHealthJustDamaged" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "IsHealthJustDamaged", + "True", + "" ] } ] @@ -7337,11 +7240,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyHitAtLeastOnce" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HitAtLeastOnce", + "True", + "" ] } ], @@ -7399,11 +7303,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsHealthJustDamaged" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsHealthJustDamaged", + "True", + "" ] } ], @@ -7461,11 +7366,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsJustHealed" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsJustHealed", + "True", + "" ] } ], @@ -7523,20 +7429,20 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyHitAtLeastOnce" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HitAtLeastOnce", + "True", + "" ] }, { "type": { - "value": "Health::Health::PropertyDamageCooldown" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "DamageCooldown", ">", "0" ] @@ -7549,7 +7455,7 @@ "Object", "\"__Health.TimeSinceLastHit\"", "<", - "Object.Behavior::PropertyDamageCooldown()" + "DamageCooldown" ] } ], @@ -7622,7 +7528,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::PropertyDamageCooldown() - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" + "max(0,DamageCooldown - Object.ObjectTimerElapsedTime(\"__Health.TimeSinceLastHit\"))" ] } ] @@ -7673,11 +7579,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentHealth" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentHealth", "<=", "0" ] @@ -7768,7 +7673,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyDamageToBeApplied()" + "DamageToBeApplied" ] } ] @@ -7809,7 +7714,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxShieldPoints()" + "MaxShieldPoints" ] } ] @@ -7846,13 +7751,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyMaxShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxShieldPoints", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -7899,7 +7803,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -7947,7 +7851,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -7991,7 +7895,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyCurrentShieldPoints()" + "CurrentShieldPoints" ] } ] @@ -8028,13 +7932,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -8081,7 +7984,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -8125,7 +8028,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenRate()" + "ShieldRegenRate" ] } ] @@ -8162,13 +8065,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldRegenRate" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldRegenRate", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -8215,7 +8117,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -8259,7 +8161,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldRegenDelay()" + "ShieldRegenDelay" ] } ] @@ -8296,13 +8198,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldRegenDelay" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldRegenDelay", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -8349,7 +8250,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -8393,7 +8294,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDuration()" + "ShieldDuration" ] } ] @@ -8430,13 +8331,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyShieldDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDuration", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -8483,7 +8383,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -8563,13 +8463,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", - "GetArgumentAsNumber(\"ShieldPoints\")" + "ShieldPoints" ] } ] @@ -8579,11 +8478,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyMaxShieldPoints" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxShieldPoints", ">", "0" ] @@ -8592,13 +8490,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyCurrentShieldPoints" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", "=", - "min(GetArgumentAsNumber(\"ShieldPoints\"),Object.Behavior::MaxShield())" + "min(ShieldPoints,Object.Behavior::MaxShield())" ] } ] @@ -8608,10 +8505,12 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"RenewShieldDuration\"" + "RenewShieldDuration", + "True", + "" ] } ], @@ -8670,12 +8569,12 @@ "actions": [ { "type": { - "value": "Health::Health::SetPropertyBlockExcessDamage" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "BlockExcessDamage", + "False", + "" ] } ] @@ -8685,22 +8584,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Value\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "Health::Health::SetPropertyBlockExcessDamage" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "BlockExcessDamage", + "True", + "" ] } ] @@ -8753,11 +8654,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsShieldJustDamaged" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsShieldJustDamaged", + "True", + "" ] } ], @@ -8815,11 +8717,12 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyIsJustDodged" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "IsJustDodged", + "True", + "" ] } ], @@ -8889,11 +8792,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyCurrentShieldPoints" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentShieldPoints", ">", "0" ] @@ -8918,11 +8820,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyShieldDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDuration", "<=", "0" ] @@ -8944,11 +8845,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyShieldDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDuration", ">", "0" ] @@ -8961,7 +8861,7 @@ "Object", "\"__Health.ShieldDuration\"", "<", - "Object.Behavior::PropertyShieldDuration()" + "ShieldDuration" ] } ], @@ -9021,11 +8921,10 @@ "conditions": [ { "type": { - "value": "Health::Health::PropertyShieldDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShieldDuration", ">", "0" ] @@ -9037,7 +8936,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::PropertyShieldDuration() - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" + "max(0,ShieldDuration - Object.ObjectTimerElapsedTime(\"__Health.ShieldDuration\"))" ] } ] @@ -9078,7 +8977,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShieldDamageTaken()" + "ShieldDamageTaken" ] } ] @@ -9119,7 +9018,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHealToBeApplied()" + "HealToBeApplied" ] } ] @@ -9149,18 +9048,14 @@ "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" }, @@ -9170,7 +9065,6 @@ "label": "Maximum health", "description": "Use 0 for no maximum.", "group": "Health", - "extraInformation": [], "name": "MaxHealth" }, { @@ -9178,18 +9072,14 @@ "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" }, @@ -9197,9 +9087,7 @@ "value": "", "type": "Boolean", "label": "", - "description": "", "group": "Health", - "extraInformation": [], "hidden": true, "name": "IsHealthJustDamaged" }, @@ -9207,9 +9095,7 @@ "value": "0", "type": "Number", "label": "Damage to health from the previous incoming damage", - "description": "", "group": "Health", - "extraInformation": [], "hidden": true, "name": "DamageToBeApplied" }, @@ -9217,9 +9103,7 @@ "value": "", "type": "Boolean", "label": "", - "description": "", "group": "Health", - "extraInformation": [], "hidden": true, "name": "HitAtLeastOnce" }, @@ -9229,7 +9113,6 @@ "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" }, @@ -9237,9 +9120,7 @@ "value": "", "type": "Boolean", "label": "", - "description": "", "group": "Health", - "extraInformation": [], "hidden": true, "name": "IsJustDodged" }, @@ -9247,9 +9128,7 @@ "value": "0", "type": "Number", "label": "Health points gained from the previous heal", - "description": "", "group": "Health", - "extraInformation": [], "hidden": true, "name": "HealToBeApplied" }, @@ -9257,9 +9136,7 @@ "value": "0", "type": "Number", "label": "Rate of health regeneration (points per second)", - "description": "", "group": "Health regeneration", - "extraInformation": [], "advanced": true, "name": "HealthRegenRate" }, @@ -9270,7 +9147,6 @@ "label": "Health regeneration delay ", "description": "Delay before health regeneration starts after a hit.", "group": "Health regeneration", - "extraInformation": [], "advanced": true, "name": "HealthRegenDelay" }, @@ -9278,9 +9154,6 @@ "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "IsJustHealed" }, @@ -9288,9 +9161,7 @@ "value": "", "type": "Number", "label": "Current shield points", - "description": "", "group": "Shield", - "extraInformation": [], "hidden": true, "name": "CurrentShieldPoints" }, @@ -9300,7 +9171,6 @@ "label": "Maximum shield", "description": "Leave 0 for unlimited.", "group": "Shield", - "extraInformation": [], "advanced": true, "name": "MaxShieldPoints" }, @@ -9311,7 +9181,6 @@ "label": "Duration of shield", "description": "Use 0 to make the shield permanent.", "group": "Shield", - "extraInformation": [], "advanced": true, "name": "ShieldDuration" }, @@ -9319,9 +9188,7 @@ "value": "0", "type": "Number", "label": "Rate of shield regeneration (points per second)", - "description": "", "group": "Shield regeneration", - "extraInformation": [], "advanced": true, "name": "ShieldRegenRate" }, @@ -9329,9 +9196,7 @@ "value": "", "type": "Boolean", "label": "Block excess damage when shield is broken", - "description": "", "group": "Shield", - "extraInformation": [], "advanced": true, "name": "BlockExcessDamage" }, @@ -9342,7 +9207,6 @@ "label": "Shield regeneration delay", "description": "Delay before shield regeneration starts after a hit.", "group": "Shield regeneration", - "extraInformation": [], "advanced": true, "name": "ShieldRegenDelay" }, @@ -9350,9 +9214,7 @@ "value": "", "type": "Boolean", "label": "", - "description": "", "group": "Shield", - "extraInformation": [], "hidden": true, "name": "IsShieldJustDamaged" }, @@ -9360,9 +9222,7 @@ "value": "", "type": "Number", "label": "Damage to shield from the previous incoming damage", - "description": "", "group": "Shield", - "extraInformation": [], "hidden": true, "name": "ShieldDamageTaken" }, @@ -9372,7 +9232,6 @@ "label": "Flat damage reduction from armor", "description": "Incoming damages are reduced by this value.", "group": "Armor", - "extraInformation": [], "advanced": true, "name": "FlatDamageReduction" }, @@ -9380,9 +9239,7 @@ "value": "0", "type": "Number", "label": "Percentage damage reduction from armor (between 0 and 1)", - "description": "", "group": "Armor", - "extraInformation": [], "advanced": true, "name": "PercentDamageReduction" } @@ -9397,16 +9254,17 @@ "category": "Game mechanic", "extensionNamespace": "", "fullName": "Fire bullets", + "gdevelopVersion": ">=5.5.222", "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.7.0", + "version": "0.9.1", "description": [ - "This extension allows objects to fire bullets.", + "This extension allows objects to fire bullets. To use it, add the behavior to the object that will shoot, then use the provided action to launch another object as the bullet.", "", - "It handles:", + "The properties of the behavior can be used to customize:", "- Cooldown between shots", "- Firing multiple bullets at a time ([open the project online](https://editor.gdevelop.io/?project=example://fire-bullet))", "- Ammo management", @@ -9445,7 +9303,7 @@ "eventsFunctions": [], "eventsBasedBehaviors": [ { - "description": "Fire bullets, manage ammo, reloading, and overheating.", + "description": "Fire bullets, manage ammo, reloading, and overheating. Once added to your object that must shoot, use the behavior action in your events to fire another object as a bullet.", "fullName": "Fire bullets", "name": "FireBullet", "objectType": "", @@ -9471,24 +9329,22 @@ }, { "type": { - "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AmmoQuantity", "=", - "Object.Behavior::PropertyStartingAmmo()" + "StartingAmmo" ] }, { "type": { - "value": "FireBullet::FireBullet::SetPropertyShotsBeforeNextReload" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsBeforeNextReload", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -9541,160 +9397,127 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyHasJustFired" + "value": "BooleanVariable" + }, + "parameters": [ + "HasJustFired", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HasJustFired", + "False", + "" + ] + }, + { + "type": { + "value": "ResetObjectTimer" }, "parameters": [ "Object", - "Behavior" + "\"__FireBullet.FiringCooldown\"" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TotalShotsFired", + "+", + "1" ] } ], - "actions": [], "events": [ { "colorB": 228, "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Reset firing cooldown", + "name": "Ammo", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "inverted": true, + "value": "BooleanVariable" + }, + "parameters": [ + "UnlimitedAmmo", + "True", + "" + ] + } + ], "actions": [ { "type": { - "value": "ResetObjectTimer" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "\"__FireBullet.FiringCooldown\"" + "AmmoQuantity", + "=", + "max(0, AmmoQuantity - 1)" ] } ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Update 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": [ { "type": { - "inverted": true, - "value": "FireBullet::FireBullet::PropertyUnlimitedAmmo" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior" + "ShotsPerReload", + ">", + "0" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", - "=", - "max(0,Object.Behavior::AmmoQuantity() - 1)" + "ShotsBeforeNextReload", + "-", + "1" ] } ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Update reloading counter", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyShotsPerReload" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior", - ">", - "0" + "AutomaticReloading", + "True", + "" ] - } - ], - "actions": [ + }, { "type": { - "value": "FireBullet::FireBullet::SetPropertyShotsBeforeNextReload" - }, - "parameters": [ - "Object", - "Behavior", - "-", - "1" - ] - } - ] - } - ], - "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Automatically reload gun when needed", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "FireBullet::FireBullet::PropertyAutomaticReloading" - }, - "parameters": [ - "Object", - "Behavior" - ] - }, - { - "type": { - "value": "FireBullet::FireBullet::IsReloadNeeded" + "value": "FireBullet::FireBullet::IsReloadNeeded" }, "parameters": [ "Object", @@ -9735,32 +9558,19 @@ "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": [ { "type": { - "value": "FireBullet::FireBullet::PropertyHeatIncreasePerShot" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HeatIncreasePerShot", ">", "0" ] @@ -9769,39 +9579,25 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyHeatLevel" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HeatLevel", "+", - "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": [ { "type": { - "value": "FireBullet::FireBullet::PropertyOverheatDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "OverheatDuration", ">", "0" ] @@ -9833,63 +9629,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": [] } ] } @@ -9901,7 +9640,7 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Reload gun when needed", + "name": "Reload", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ @@ -9938,30 +9677,29 @@ "Object", "\"__FireBullet.ReloadingTimer\"", ">=", - "Object.Behavior::PropertyReloadDuration()" + "ReloadDuration" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyTotalReloadsCompleted" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TotalReloadsCompleted", "+", "1" ] }, { "type": { - "value": "FireBullet::FireBullet::SetPropertyReloadInProgress" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "ReloadInProgress", + "False", + "" ] } ], @@ -9983,13 +9721,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyShotsBeforeNextReload" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsBeforeNextReload", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -10024,13 +9761,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyShotsBeforeNextReload" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsBeforeNextReload", "=", - "min(Object.Behavior::PropertyShotsPerReload(), Object.Behavior::PropertyAmmoQuantity())" + "min(ShotsPerReload, AmmoQuantity)" ] } ] @@ -10045,7 +9781,7 @@ "colorG": 176, "colorR": 74, "creationTime": 0, - "name": "Reduce heat level (based on cooling rate)", + "name": "Cooling", "source": "", "type": "BuiltinCommonInstructions::Group", "events": [ @@ -10057,7 +9793,7 @@ "value": "BuiltinCommonInstructions::CompareNumbers" }, "parameters": [ - "Object.Behavior::HeatLevel()", + "HeatLevel", ">", "0" ] @@ -10070,11 +9806,10 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyExponentialCoolingRate" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ExponentialCoolingRate", ">", "0" ] @@ -10083,13 +9818,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyHeatLevel" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HeatLevel", "=", - "max(0, Object.Behavior::PropertyHeatLevel() - TimeDelta() * Object.Behavior::PropertyExponentialCoolingRate() * Object.Behavior::PropertyHeatLevel())" + "max(0, HeatLevel - TimeDelta() * ExponentialCoolingRate * HeatLevel)" ] } ] @@ -10099,11 +9833,10 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyLinearCoolingRate" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "LinearCoolingRate", ">", "0" ] @@ -10112,13 +9845,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyHeatLevel" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HeatLevel", "=", - "max(0, Object.Behavior::PropertyHeatLevel() - TimeDelta() * Object.Behavior::PropertyLinearCoolingRate())" + "max(0, HeatLevel - TimeDelta() * LinearCoolingRate)" ] } ] @@ -10152,37 +9884,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": [ @@ -10233,37 +9953,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": [ @@ -10319,242 +10027,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": "SetBooleanVariable" + }, + "parameters": [ + "HasJustFired", + "True", + "" + ] + } + ], "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" ] } ] @@ -10562,12 +10216,23 @@ ] } ], - "parameters": [] + "variables": [ + { + "folded": true, + "name": "MultiShotAngle", + "type": "number", + "value": 0 + }, + { + "name": "BulletIndex", + "type": "number", + "value": 0 + } + ] } ] } - ], - "parameters": [] + ] } ], "parameters": [ @@ -10651,9 +10316,9 @@ "parameters": [ "", "Bullet", - "GetArgumentAsNumber(\"XPosition\")", - "GetArgumentAsNumber(\"YPosition\")", - "Object.Behavior::PropertyBulletLayer()" + "XPosition", + "YPosition", + "BulletLayer" ] } ], @@ -10676,13 +10341,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyRandomizedAngle" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "RandomizedAngle", "=", - "GetArgumentAsNumber(\"Angle\") + RandomInRange(-Object.Behavior::PropertyAngleVariance(), Object.Behavior::PropertyAngleVariance())" + "Angle + RandomInRange(-AngleVariance, AngleVariance)" ] }, { @@ -10691,64 +10355,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": { @@ -10766,11 +10379,12 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyRotateBullet" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "RotateBullet", + "True", + "" ] } ], @@ -10782,7 +10396,7 @@ "parameters": [ "Bullet", "=", - "Object.Behavior::PropertyRandomizedAngle()" + "RandomizedAngle" ] } ] @@ -10807,11 +10421,10 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyTotalBulletsCreated" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TotalBulletsCreated", "+", "1" ] @@ -10887,12 +10500,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyReloadInProgress" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "ReloadInProgress", + "True", + "" ] }, { @@ -10930,30 +10543,17 @@ "name": "HasJustFired", "sentence": "_PARAM0_ has just fired", "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "False" - ] - } - ] - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyHasJustFired" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HasJustFired", + "True", + "" ] } ], @@ -10997,11 +10597,12 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyRotateBullet" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "RotateBullet", + "True", + "" ] } ], @@ -11049,7 +10650,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFiringArc()" + "FiringArc" ] } ] @@ -11086,13 +10687,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyFiringArc" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FiringArc", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -11139,7 +10739,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -11183,7 +10783,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAngleVariance()" + "AngleVariance" ] } ] @@ -11220,13 +10820,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAngleVariance" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AngleVariance", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -11273,7 +10872,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -11317,7 +10916,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBulletSpeedVariance()" + "BulletSpeedVariance" ] } ] @@ -11354,13 +10953,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyBulletSpeedVariance" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BulletSpeedVariance", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -11407,7 +11005,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -11451,7 +11049,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyBulletQuantity()" + "BulletQuantity" ] } ] @@ -11488,13 +11086,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyBulletQuantity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "BulletQuantity", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -11541,7 +11138,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -11582,13 +11179,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyBulletLayer" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "BulletLayer", "=", - "GetArgumentAsString(\"Value\")" + "Value" ] } ] @@ -11628,22 +11224,24 @@ { "type": { "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"RotateBullet\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyRotateBullet" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "RotateBullet", + "False", + "" ] } ] @@ -11653,22 +11251,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"RotateBullet\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyRotateBullet" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "RotateBullet", + "True", + "" ] } ] @@ -11689,7 +11289,7 @@ { "defaultValue": "yes", "description": "Rotate bullet to match trajetory", - "name": "RotateBullet", + "name": "Value", "optional": true, "type": "yesorno" } @@ -11710,22 +11310,24 @@ { "type": { "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"UnlimitedAmmo\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyUnlimitedAmmo" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "UnlimitedAmmo", + "False", + "" ] } ] @@ -11735,22 +11337,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"UnlimitedAmmo\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyUnlimitedAmmo" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "UnlimitedAmmo", + "True", + "" ] } ] @@ -11771,7 +11375,7 @@ { "defaultValue": "yes", "description": "Unlimited ammo", - "name": "UnlimitedAmmo", + "name": "Value", "optional": true, "type": "yesorno" } @@ -11795,7 +11399,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyFireCooldown()" + "FireCooldown" ] } ] @@ -11832,13 +11436,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyFireCooldown" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "FireCooldown", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -11885,7 +11488,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"NewCooldown\")", + "Value", "" ] } @@ -11906,7 +11509,7 @@ }, { "description": "Cooldown in seconds", - "name": "NewCooldown", + "name": "Value", "type": "expression" } ], @@ -11929,7 +11532,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyReloadDuration()" + "ReloadDuration" ] } ] @@ -11966,13 +11569,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyReloadDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ReloadDuration", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -12019,7 +11621,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -12063,7 +11665,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyOverheatDuration()" + "OverheatDuration" ] } ] @@ -12100,13 +11702,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyOverheatDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "OverheatDuration", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -12153,7 +11754,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -12197,7 +11798,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyAmmoQuantity()" + "AmmoQuantity" ] } ] @@ -12234,13 +11835,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AmmoQuantity", "=", - "max(0,Value)" + "max(0, Value)" ] } ] @@ -12287,7 +11887,7 @@ "Object", "Behavior", "=", - "max(0,Value)", + "max(0, Value)", "" ] } @@ -12331,7 +11931,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyHeatIncreasePerShot()" + "HeatIncreasePerShot" ] } ] @@ -12368,13 +11968,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyHeatIncreasePerShot" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HeatIncreasePerShot", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -12421,7 +12020,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -12465,7 +12064,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxAmmo()" + "MaxAmmo" ] } ] @@ -12502,13 +12101,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyMaxAmmo" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxAmmo", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -12518,11 +12116,10 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyMaxAmmo" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxAmmo", ">", "0" ] @@ -12531,13 +12128,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AmmoQuantity", "=", - "min(Object.Behavior::MaxAmmo(),Object.Behavior::AmmoQuantity())" + "min(MaxAmmo, AmmoQuantity)" ] } ] @@ -12584,7 +12180,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -12625,11 +12221,10 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyTotalShotsFired" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TotalShotsFired", "=", "0" ] @@ -12666,11 +12261,10 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyTotalBulletsCreated" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TotalBulletsCreated", "=", "0" ] @@ -12707,11 +12301,10 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyTotalReloadsCompleted" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TotalReloadsCompleted", "=", "0" ] @@ -12751,7 +12344,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -12788,13 +12381,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyShotsPerReload" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsPerReload", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -12804,26 +12396,24 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyShotsBeforeNextReload" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsBeforeNextReload", ">", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyShotsBeforeNextReload" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsBeforeNextReload", "=", - "Object.Behavior::PropertyShotsPerReload()" + "ShotsPerReload" ] } ] @@ -12870,7 +12460,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -12911,12 +12501,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAutomaticReloading" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "=" + "AutomaticReloading", + "False", + "" ] } ] @@ -12926,22 +12516,24 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"Value\"" + "Value", + "True", + "" ] } ], "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAutomaticReloading" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "AutomaticReloading", + "True", + "" ] } ] @@ -12986,7 +12578,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyLinearCoolingRate()" + "LinearCoolingRate" ] } ] @@ -13023,13 +12615,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyLinearCoolingRate" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "LinearCoolingRate", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -13076,7 +12667,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -13120,7 +12711,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyExponentialCoolingRate()" + "ExponentialCoolingRate" ] } ] @@ -13157,13 +12748,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyExponentialCoolingRate" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ExponentialCoolingRate", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -13211,7 +12801,7 @@ "Object", "Behavior", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] } @@ -13252,13 +12842,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AmmoQuantity", "+", - "GetArgumentAsNumber(\"AmmoGained\")" + "AmmoGained" ] } ] @@ -13280,11 +12869,10 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyMaxAmmo" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxAmmo", ">", "0" ] @@ -13293,13 +12881,12 @@ "actions": [ { "type": { - "value": "FireBullet::FireBullet::SetPropertyAmmoQuantity" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AmmoQuantity", "=", - "min(Object.Behavior::MaxAmmo(),Object.Behavior::AmmoQuantity())" + "min(MaxAmmo, AmmoQuantity)" ] } ] @@ -13319,11 +12906,12 @@ }, { "type": { - "value": "FireBullet::FireBullet::PropertyAutomaticReloading" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "AutomaticReloading", + "True", + "" ] } ], @@ -13378,7 +12966,7 @@ "value": "SetReturnString" }, "parameters": [ - "Object.Behavior::PropertyBulletLayer()" + "BulletLayer" ] } ] @@ -13419,7 +13007,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "min(1,Object.Behavior::PropertyHeatLevel())" + "min(1, HeatLevel)" ] } ] @@ -13460,7 +13048,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTotalShotsFired()" + "TotalShotsFired" ] } ] @@ -13501,7 +13089,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTotalBulletsCreated()" + "TotalBulletsCreated" ] } ] @@ -13542,7 +13130,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTotalReloadsCompleted()" + "TotalReloadsCompleted" ] } ] @@ -13583,7 +13171,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyShotsBeforeNextReload()" + "ShotsBeforeNextReload" ] } ] @@ -13624,7 +13212,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0,Object.Behavior::Cooldown() - Object.ObjectTimerElapsedTime(\"__FireBullet.FiringCooldown\"))" + "max(0, FireCooldown - Object.ObjectTimerElapsedTime(\"__FireBullet.FiringCooldown\"))" ] } ] @@ -13677,7 +13265,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0, Object.Behavior::PropertyOverheatDuration() - Object.ObjectTimerElapsedTime(\"__FireBullet.OverheatDuration\"))" + "max(0, OverheatDuration - Object.ObjectTimerElapsedTime(\"__FireBullet.OverheatDuration\"))" ] } ] @@ -13730,7 +13318,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "max(0, Object.Behavior::PropertyReloadDuration() - Object.ObjectTimerElapsedTime(\"__FireBullet.ReloadingTimer\"))" + "max(0, ReloadDuration - Object.ObjectTimerElapsedTime(\"__FireBullet.ReloadingTimer\"))" ] } ] @@ -13781,11 +13369,12 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyReloadInProgress" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "ReloadInProgress", + "True", + "" ] } ], @@ -13849,11 +13438,12 @@ "subInstructions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyHasJustFired" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "HasJustFired", + "True", + "" ] }, { @@ -13985,11 +13575,12 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyAutomaticReloading" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "AutomaticReloading", + "True", + "" ] } ], @@ -14047,11 +13638,12 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyUnlimitedAmmo" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "UnlimitedAmmo", + "True", + "" ] } ], @@ -14120,11 +13712,10 @@ }, { "type": { - "value": "FireBullet::FireBullet::PropertyAmmoQuantity" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "AmmoQuantity", "<=", "0" ] @@ -14196,22 +13787,20 @@ "conditions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyShotsPerReload" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsPerReload", ">", "0" ] }, { "type": { - "value": "FireBullet::FireBullet::PropertyShotsBeforeNextReload" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "ShotsBeforeNextReload", "=", "0" ] @@ -14277,11 +13866,10 @@ "subInstructions": [ { "type": { - "value": "FireBullet::FireBullet::PropertyHeatLevel" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "HeatLevel", ">=", "1" ] @@ -14397,17 +13985,12 @@ "unit": "Second", "label": "Firing cooldown", "description": "Objects cannot shoot while firing cooldown is active.", - "group": "", - "extraInformation": [], "name": "FireCooldown" }, { "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "HasJustFired" }, @@ -14415,9 +13998,6 @@ "value": "true", "type": "Boolean", "label": "Rotate bullets to match their trajectory", - "description": "", - "group": "", - "extraInformation": [], "name": "RotateBullet" }, { @@ -14427,7 +14007,6 @@ "label": "Firing arc", "description": "Multi-Fire bullets will be evenly spaced inside the firing arc", "group": "Multi-Fire", - "extraInformation": [], "name": "FiringArc" }, { @@ -14436,7 +14015,6 @@ "label": "Number of bullets created at once", "description": "Multi-Fire bullets will be evenly spaced inside the firing arc", "group": "Multi-Fire", - "extraInformation": [], "name": "BulletQuantity" }, { @@ -14446,7 +14024,6 @@ "label": "Angle variance", "description": "Make imperfect aim (between 0 and 180 degrees).", "group": "Firing variance", - "extraInformation": [], "advanced": true, "name": "AngleVariance" }, @@ -14457,7 +14034,6 @@ "label": "Bullet speed variance", "description": "Bullet speed will be adjusted by a random value within this range.", "group": "Firing variance", - "extraInformation": [], "advanced": true, "name": "BulletSpeedVariance" }, @@ -14465,9 +14041,6 @@ "value": "0", "type": "Number", "label": "Ammo quantity (current)", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "AmmoQuantity" }, @@ -14477,7 +14050,6 @@ "label": "Shots per reload ", "description": "Use 0 to disable reloading.", "group": "Reload", - "extraInformation": [], "advanced": true, "name": "ShotsPerReload" }, @@ -14488,7 +14060,6 @@ "label": "Reloading duration", "description": "Objects cannot shoot while reloading is in progress.", "group": "Reload", - "extraInformation": [], "advanced": true, "name": "ReloadDuration" }, @@ -14496,9 +14067,7 @@ "value": "0", "type": "Number", "label": "Max ammo ", - "description": "", "group": "Ammo", - "extraInformation": [], "advanced": true, "name": "MaxAmmo" }, @@ -14506,9 +14075,6 @@ "value": "0", "type": "Number", "label": "Shots before next reload", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "ShotsBeforeNextReload" }, @@ -14517,8 +14083,6 @@ "type": "Number", "label": "Total shots fired", "description": "Regardless of how many bullets are created, only 1 shot will be counted per frame", - "group": "", - "extraInformation": [], "hidden": true, "name": "TotalShotsFired" }, @@ -14526,9 +14090,6 @@ "value": "0", "type": "Number", "label": "Total bullets created", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TotalBulletsCreated" }, @@ -14536,9 +14097,7 @@ "value": "0", "type": "Number", "label": "Starting ammo", - "description": "", "group": "Ammo", - "extraInformation": [], "advanced": true, "name": "StartingAmmo" }, @@ -14546,9 +14105,6 @@ "value": "0", "type": "Number", "label": "Total reloads completed", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TotalReloadsCompleted" }, @@ -14556,9 +14112,7 @@ "value": "true", "type": "Boolean", "label": "Unlimited ammo", - "description": "", "group": "Ammo", - "extraInformation": [], "advanced": true, "name": "UnlimitedAmmo" }, @@ -14566,9 +14120,6 @@ "value": "", "type": "Boolean", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "ReloadInProgress" }, @@ -14578,7 +14129,6 @@ "label": "Heat increase per shot (between 0 and 1)", "description": " Object is overheated when Heat reaches 1.", "group": "Overheat", - "extraInformation": [], "advanced": true, "name": "HeatIncreasePerShot" }, @@ -14586,9 +14136,6 @@ "value": "0", "type": "Number", "label": "Heat level (Range: 0 to 1)", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "HeatLevel" }, @@ -14596,9 +14143,7 @@ "value": "true", "type": "Boolean", "label": "Reload automatically", - "description": "", "group": "Reload", - "extraInformation": [], "advanced": true, "name": "AutomaticReloading" }, @@ -14609,7 +14154,6 @@ "label": "Overheat duration", "description": "Object cannot shoot while overheat duration is active.", "group": "Overheat", - "extraInformation": [], "advanced": true, "name": "OverheatDuration" }, @@ -14617,9 +14161,7 @@ "value": "0.1", "type": "Number", "label": "Linear cooling rate (per second)", - "description": "", "group": "Overheat", - "extraInformation": [], "advanced": true, "name": "LinearCoolingRate" }, @@ -14642,7 +14184,6 @@ "label": "Layer the bullets are created on", "description": "Base layer by default.", "group": "Shooting configuration", - "extraInformation": [], "hidden": true, "name": "BulletLayer" }, @@ -14650,9 +14191,6 @@ "value": "0", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "RandomizedAngle" } @@ -14667,12 +14205,13 @@ "category": "Game mechanic", "extensionNamespace": "", "fullName": "Rectangular grid", + "gdevelopVersion": ">=5.5.222", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXZpZXctZ3JpZC1wbHVzLW91dGxpbmUiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMyAyMUgxMVYxM0gzTTUgMTVIOVYxOUg1TTMgMTFIMTFWM0gzTTUgNUg5VjlINU0xMyAzVjExSDIxVjNNMTkgOUgxNVY1SDE5TTE4IDE2SDIxVjE4SDE4VjIxSDE2VjE4SDEzVjE2SDE2VjEzSDE4WiIgLz48L3N2Zz4=", "name": "SnapToGrid", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/view-grid-plus-outline.svg", "shortDescription": "Snap objects on a virtual grid.", - "version": "0.0.3", + "version": "0.0.4", "description": [ "It allows to snap objects on a *virtual grid*.", "", @@ -14727,9 +14266,9 @@ "parameters": [ "Object", "=", - "GetArgumentAsNumber(\"CellWidth\") * round((Object.X() - GetArgumentAsNumber(\"OffsetX\")) / GetArgumentAsNumber(\"CellWidth\")) + GetArgumentAsNumber(\"OffsetX\")", + "CellWidth * round((Object.X() - OffsetX) / CellWidth) + OffsetX", "=", - "GetArgumentAsNumber(\"CellHeight\") * round((Object.Y() - GetArgumentAsNumber(\"OffsetY\")) / GetArgumentAsNumber(\"CellHeight\")) + GetArgumentAsNumber(\"OffsetY\")" + "CellHeight * round((Object.Y() - OffsetY) / CellHeight) + OffsetY" ] } ] @@ -14773,12 +14312,13 @@ "category": "User interface", "extensionNamespace": "", "fullName": "Panel sprite button", + "gdevelopVersion": ">=5.5.222", "helpPath": "/objects/button", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI5LDIzSDNjLTEuMSwwLTItMC45LTItMlYxMWMwLTEuMSwwLjktMiwyLTJoMjZjMS4xLDAsMiwwLjksMiwydjEwQzMxLDIyLjEsMzAuMSwyMywyOSwyM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMywxOUwxMywxOWMtMS4xLDAtMi0wLjktMi0ydi0yYzAtMS4xLDAuOS0yLDItMmgwYzEuMSwwLDIsMC45LDIsMnYyQzE1LDE4LjEsMTQuMSwxOSwxMywxOXoiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIxOCIgeTE9IjEzIiB4Mj0iMTgiIHkyPSIxOSIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIxIiB5MT0iMTMiIHgyPSIxOCIgeTI9IjE3Ii8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMjEiIHkxPSIxOSIgeDI9IjE5IiB5Mj0iMTYiLz4NCjwvc3ZnPg0K", "name": "PanelSpriteButton", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg", "shortDescription": "A button that can be customized.", - "version": "1.4.4", + "version": "1.5.0", "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.", "", @@ -14839,11 +14379,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Validated\"" ] @@ -14852,11 +14391,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] @@ -14890,12 +14428,12 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyMouseIsInside" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "MouseIsInside", + "False", + "" ] } ] @@ -14905,11 +14443,12 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyShouldCheckHovering" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "ShouldCheckHovering", + "True", + "" ] }, { @@ -14926,12 +14465,12 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyMouseIsInside" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "MouseIsInside", + "True", + "" ] } ] @@ -14954,12 +14493,12 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchIsInside" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "no" + "TouchIsInside", + "False", + "" ] } ] @@ -14969,11 +14508,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyTouchId" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "!=", "0" ] @@ -14984,20 +14522,20 @@ }, "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)" ] } ], "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchIsInside" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "TouchIsInside", + "True", + "" ] } ] @@ -15029,11 +14567,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyIndex" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "Index", "=", "0" ] @@ -15055,31 +14592,30 @@ }, "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)" ] } ], "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", - "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())" + "StartedTouchOrMouseId(Index)" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchIsInside" + "value": "SetBooleanVariable" }, "parameters": [ - "Object", - "Behavior", - "yes" + "TouchIsInside", + "True", + "" ] } ], @@ -15121,11 +14657,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -15140,11 +14675,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyIndex" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "Index", "+", "1" ] @@ -15173,20 +14707,20 @@ { "type": { "inverted": true, - "value": "PanelSpriteButton::ButtonFSM::PropertyMouseIsInside" + "value": "BooleanVariable" }, - "parameters": [ - "Object", - "Behavior" + "parameters": [ + "MouseIsInside", + "True", + "" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Hovered\"" ] @@ -15195,11 +14729,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] @@ -15211,20 +14744,20 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyMouseIsInside" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "MouseIsInside", + "True", + "" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] @@ -15233,11 +14766,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Hovered\"" ] @@ -15250,20 +14782,20 @@ { "type": { "inverted": true, - "value": "PanelSpriteButton::ButtonFSM::PropertyTouchIsInside" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "TouchIsInside", + "True", + "" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -15272,11 +14804,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedOutside\"" ] @@ -15288,20 +14819,20 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyTouchIsInside" + "value": "BooleanVariable" }, "parameters": [ - "Object", - "Behavior" + "TouchIsInside", + "True", + "" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedOutside\"" ] @@ -15310,11 +14841,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -15342,18 +14872,17 @@ }, "parameters": [ "", - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ], "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", "0" ] @@ -15365,11 +14894,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -15378,11 +14906,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Validated\"" ] @@ -15395,11 +14922,10 @@ { "type": { "inverted": true, - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -15407,11 +14933,10 @@ { "type": { "inverted": true, - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Validated\"" ] @@ -15420,11 +14945,10 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] @@ -15507,22 +15031,20 @@ "actions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyState" + "value": "SetStringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] }, { "type": { - "value": "PanelSpriteButton::ButtonFSM::SetPropertyTouchId" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "TouchId", "=", "0" ] @@ -15557,11 +15079,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Idle\"" ] @@ -15606,11 +15127,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Validated\"" ] @@ -15655,11 +15175,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Hovered\"" ] @@ -15704,11 +15223,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"Hovered\"" ] @@ -15730,11 +15248,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedOutside\"" ] @@ -15779,11 +15296,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedInside\"" ] @@ -15828,11 +15344,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::ButtonFSM::PropertyState" + "value": "StringVariable" }, "parameters": [ - "Object", - "Behavior", + "State", "=", "\"PressedOutside\"" ] @@ -15881,7 +15396,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyTouchId()" + "TouchId" ] } ] @@ -15912,8 +15427,6 @@ "type": "Boolean", "label": "", "description": "Should check hovering", - "group": "", - "extraInformation": [], "hidden": true, "name": "ShouldCheckHovering" }, @@ -15921,8 +15434,6 @@ "value": "Idle", "type": "Choice", "label": "State", - "description": "", - "group": "", "extraInformation": [ "Idle", "Hovered", @@ -15937,9 +15448,6 @@ "value": "0", "type": "Number", "label": "Touch id", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TouchId" }, @@ -15947,9 +15455,6 @@ "value": "", "type": "Boolean", "label": "Touch is inside", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "TouchIsInside" }, @@ -15957,9 +15462,6 @@ "value": "", "type": "Boolean", "label": "Mouse is inside", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "MouseIsInside" }, @@ -15967,9 +15469,6 @@ "value": "", "type": "Number", "label": "", - "description": "", - "group": "", - "extraInformation": [], "hidden": true, "name": "Index" } @@ -15988,7 +15487,167 @@ "defaultName": "Button", "description": "A button that can be customized.", "fullName": "Button (panel sprite)", + "isUsingLegacyInstancesRenderer": true, "name": "PanelSpriteButton", + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Label", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Text", + "font": "", + "textAlignment": "", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Text", + "font": "", + "textAlignment": "", + "verticalTextAlignment": "top", + "characterSize": 20, + "color": "0;0;0" + } + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Idle", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [ + { + "folded": true, + "name": "State", + "type": "string", + "value": "Idle" + } + ], + "effects": [], + "behaviors": [ + { + "name": "ButtonFSM", + "type": "PanelSpriteButton::ButtonFSM", + "ShouldCheckHovering": true + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Hovered", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Pressed", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Label" + }, + { + "objectName": "Idle" + }, + { + "objectName": "Hovered" + }, + { + "objectName": "Pressed" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [], "eventsFunctions": [ { "fullName": "", @@ -16281,10 +15940,10 @@ }, { "type": { - "value": "PanelSpriteButton::PanelSpriteButton::PropertyHoveredFadeOutDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", + "HoveredFadeOutDuration", ">", "0" ] @@ -16312,10 +15971,10 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::PanelSpriteButton::PropertyHoveredFadeOutDuration" + "value": "NumberVariable" }, "parameters": [ - "Object", + "HoveredFadeOutDuration", "=", "0" ] @@ -16595,87 +16254,104 @@ "subInstructions": [ { "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Object.Width()", + "!=", + "max(Idle.BoundingBoxRight(), Label.BoundingBoxRight()) - min(Idle.BoundingBoxLeft(), Label.BoundingBoxLeft())" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Object.Height()", + "!=", + "max(Idle.BoundingBoxBottom(), Label.BoundingBoxBottom()) - min(Idle.BoundingBoxTop(), Label.BoundingBoxTop())" + ] + } + ] + } + ], + "actions": [], + "events": [ + { + "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.Width()", - "!=", - "max(Idle.BoundingBoxRight(), Label.BoundingBoxRight()) - min(Idle.BoundingBoxLeft(), Label.BoundingBoxLeft())" + "Object", + "=", + "1" ] }, { "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" + "value": "PanelSpriteObject::Width" }, "parameters": [ - "Object.Height()", - "!=", - "max(Idle.BoundingBoxBottom(), Label.BoundingBoxBottom()) - min(Idle.BoundingBoxTop(), Label.BoundingBoxTop())" + "Background", + "=", + "Width" + ] + }, + { + "type": { + "value": "PanelSpriteObject::Height" + }, + "parameters": [ + "Background", + "=", + "Height" + ] + }, + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + }, + "parameters": [ + "Object", + "" ] } - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Idle", - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Idle", - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "PanelSpriteButton::Scale" - }, - "parameters": [ - "Object", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Idle.Variable(Width)" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Idle.Variable(Height)" - ] - }, - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" - }, - "parameters": [ - "Object", - "" + ], + "variables": [ + { + "name": "Width", + "type": "number", + "value": 0 + }, + { + "name": "Height", + "type": "number", + "value": 0 + } ] } ] @@ -16942,7 +16618,7 @@ "parameters": [ "Label", "=", - "GetArgumentAsString(\"LabelText\")" + "LabelText" ] }, { @@ -16973,11 +16649,11 @@ "objectGroups": [] }, { - "description": "Return the label text.", + "description": "the label text.", "fullName": "Label text", - "functionType": "StringExpression", + "functionType": "ExpressionAndCondition", "name": "LabelText", - "sentence": "", + "sentence": "the label text", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -17171,10 +16847,12 @@ "conditions": [ { "type": { - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"ShouldActivate\"" + "ShouldActivate", + "True", + "" ] } ], @@ -17197,10 +16875,12 @@ { "type": { "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "BooleanVariable" }, "parameters": [ - "\"ShouldActivate\"" + "ShouldActivate", + "True", + "" ] } ], @@ -17281,16 +16961,12 @@ "value": "0", "type": "Number", "label": "Label offset on Y axis when pressed", - "description": "", - "group": "", - "extraInformation": [], "name": "PressedLabelOffsetY" }, { "value": "0", "type": "Number", "label": "Left padding", - "description": "", "group": "Padding", "extraInformation": [ "Label" @@ -17301,7 +16977,6 @@ "value": "0", "type": "Number", "label": "Right padding", - "description": "", "group": "Padding", "extraInformation": [ "Label" @@ -17312,7 +16987,6 @@ "value": "0", "type": "Number", "label": "Top padding", - "description": "", "group": "Padding", "extraInformation": [ "Label" @@ -17323,7 +16997,6 @@ "value": "0", "type": "Number", "label": "Bottom padding", - "description": "", "group": "Padding", "extraInformation": [ "Label" @@ -17334,174 +17007,13 @@ "value": "0.25", "type": "Number", "label": "Hovered fade out duration (in seconds)", - "description": "", - "group": "", - "extraInformation": [], "name": "HoveredFadeOutDuration" } ], - "objects": [ - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "Label", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [], - "string": "Text", - "font": "", - "textAlignment": "", - "characterSize": 20, - "color": { - "b": 0, - "g": 0, - "r": 0 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Text", - "font": "", - "textAlignment": "", - "characterSize": 20, - "color": "0;0;0" - } - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Idle", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [ - { - "folded": true, - "name": "State", - "type": "string", - "value": "Idle" - } - ], - "effects": [], - "behaviors": [ - { - "name": "ButtonFSM", - "type": "PanelSpriteButton::ButtonFSM", - "ShouldCheckHovering": true - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Hovered", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Pressed", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Label" - }, - { - "objectName": "Idle" - }, - { - "objectName": "Hovered" - }, - { - "objectName": "Pressed" - } - ] - }, - "objectsGroups": [], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - } - ], - "instances": [] + "variants": [] } ] } ], - "externalLayouts": [], - "externalSourceFiles": [] + "externalLayouts": [] } \ No newline at end of file From 0df6c2ef82843cb8aa045e4f387e41aeb14343f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 15 Jul 2025 19:40:19 +0200 Subject: [PATCH 8/9] Use a variant. --- .../tower-defense-war/tower-defense-war.json | 1222 ++++++++++------- 1 file changed, 758 insertions(+), 464 deletions(-) diff --git a/examples/tower-defense-war/tower-defense-war.json b/examples/tower-defense-war/tower-defense-war.json index 6f05301b2..4d512701a 100644 --- a/examples/tower-defense-war/tower-defense-war.json +++ b/examples/tower-defense-war/tower-defense-war.json @@ -747,11 +747,11 @@ { "angle": 0, "customSize": false, - "height": 0, + "height": 224, "layer": "", "name": "FlatHeartBar", "persistentUuid": "37106cef-cb35-4f2d-a7cd-37d2e839ea6d", - "width": 0, + "width": 992, "x": 0, "y": 0, "zOrder": 35, @@ -1504,7 +1504,7 @@ "assetStoreId": "c807d51d4bab0016401aef4d64d10d137f5ac8738ffa15865e1bc81435b9720b", "name": "FlatHeartBar", "type": "TiledUnitsBar::TiledUnitsBar", - "variant": "", + "variant": "Flat hearth bar", "variables": [], "effects": [], "behaviors": [], @@ -2802,13 +2802,13 @@ "category": "User interface", "extensionNamespace": "", "fullName": "Resource bar (separated units)", - "gdevelopVersion": "", + "gdevelopVersion": ">=5.5.230", "helpPath": "/objects/resource-bar", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWRvdHMtaG9yaXpvbnRhbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNiwxMkEyLDIgMCAwLDEgMTgsMTBBMiwyIDAgMCwxIDIwLDEyQTIsMiAwIDAsMSAxOCwxNEEyLDIgMCAwLDEgMTYsMTJNMTAsMTJBMiwyIDAgMCwxIDEyLDEwQTIsMiAwIDAsMSAxNCwxMkEyLDIgMCAwLDEgMTIsMTRBMiwyIDAgMCwxIDEwLDEyTTQsMTJBMiwyIDAgMCwxIDYsMTBBMiwyIDAgMCwxIDgsMTJBMiwyIDAgMCwxIDYsMTRBMiwyIDAgMCwxIDQsMTJaIiAvPjwvc3ZnPg==", "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.2", + "version": "2.0.0", "description": [ "A bar that represents a resource in the game (health, mana, ammo, etc).", "", @@ -2833,10 +2833,109 @@ "gqDaZjCfevOOxBYkK6zlhtZnXCg1", "q8ubdigLvIRXLxsJDDTaokO41mc2" ], + "changelog": [ + { + "version": "2.0.0", + "breaking": "- Resource bars now use variants, you will have to make some adjustments to existing resource bars in your project by following this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/)." + } + ], "dependencies": [], "globalVariables": [], "sceneVariables": [], - "eventsFunctions": [], + "eventsFunctions": [ + { + "description": "left anchor", + "fullName": "Left anchor", + "functionType": "ExpressionAndCondition", + "name": "LeftEdgeAnchor", + "private": true, + "sentence": "Left anchor of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._TiledUnitsBarExtension = gdjs._TiledUnitsBarExtension || {", + " anchors: [\"None\", \"Min\", \"Max\", \"Proportional\", \"Center\"]", + "}", + "const { anchors } = gdjs._TiledUnitsBarExtension;", + "", + "const object = objects[0];", + "/** @type {gdjs.AnchorRuntimeBehavior} */", + "const anchor = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Anchor\"));", + "eventsFunctionContext.returnValue = anchors[anchor._leftEdgeAnchor] || \"None\";", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "supplementaryInformation": "[\"None\",\"Min\",\"Max\",\"Proportional\",\"Center\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Anchor", + "name": "Anchor", + "supplementaryInformation": "AnchorBehavior::AnchorBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "left anchor", + "fullName": "Right anchor", + "functionType": "ExpressionAndCondition", + "name": "RightEdgeAnchor", + "private": true, + "sentence": "Right anchor of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "gdjs._TiledUnitsBarExtension = gdjs._TiledUnitsBarExtension || {", + " anchors: [\"None\", \"Min\", \"Max\", \"Proportional\", \"Center\"]", + "}", + "const { anchors } = gdjs._TiledUnitsBarExtension;", + "", + "const object = objects[0];", + "/** @type {gdjs.AnchorRuntimeBehavior} */", + "const anchor = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Anchor\"));", + "eventsFunctionContext.returnValue = anchors[anchor._rightEdgeAnchor] || \"None\";", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "supplementaryInformation": "[\"None\",\"Min\",\"Max\",\"Proportional\",\"Center\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Anchor", + "name": "Anchor", + "supplementaryInformation": "AnchorBehavior::AnchorBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], "eventsBasedBehaviors": [ { "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", @@ -2875,7 +2974,7 @@ "Object", "\"__ResourceBar.LastValueChange\"", "<=", - "Object.Behavior::PropertyPreviousHighValueDuration()" + "PreviousHighValueDuration" ] } ], @@ -2924,7 +3023,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyValue()" + "CurrentValue" ] } ] @@ -2961,13 +3060,12 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentValue", "=", - "clamp(GetArgumentAsNumber(\"Value\"), 0, Object.Behavior::MaxValue())" + "clamp(Value, 0, MaxValue)" ] } ] @@ -2977,13 +3075,12 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "Value", "<", - "Object.Behavior::PreviousHighValue()" + "PreviousHighValue" ] } ], @@ -3004,13 +3101,12 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "Value", ">=", - "Object.Behavior::PropertyPreviousHighValue()" + "PreviousHighValue" ] } ], @@ -3060,7 +3156,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyMaxValue()" + "MaxValue" ] } ] @@ -3097,13 +3193,12 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyMaxValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "MaxValue", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -3136,11 +3231,10 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentValue", "=", "0" ] @@ -3185,13 +3279,12 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::PropertyValue" + "value": "NumberVariable" }, "parameters": [ - "Object", - "Behavior", + "CurrentValue", "=", - "Object.Behavior::PropertyMaxValue()" + "MaxValue" ] } ], @@ -3238,7 +3331,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPreviousHighValue()" + "PreviousHighValue" ] } ] @@ -3275,13 +3368,12 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyPreviousHighValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PreviousHighValue", "=", - "Object.Behavior::PropertyValue()" + "CurrentValue" ] } ] @@ -3319,7 +3411,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Object.Behavior::PropertyPreviousHighValueDuration()" + "PreviousHighValueDuration" ] } ] @@ -3356,13 +3448,12 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetPropertyPreviousHighValueDuration" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", + "PreviousHighValueDuration", "=", - "GetArgumentAsNumber(\"Value\")" + "Value" ] } ] @@ -3401,7 +3492,7 @@ "Object", "Behavior", "!=", - "Object.Behavior::PropertyValue()", + "CurrentValue", "" ] }, @@ -3413,7 +3504,7 @@ "Object", "\"__ResourceBar.LastValueChange\"", "<=", - "Object.Behavior::PropertyPreviousHighValueDuration()" + "PreviousHighValueDuration" ] } ], @@ -3450,7 +3541,7 @@ "value": "1", "type": "Number", "label": "Value", - "name": "Value" + "name": "CurrentValue" }, { "value": "3", @@ -3477,8 +3568,8 @@ ], "eventsBasedObjects": [ { - "areaMaxX": 64, - "areaMaxY": 64, + "areaMaxX": 96, + "areaMaxY": 32, "areaMaxZ": 64, "areaMinX": 0, "areaMinY": 0, @@ -3486,7 +3577,8 @@ "defaultName": "ResourceBar", "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", "fullName": "Resource bar (separated units)", - "isUsingLegacyInstancesRenderer": true, + "isInnerAreaFollowingParentSize": true, + "isUsingLegacyInstancesRenderer": false, "name": "TiledUnitsBar", "objects": [ { @@ -3499,6 +3591,16 @@ "variables": [], "effects": [], "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + }, { "name": "ResourceBar", "type": "TiledUnitsBar::ResourceBar", @@ -3517,7 +3619,18 @@ "width": 32, "variables": [], "effects": [], - "behaviors": [] + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + } + ] }, { "assetStoreId": "", @@ -3527,13 +3640,24 @@ "name": "Background", "rightMargin": 0, "texture": "", - "tiled": true, + "tiled": false, "topMargin": 0, "type": "PanelSpriteObject::PanelSprite", "width": 32, "variables": [], "effects": [], - "behaviors": [] + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] } ], "objectsFolderStructure": { @@ -3581,7 +3705,56 @@ "effects": [] } ], - "instances": [], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 32, + "layer": "", + "name": "Background", + "persistentUuid": "b13e773c-6941-4f67-b198-030f29c8b679", + "width": 96, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 26, + "layer": "", + "name": "Bar", + "persistentUuid": "caf6fdad-096d-4247-b23b-6cc1a89ce9f8", + "width": 90, + "x": 3, + "y": 3, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 26, + "layer": "", + "name": "FillBar", + "persistentUuid": "4b784a8f-dbae-4d8b-a287-628642416d10", + "width": 60, + "x": 3, + "y": 3, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], "eventsFunctions": [ { "fullName": "", @@ -3607,16 +3780,33 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::SetPropertyPreviousInitialValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", + "PreviousInitialValue", "=", - "Object.PropertyInitialValue()" + "InitialValue" ] } ] - }, + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -3627,119 +3817,18 @@ "textG": 0, "textR": 0 }, - "comment": "Create the child-object instances." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "Background", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "Bar", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "FillBar", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Background", - "=", - "1" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Bar", - "=", - "2" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "FillBar", - "=", - "3" - ] - } - ] + "comment": "Pass the configuration to the behavior (MaxValue must be set before Value)." }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "inverted": true, - "value": "TiledUnitsBar::TiledUnitsBar::PropertyShowBackground" + "value": "BuiltinCommonInstructions::Once" }, - "parameters": [ - "Object" - ] + "parameters": [] } ], - "actions": [ - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Background" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Pass the configuration to the behavior (MaxValue must be set before Value)." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], "actions": [ { "type": { @@ -3748,7 +3837,7 @@ "parameters": [ "Object", "=", - "Object.PropertyMaxValue()", + "MaxValue", "" ] }, @@ -3759,7 +3848,7 @@ "parameters": [ "Object", "=", - "Object.PropertyInitialValue()", + "InitialValue", "" ] } @@ -3788,11 +3877,13 @@ "actions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" + "value": "TiledUnitsBar::TiledUnitsBar::SetUnitWidth" }, "parameters": [ "Object", - "" + "=", + "UnitWidth", + "Object.PropertyMaxValue()" ] }, { @@ -3802,7 +3893,7 @@ "parameters": [ "Object", "=", - "Object.PropertyMaxValue()", + "MaxValue", "Object.PropertyMaxValue()" ] } @@ -3813,24 +3904,24 @@ "conditions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::PropertyInitialValue" + "value": "NumberVariable" }, "parameters": [ - "Object", + "InitialValue", "!=", - "Object.PropertyPreviousInitialValue()" + "PreviousInitialValue" ] } ], "actions": [ { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::SetPropertyPreviousInitialValue" + "value": "SetNumberVariable" }, "parameters": [ - "Object", + "PreviousInitialValue", "=", - "Object.PropertyInitialValue()" + "InitialValue" ] }, { @@ -3840,7 +3931,7 @@ "parameters": [ "Object", "=", - "Object.PropertyInitialValue()", + "InitialValue", "Object.PropertyInitialValue()" ] } @@ -3858,229 +3949,17 @@ "objectGroups": [] }, { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", + "description": "the value of the object.", + "fullName": "Value", + "functionType": "ExpressionAndCondition", + "group": "Resource bar", + "name": "Value", + "sentence": "the value", "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 button size change:\n- background is resized to take the full dimensions of the button\n- the bar size is refreshed according to the value\n\nThe scale is set back to 1 because it means that the parent instance has the same dimensions as the union of its children instances." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Width()", - "!=", - "max(Background.BoundingBoxRight(), Bar.BoundingBoxRight()) - min(Background.BoundingBoxLeft(), Bar.BoundingBoxLeft())" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Height()", - "!=", - "max(Background.BoundingBoxBottom(), Bar.BoundingBoxBottom()) - min(Background.BoundingBoxTop(), Bar.BoundingBoxTop())" - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Background", - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "ModVarObjet" - }, - "parameters": [ - "Background", - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "TiledUnitsBar::Scale" - }, - "parameters": [ - "Object", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Background.Variable(Width)" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Background.Variable(Height)" - ] - }, - { - "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" - }, - "parameters": [ - "Object", - "" - ] - } - ] - } - ], - "parameters": [] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Center the bar according to the button configuration. This is used in doStepPostEvents when the button is resized.", - "fullName": "", - "functionType": "Action", - "name": "CenterBar", - "private": true, - "sentence": "Center the bar of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetCenter" - }, - "parameters": [ - "Bar", - "=", - "Background.CenterX()", - "=", - "Background.CenterY()" - ] - }, - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Bar", - "+", - "0" - ] - }, - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Bar", - "+", - "0" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "MettreXY" - }, - "parameters": [ - "FillBar", - "=", - "Bar.X()", - "=", - "Bar.Y()" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", - "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": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { "type": { "value": "SetReturnNumber" @@ -4112,6 +3991,18 @@ "name": "SetValue", "sentence": "", "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The value is clamped by the behavior. This is why Object.Value() is used instead of Value directly." + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], @@ -4124,18 +4015,17 @@ "FillBar", "ResourceBar", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, { "type": { - "value": "TiledSpriteObject::Width" + "value": "TiledUnitsBar::TiledUnitsBar::UpdateBarWidth" }, "parameters": [ - "FillBar", - "=", - "FillBar.ResourceBar::Value() * Object.PropertyUnitWidth()" + "Object", + "" ] } ] @@ -4174,7 +4064,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "FillBar.ResourceBar::PropertyMaxValue()" + "FillBar.ResourceBar::MaxValue()" ] } ] @@ -4212,26 +4102,18 @@ "FillBar", "ResourceBar", "=", - "GetArgumentAsNumber(\"Value\")", + "Value", "" ] }, { "type": { - "value": "TiledSpriteObject::Width" - }, - "parameters": [ - "Bar", - "=", - "Object.PropertyMaxValue() * Object.PropertyUnitWidth()" - ] - }, - { - "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" + "value": "TiledUnitsBar::TiledUnitsBar::SetValue" }, "parameters": [ "Object", + "=", + "Object.Value()", "" ] } @@ -4341,18 +4223,312 @@ } ], "objectGroups": [] + }, + { + "description": "the unit width of the object. How much pixels to show for a value of 1.", + "fullName": "Unit width", + "functionType": "ExpressionAndCondition", + "group": "Resource bar configuration", + "name": "UnitWidth", + "private": true, + "sentence": "the unit width", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "UnitWidth" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "UnitWidth", + "name": "SetUnitWidth", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "UnitWidth", + "=", + "Value" + ] + }, + { + "type": { + "value": "TiledUnitsBar::TiledUnitsBar::UpdateBarWidth" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "Update the bar width.", + "fullName": "Bar width", + "functionType": "Action", + "name": "UpdateBarWidth", + "private": true, + "sentence": "Update the bar width of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "NewWidth", + "=", + "Object.MaxValue() * UnitWidth" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TiledUnitsBar::LeftEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Center\"", + "Bar", + "Anchor", + "" + ] + }, + { + "type": { + "value": "TiledUnitsBar::RightEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Center\"", + "Bar", + "Anchor", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Bar", + "-", + "(NewWidth - Bar.Width()) / 2" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TiledUnitsBar::LeftEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + }, + { + "type": { + "value": "TiledUnitsBar::RightEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Bar", + "-", + "NewWidth - Bar.Width()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "Bar", + "Resizable", + "=", + "NewWidth" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "FillBar", + "Resizable", + "=", + "Object.Value() * UnitWidth" + ] + }, + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "FillBar", + "=", + "Bar.X()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TiledUnitsBar::LeftEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + }, + { + "type": { + "value": "TiledUnitsBar::RightEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "FillBar", + "=", + "Bar.X() + Bar.Width() - FillBar.Width()" + ] + } + ] + } + ], + "variables": [ + { + "name": "NewWidth", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", + "type": "object" + } + ], + "objectGroups": [] } ], "propertyDescriptors": [ { "value": "3", "type": "Number", + "unit": "Dimensionless", "label": "Maximum value", "name": "MaxValue" }, { "value": "3", "type": "Number", + "unit": "Dimensionless", "label": "Initial value", "name": "InitialValue" }, @@ -4367,64 +4543,182 @@ { "value": "24", "type": "Number", + "unit": "Pixel", "label": "Unit width", "description": "How much pixels to show for a value of 1.", "name": "UnitWidth" - }, - { - "value": "true", - "type": "Boolean", - "label": "Show the background", - "extraInformation": [ - "Background" - ], - "name": "ShowBackground" - }, - { - "value": "0", - "type": "Number", - "label": "Bar left margin", - "extraInformation": [ - "FillBar", - "Bar" - ], - "name": "BarLeftPadding" - }, - { - "value": "0", - "type": "Number", - "label": "Bar right margin", - "extraInformation": [ - "FillBar", - "Bar" - ], - "name": "BarRightPadding" - }, - { - "value": "Center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "extraInformation": [ - "FillBar", - "Bar" - ], - "hidden": true, - "name": "BarVerticalAnchorOrigin" - }, - { - "value": "Center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "extraInformation": [ - "Background" - ], - "hidden": true, - "name": "BarVerticalAnchorTarget" } ], - "variants": [] + "variants": [ + { + "areaMaxX": 270, + "areaMaxY": 90, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "name": "Flat hearth bar", + "objects": [ + { + "assetStoreId": "", + "height": 90, + "name": "FillBar", + "texture": "Flat Heart Filled.png", + "type": "TiledSpriteObject::TiledSprite", + "width": 90, + "variables": [], + "effects": [], + "behaviors": [ + { + "leftEdgeAnchor": 1, + "name": "Anchor", + "rightEdgeAnchor": 2, + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "ResourceBar", + "type": "TiledUnitsBar::ResourceBar", + "Value": 1, + "MaxValue": 3, + "PreviousValue": 0 + } + ] + }, + { + "assetStoreId": "", + "height": 90, + "name": "Bar", + "texture": "Flat Heart Empty.png", + "type": "TiledSpriteObject::TiledSprite", + "width": 90, + "variables": [], + "effects": [], + "behaviors": [ + { + "leftEdgeAnchor": 1, + "name": "Anchor", + "rightEdgeAnchor": 2, + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Background", + "rightMargin": 0, + "texture": "", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "FillBar" + }, + { + "objectName": "Bar" + }, + { + "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": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 90, + "layer": "", + "name": "Bar", + "persistentUuid": "caf6fdad-096d-4247-b23b-6cc1a89ce9f8", + "width": 270, + "x": 0, + "y": 0, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 90, + "layer": "", + "name": "FillBar", + "persistentUuid": "4b784a8f-dbae-4d8b-a287-628642416d10", + "width": 270, + "x": 0, + "y": 0, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ] + } + ] } ] }, From 8ab8fc720eff1afabddee09ea6bceae802114fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Tue, 15 Jul 2025 20:06:59 +0200 Subject: [PATCH 9/9] Update the extension again. --- .../geometry-monster/geometry-monster.json | 12 ++- .../multiplayer-platformer-arrow-fight.json | 4 +- examples/space-asteroids/space-asteroids.json | 83 ++++++++++++++----- .../tower-defense-war/tower-defense-war.json | 10 +-- 4 files changed, 73 insertions(+), 36 deletions(-) diff --git a/examples/geometry-monster/geometry-monster.json b/examples/geometry-monster/geometry-monster.json index 081bc17e9..af6323884 100755 --- a/examples/geometry-monster/geometry-monster.json +++ b/examples/geometry-monster/geometry-monster.json @@ -3814,7 +3814,7 @@ "changelog": [ { "version": "2.0.0", - "breaking": "- Resource bars now use variants, you will have to make some adjustments to existing resource bars in your project by following this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/)." + "breaking": "- Resource bars now use \"variants\", allowing easy swapping of their visual aspect. You will have to make some adjustments to existing resource bars in your project. Follow this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/) to do these changes." } ], "dependencies": [], @@ -4689,7 +4689,6 @@ "customSize": true, "depth": 1, "height": 32, - "keepRatio": true, "layer": "", "name": "Background", "persistentUuid": "b13e773c-6941-4f67-b198-030f29c8b679", @@ -4706,7 +4705,6 @@ "customSize": true, "depth": 1, "height": 26, - "keepRatio": true, "layer": "", "name": "Bar", "persistentUuid": "caf6fdad-096d-4247-b23b-6cc1a89ce9f8", @@ -5550,10 +5548,10 @@ "effects": [], "behaviors": [ { - "leftEdgeAnchor": 1, "name": "Anchor", - "rightEdgeAnchor": 2, "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "rightEdgeAnchor": 2, "bottomEdgeAnchor": 4, "relativeToOriginalWindowSize": true, "topEdgeAnchor": 4, @@ -5579,10 +5577,10 @@ "effects": [], "behaviors": [ { - "leftEdgeAnchor": 1, "name": "Anchor", - "rightEdgeAnchor": 2, "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "rightEdgeAnchor": 2, "bottomEdgeAnchor": 4, "relativeToOriginalWindowSize": true, "topEdgeAnchor": 4, 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 1ddf75395..5e3a33c92 100644 --- a/examples/multiplayer-platformer-arrow-fight/multiplayer-platformer-arrow-fight.json +++ b/examples/multiplayer-platformer-arrow-fight/multiplayer-platformer-arrow-fight.json @@ -23876,7 +23876,7 @@ "changelog": [ { "version": "2.0.0", - "breaking": "- Resource bars now use variants, you will have to make some adjustments to existing resource bars in your project by following this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/)." + "breaking": "- Resource bars now use \"variants\", allowing easy swapping of their visual aspect. You will have to make some adjustments to existing resource bars in your project. Follow this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/) to do these changes." } ], "dependencies": [], @@ -24751,7 +24751,6 @@ "customSize": true, "depth": 1, "height": 32, - "keepRatio": true, "layer": "", "name": "Background", "persistentUuid": "b13e773c-6941-4f67-b198-030f29c8b679", @@ -24768,7 +24767,6 @@ "customSize": true, "depth": 1, "height": 26, - "keepRatio": true, "layer": "", "name": "Bar", "persistentUuid": "caf6fdad-096d-4247-b23b-6cc1a89ce9f8", diff --git a/examples/space-asteroids/space-asteroids.json b/examples/space-asteroids/space-asteroids.json index 74ac131b0..e72543ce5 100644 --- a/examples/space-asteroids/space-asteroids.json +++ b/examples/space-asteroids/space-asteroids.json @@ -9336,7 +9336,7 @@ "changelog": [ { "version": "2.0.0", - "breaking": "- Resource bars now use variants, you will have to make some adjustments to existing resource bars in your project by following this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/)." + "breaking": "- Resource bars now use \"variants\", allowing easy swapping of their visual aspect. You will have to make some adjustments to existing resource bars in your project. Follow this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/) to do these changes." } ], "dependencies": [], @@ -10211,7 +10211,6 @@ "customSize": true, "depth": 1, "height": 32, - "keepRatio": true, "layer": "", "name": "Background", "persistentUuid": "b13e773c-6941-4f67-b198-030f29c8b679", @@ -10228,7 +10227,6 @@ "customSize": true, "depth": 1, "height": 26, - "keepRatio": true, "layer": "", "name": "Bar", "persistentUuid": "caf6fdad-096d-4247-b23b-6cc1a89ce9f8", @@ -10523,13 +10521,11 @@ }, { "type": { - "value": "ResizableCapability::ResizableBehavior::SetWidth" + "value": "TiledUnitsBar::TiledUnitsBar::UpdateBarWidth" }, "parameters": [ - "FillBar", - "Resizable", - "=", - "Object.Value() * UnitWidth" + "Object", + "" ] } ] @@ -10610,15 +10606,6 @@ "" ] }, - { - "type": { - "value": "TiledUnitsBar::TiledUnitsBar::UpdateBarWidth" - }, - "parameters": [ - "Object", - "" - ] - }, { "type": { "value": "TiledUnitsBar::TiledUnitsBar::SetValue" @@ -10943,6 +10930,17 @@ "NewWidth" ] }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "FillBar", + "Resizable", + "=", + "Object.Value() * UnitWidth" + ] + }, { "type": { "value": "MettreX" @@ -10954,6 +10952,49 @@ ] } ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "TiledUnitsBar::LeftEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + }, + { + "type": { + "value": "TiledUnitsBar::RightEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "FillBar", + "=", + "Bar.X() + Bar.Width() - FillBar.Width()" + ] + } + ] } ], "variables": [ @@ -11029,10 +11070,10 @@ "effects": [], "behaviors": [ { - "leftEdgeAnchor": 1, "name": "Anchor", - "rightEdgeAnchor": 2, "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "rightEdgeAnchor": 2, "bottomEdgeAnchor": 4, "relativeToOriginalWindowSize": true, "topEdgeAnchor": 4, @@ -11058,10 +11099,10 @@ "effects": [], "behaviors": [ { - "leftEdgeAnchor": 1, "name": "Anchor", - "rightEdgeAnchor": 2, "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "rightEdgeAnchor": 2, "bottomEdgeAnchor": 4, "relativeToOriginalWindowSize": true, "topEdgeAnchor": 4, diff --git a/examples/tower-defense-war/tower-defense-war.json b/examples/tower-defense-war/tower-defense-war.json index 4d512701a..6eac8a5b3 100644 --- a/examples/tower-defense-war/tower-defense-war.json +++ b/examples/tower-defense-war/tower-defense-war.json @@ -2836,7 +2836,7 @@ "changelog": [ { "version": "2.0.0", - "breaking": "- Resource bars now use variants, you will have to make some adjustments to existing resource bars in your project by following this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/)." + "breaking": "- Resource bars now use \"variants\", allowing easy swapping of their visual aspect. You will have to make some adjustments to existing resource bars in your project. Follow this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/) to do these changes." } ], "dependencies": [], @@ -4570,10 +4570,10 @@ "effects": [], "behaviors": [ { - "leftEdgeAnchor": 1, "name": "Anchor", - "rightEdgeAnchor": 2, "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "rightEdgeAnchor": 2, "bottomEdgeAnchor": 4, "relativeToOriginalWindowSize": true, "topEdgeAnchor": 4, @@ -4599,10 +4599,10 @@ "effects": [], "behaviors": [ { - "leftEdgeAnchor": 1, "name": "Anchor", - "rightEdgeAnchor": 2, "type": "AnchorBehavior::AnchorBehavior", + "leftEdgeAnchor": 1, + "rightEdgeAnchor": 2, "bottomEdgeAnchor": 4, "relativeToOriginalWindowSize": true, "topEdgeAnchor": 4,