diff --git a/extensions/community/RectangularMovementAnimator.json b/extensions/community/RectangularMovementAnimator.json new file mode 100644 index 000000000..8a4dfb79d --- /dev/null +++ b/extensions/community/RectangularMovementAnimator.json @@ -0,0 +1,1130 @@ +{ + "author": "", + "category": "Movement", + "extensionNamespace": "", + "fullName": "Rectangular movement animator", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXJlY3RhbmdsZS1vdXRsaW5lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTQsNlYxOUgyMFY2SDRNMTgsMTdINlY4SDE4VjE3WiIgLz48L3N2Zz4=", + "name": "RectangularMovementAnimator", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/580109435b982403514b7e97c17c4b67b27a94038f672b9bf4d17cf5a897ce5b_rectangle-outline.svg", + "shortDescription": "Change the animation based on the direction of the rectangular movement.", + "version": "0.0.1", + "description": [ + "Automatically change the animation based on the direction of the movement.", + "It can flip the animation horizontally (Flip right sprites to simulate left movement) and play idle animation if the object stop moving.", + "It can be useful to animate NPC and enemies.", + "To use the extension set the animations' names according." + ], + "tags": [ + "movement", + "rectangle", + "rectangular", + "animation" + ], + "authorIds": [ + "zaJZwglAIidQMgsHj5yC2voGTAl2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Change the animation based on the direction of the rectangle movement.", + "fullName": "Rectangular movement animator", + "name": "RectangularMovementAnimator", + "objectType": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Change animations", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RectangleMovement::RectangleMovement::IsMovingRight" + }, + "parameters": [ + "Object", + "RectangularMovement", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animatable", + "=", + "RightAnimationName" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Flip the character if horizontal flipping is enabled" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RectangularMovementAnimator::RectangularMovementAnimator::PropertyEnableHorizontalFlipping" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipX" + }, + "parameters": [ + "Object", + "Flippable", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RectangleMovement::RectangleMovement::IsMovingLeft" + }, + "parameters": [ + "Object", + "RectangularMovement", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animatable", + "=", + "LeftAnimationName" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Flip the character if horizontal flipping is enabled" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RectangularMovementAnimator::RectangularMovementAnimator::PropertyEnableHorizontalFlipping" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "FlippableCapability::FlippableBehavior::FlipX" + }, + "parameters": [ + "Object", + "Flippable", + "yes" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RectangleMovement::RectangleMovement::IsMovingUp" + }, + "parameters": [ + "Object", + "RectangularMovement", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animatable", + "=", + "UpAnimationName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RectangleMovement::RectangleMovement::IsMovingDown" + }, + "parameters": [ + "Object", + "RectangularMovement", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animatable", + "=", + "DownAnimationName" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "If the object is idle play idle animation" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "IdleTracker::IdleTracker::IsIdle" + }, + "parameters": [ + "Object", + "IdleTracker", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RectangularMovementAnimator::RectangularMovementAnimator::PropertyEnableIdleTracking" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetName" + }, + "parameters": [ + "Object", + "Animatable", + "=", + "IdleAnimationName" + ] + } + ] + } + ] + } + ], + "parameters": [] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RectangularMovementAnimator::RectangularMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if enable horizontal flipping is true.", + "fullName": "Enable horizontal flipping", + "functionType": "Condition", + "group": "Rectangular movement animator configuration", + "name": "EnableHorizontalFlipping", + "sentence": "_PARAM0_ horizontal flipping is true", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RectangularMovementAnimator::RectangularMovementAnimator::PropertyEnableHorizontalFlipping" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RectangularMovementAnimator::RectangularMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Enable (or disable) horizontal flipping.", + "fullName": "Enable (or disable) horizontal flipping", + "functionType": "Action", + "group": "Rectangular movement animator configuration", + "name": "SetEnableHorizontalFlipping", + "sentence": "Enable horizontal flipping on _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "RectangularMovementAnimator::RectangularMovementAnimator::SetPropertyEnableHorizontalFlipping" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "RectangularMovementAnimator::RectangularMovementAnimator::SetPropertyEnableHorizontalFlipping" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RectangularMovementAnimator::RectangularMovementAnimator", + "type": "behavior" + }, + { + "defaultValue": "yes", + "description": "EnableHorizontalFlipping", + "name": "Value", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "Check if enable idle trackingis true.", + "fullName": "Enable idle tracking", + "functionType": "Condition", + "group": "Rectangular movement animator configuration", + "name": "EnableIdleTracking", + "sentence": "_PARAM0_ idle tracking is true", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "RectangularMovementAnimator::RectangularMovementAnimator::PropertyEnableIdleTracking" + }, + "parameters": [ + "Object", + "Behavior" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RectangularMovementAnimator::RectangularMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Enable (or disable) idle tracking.", + "fullName": "Enable (or disable) idle tracking", + "functionType": "Action", + "group": "Rectangular movement animator configuration", + "name": "SetEnableIdleTracking", + "sentence": "Enable idle tracking on _PARAM0_: _PARAM2_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "RectangularMovementAnimator::RectangularMovementAnimator::SetPropertyEnableIdleTracking" + }, + "parameters": [ + "Object", + "Behavior", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"Value\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "RectangularMovementAnimator::RectangularMovementAnimator::SetPropertyEnableIdleTracking" + }, + "parameters": [ + "Object", + "Behavior", + "yes" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RectangularMovementAnimator::RectangularMovementAnimator", + "type": "behavior" + }, + { + "defaultValue": "yes", + "description": "EnableIdleTracking", + "name": "Value", + "optional": true, + "type": "yesorno" + } + ], + "objectGroups": [] + }, + { + "description": "the \"Right\" animation name of the object.", + "fullName": "\"Right\" animation name ", + "functionType": "ExpressionAndCondition", + "group": "Rectangular movement animator animation names configuration", + "name": "RightAnimationName", + "sentence": "the \"Right\" animation name ", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "RightAnimationName" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RectangularMovementAnimator::RectangularMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "RightAnimationName", + "name": "SetRightAnimationName", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RectangularMovementAnimator::RectangularMovementAnimator::SetPropertyRightAnimationName" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RectangularMovementAnimator::RectangularMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the \"Left\" animation name of the object.", + "fullName": "\"Left\" animation name ", + "functionType": "ExpressionAndCondition", + "group": "Rectangular movement animator animation names configuration", + "name": "LeftAnimationName", + "sentence": "the \"Left\" animation name ", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "LeftAnimationName" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RectangularMovementAnimator::RectangularMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "LeftAnimationName", + "name": "SetLeftAnimationName", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RectangularMovementAnimator::RectangularMovementAnimator::SetPropertyLeftAnimationName" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RectangularMovementAnimator::RectangularMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the \"Up\" animation name of the object.", + "fullName": "\"Up\" animation name ", + "functionType": "ExpressionAndCondition", + "group": "Rectangular movement animator animation names configuration", + "name": "UpAnimationName", + "sentence": "the \"Up\" animation name ", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "UpAnimationName" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RectangularMovementAnimator::RectangularMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "UpAnimationName", + "name": "SetUpAnimationName", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RectangularMovementAnimator::RectangularMovementAnimator::SetPropertyUpAnimationName" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RectangularMovementAnimator::RectangularMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the \"Down\" animation name of the object.", + "fullName": "\"Down\" animation name ", + "functionType": "ExpressionAndCondition", + "group": "Rectangular movement animator animation names configuration", + "name": "DownAnimationName", + "sentence": "the \"Down\" animation name ", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "DownAnimationName" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RectangularMovementAnimator::RectangularMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "DownAnimationName", + "name": "SetDownAnimationName", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RectangularMovementAnimator::RectangularMovementAnimator::SetPropertyDownAnimationName" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RectangularMovementAnimator::RectangularMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the \"Idle\" animation name of the object.", + "fullName": "\"Idle\" animation name ", + "functionType": "ExpressionAndCondition", + "group": "Rectangular movement animator animation names configuration", + "name": "IdleAnimationName", + "sentence": "the \"Idle\" animation name ", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "IdleAnimationName" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RectangularMovementAnimator::RectangularMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "IdleAnimationName", + "name": "SetIdleAnimationName", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "RectangularMovementAnimator::RectangularMovementAnimator::SetPropertyIdleAnimationName" + }, + "parameters": [ + "Object", + "Behavior", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RectangularMovementAnimator::RectangularMovementAnimator", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [ + { + "value": "true", + "type": "Boolean", + "label": "Enable horizontal flipping", + "description": "", + "group": "", + "extraInformation": [], + "name": "EnableHorizontalFlipping" + }, + { + "value": "true", + "type": "Boolean", + "label": "Enable idle tracking", + "description": "", + "group": "", + "extraInformation": [], + "name": "EnableIdleTracking" + }, + { + "value": "Right", + "type": "String", + "label": "\"Right\" animation name ", + "description": "", + "group": "Animation names", + "extraInformation": [], + "name": "RightAnimationName" + }, + { + "value": "Left", + "type": "String", + "label": "\"Left\" animation name ", + "description": "", + "group": "Animation names", + "extraInformation": [], + "name": "LeftAnimationName" + }, + { + "value": "Up", + "type": "String", + "label": "\"Up\" animation name ", + "description": "", + "group": "Animation names", + "extraInformation": [], + "name": "UpAnimationName" + }, + { + "value": "Down", + "type": "String", + "label": "\"Down\" animation name ", + "description": "", + "group": "Animation names", + "extraInformation": [], + "name": "DownAnimationName" + }, + { + "value": "Idle", + "type": "String", + "label": "\"Idle\" animation name ", + "description": "To manage idle time use IdleTracker behavior.", + "group": "Animation names", + "extraInformation": [], + "name": "IdleAnimationName" + }, + { + "value": "", + "type": "Behavior", + "label": "Animatable capability", + "description": "", + "group": "", + "extraInformation": [ + "AnimatableCapability::AnimatableBehavior" + ], + "name": "Animatable" + }, + { + "value": "", + "type": "Behavior", + "label": "Flippable capacity", + "description": "", + "group": "", + "extraInformation": [ + "FlippableCapability::FlippableBehavior" + ], + "name": "Flippable" + }, + { + "value": "", + "type": "Behavior", + "label": "Idle tracker", + "description": "", + "group": "", + "extraInformation": [ + "IdleTracker::IdleTracker" + ], + "name": "IdleTracker" + }, + { + "value": "", + "type": "Behavior", + "label": "Rectangular movement", + "description": "", + "group": "", + "extraInformation": [ + "RectangleMovement::RectangleMovement" + ], + "name": "RectangularMovement" + } + ], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] +} \ No newline at end of file