Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
241 changes: 133 additions & 108 deletions extensions/community/TopDownMovementAnimator.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"name": "TopDownMovementAnimator",
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Arrows/a6026156355ae5f03613b03971e4ddb50d0c95b8901e7a21edc57f33f0032e42_Arrows_thin_arrows_all_directions_cross.svg",
"shortDescription": "Change the animation according to the movement direction.",
"version": "0.2.2",
"version": "0.2.3",
"description": "Change the animation according to the movement direction.",
"origin": {
"identifier": "TopDownMovementAnimator",
Expand Down Expand Up @@ -229,26 +229,16 @@
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"IsPausingAnimation",
"True",
""
]
}
],
"conditions": [],
"actions": [
{
"type": {
"value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationPause"
"value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationDirection"
},
"parameters": [
"Object",
"Behavior",
"NewAnimationDirection",
""
]
}
Expand All @@ -271,7 +261,7 @@
"actions": [
{
"type": {
"value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationSpeedScale"
"value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationSpeedScale"
},
"parameters": [
"Object",
Expand All @@ -283,68 +273,29 @@
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
"conditions": [
{
"type": {
"value": "SetNumberVariable"
"value": "BooleanVariable"
},
"parameters": [
"NewAnimationDirection",
"=",
"Object.Behavior::Direction()"
"IsPausingAnimation",
"True",
""
]
}
],
"events": [
"actions": [
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
"type": {
"value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationPause"
},
"comment": "Use a small margin is used to avoid to flicker between 2 directions."
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BuiltinCommonInstructions::CompareNumbers"
},
"parameters": [
"abs(Object.Behavior::DirectionDifference(NewAnimationDirection, AnimationDirection))",
">",
"0.5 + 0.03125"
]
}
],
"actions": [
{
"type": {
"value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationDirection"
},
"parameters": [
"Object",
"Behavior",
"NewAnimationDirection",
""
]
}
"parameters": [
"Object",
"Behavior",
""
]
}
],
"variables": [
{
"folded": true,
"name": "NewAnimationDirection",
"type": "number",
"value": 0
}
]
}
],
Expand Down Expand Up @@ -410,6 +361,18 @@
"name": "SetAnimationName",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Also update the animation direction to avoid to play the animation in an old direction for 1 frame."
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
Expand Down Expand Up @@ -444,6 +407,17 @@
"Behavior",
""
]
},
{
"type": {
"value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationDirection"
},
"parameters": [
"Object",
"Behavior",
"NewAnimationDirection",
""
]
}
]
}
Expand Down Expand Up @@ -581,7 +555,7 @@
},
{
"type": {
"value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationPause"
"value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationPause"
},
"parameters": [
"Object",
Expand Down Expand Up @@ -735,7 +709,7 @@
},
{
"type": {
"value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationSpeedScale"
"value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationSpeedScale"
},
"parameters": [
"Object",
Expand Down Expand Up @@ -772,7 +746,7 @@
"description": "Change the animation speed scale according to the object speed.",
"fullName": "Animation speed scale",
"functionType": "Action",
"name": "SetAnimationSpeedScale",
"name": "UpdateAnimationSpeedScale",
"private": true,
"sentence": "Change the animation speed scale according to _PARAM0_ speed",
"events": [
Expand Down Expand Up @@ -854,7 +828,7 @@
"description": "Pause the animation according to the object speed.",
"fullName": "Animation pause",
"functionType": "Action",
"name": "SetAnimationPause",
"name": "UpdateAnimationPause",
"private": true,
"sentence": "Pause the animation according to _PARAM0_ speed",
"events": [
Expand Down Expand Up @@ -1021,12 +995,12 @@
"objectGroups": []
},
{
"description": "Change the animation direction of the object.",
"fullName": "Animation name and direction",
"description": "Update the animation direction of the object.",
"fullName": "Update animation direction",
"functionType": "Action",
"name": "SetAnimationDirection",
"name": "UpdateAnimationDirection",
"private": true,
"sentence": "Change the animation direction of _PARAM0_ to _PARAM2_",
"sentence": "Update the animation direction of _PARAM0_",
"events": [
{
"type": "BuiltinCommonInstructions::Comment",
Expand All @@ -1049,47 +1023,103 @@
"value": "SetNumberVariable"
},
"parameters": [
"AnimationDirection",
"=",
"mod(mod(round(NewDirection), DirectionCount) + DirectionCount, DirectionCount)"
]
},
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"AnimationElapsedTime",
"NewAnimationDirection",
"=",
"Object.Animation::ElapsedTime()"
"Object.Behavior::Direction()"
]
},
}
],
"events": [
{
"type": {
"value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationName"
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"parameters": [
"Object",
"Behavior",
""
]
"comment": "Use a small margin is used to avoid to flicker between 2 directions."
},
{
"type": {
"value": "AnimatableCapability::AnimatableBehavior::SetElapsedTime"
},
"parameters": [
"Object",
"Animation",
"=",
"AnimationElapsedTime"
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BuiltinCommonInstructions::CompareNumbers"
},
"parameters": [
"abs(Object.Behavior::DirectionDifference(NewAnimationDirection, AnimationDirection))",
">",
"0.5 + 0.03125"
]
}
],
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"AnimationDirection",
"=",
"mod(mod(round(NewAnimationDirection), DirectionCount) + DirectionCount, DirectionCount)"
]
},
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"AnimationElapsedTime",
"=",
"Object.Animation::ElapsedTime()"
]
},
{
"type": {
"value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationName"
},
"parameters": [
"Object",
"Behavior",
""
]
},
{
"type": {
"value": "AnimatableCapability::AnimatableBehavior::SetElapsedTime"
},
"parameters": [
"Object",
"Animation",
"=",
"AnimationElapsedTime"
]
}
],
"variables": [
{
"folded": true,
"name": "AnimationElapsedTime",
"type": "number",
"value": 0
}
]
}
]
}
],
"variables": [
{
"folded": true,
"name": "AnimationElapsedTime",
"name": "NewAnimationDirection",
"type": "number",
"value": 0
}
Expand All @@ -1107,11 +1137,6 @@
"name": "Behavior",
"supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator",
"type": "behavior"
},
{
"description": "Direction",
"name": "NewDirection",
"type": "expression"
}
],
"objectGroups": []
Expand Down