Skip to content

Commit c3e46f5

Browse files
authored
[Community] [Top-down animator] Fix a regression on animation change to start them from 0 (#1634)
- Don't show in changelog
1 parent 0c52583 commit c3e46f5

File tree

1 file changed

+134
-54
lines changed

1 file changed

+134
-54
lines changed

extensions/community/TopDownMovementAnimator.json

Lines changed: 134 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "TopDownMovementAnimator",
1010
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Arrows/a6026156355ae5f03613b03971e4ddb50d0c95b8901e7a21edc57f33f0032e42_Arrows_thin_arrows_all_directions_cross.svg",
1111
"shortDescription": "Change the animation according to the movement direction.",
12-
"version": "0.2.1",
12+
"version": "0.2.2",
1313
"description": "Change the animation according to the movement direction.",
1414
"origin": {
1515
"identifier": "TopDownMovementAnimator",
@@ -110,6 +110,22 @@
110110
]
111111
}
112112
]
113+
},
114+
{
115+
"type": "BuiltinCommonInstructions::Standard",
116+
"conditions": [],
117+
"actions": [
118+
{
119+
"type": {
120+
"value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimation"
121+
},
122+
"parameters": [
123+
"Object",
124+
"Behavior",
125+
""
126+
]
127+
}
128+
]
113129
}
114130
],
115131
"parameters": [
@@ -139,13 +155,11 @@
139155
"actions": [
140156
{
141157
"type": {
142-
"value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationDirection"
158+
"value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimation"
143159
},
144160
"parameters": [
145161
"Object",
146162
"Behavior",
147-
"AnimationName",
148-
"Object.Behavior::Direction()",
149163
""
150164
]
151165
}
@@ -172,6 +186,46 @@
172186
"functionType": "Action",
173187
"name": "doStepPostEvents",
174188
"sentence": "",
189+
"events": [
190+
{
191+
"type": "BuiltinCommonInstructions::Standard",
192+
"conditions": [],
193+
"actions": [
194+
{
195+
"type": {
196+
"value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimation"
197+
},
198+
"parameters": [
199+
"Object",
200+
"Behavior",
201+
""
202+
]
203+
}
204+
]
205+
}
206+
],
207+
"parameters": [
208+
{
209+
"description": "Object",
210+
"name": "Object",
211+
"type": "object"
212+
},
213+
{
214+
"description": "Behavior",
215+
"name": "Behavior",
216+
"supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator",
217+
"type": "behavior"
218+
}
219+
],
220+
"objectGroups": []
221+
},
222+
{
223+
"description": "Update the animation according to the object direction.",
224+
"fullName": "Update animation",
225+
"functionType": "Action",
226+
"name": "UpdateAnimation",
227+
"private": true,
228+
"sentence": "Update the animation of _PARAM0_",
175229
"events": [
176230
{
177231
"type": "BuiltinCommonInstructions::Standard",
@@ -277,7 +331,6 @@
277331
"parameters": [
278332
"Object",
279333
"Behavior",
280-
"AnimationName",
281334
"NewAnimationDirection",
282335
""
283336
]
@@ -374,13 +427,21 @@
374427
"actions": [
375428
{
376429
"type": {
377-
"value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationDirection"
430+
"value": "SetStringVariable"
431+
},
432+
"parameters": [
433+
"AnimationName",
434+
"=",
435+
"Value"
436+
]
437+
},
438+
{
439+
"type": {
440+
"value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationName"
378441
},
379442
"parameters": [
380443
"Object",
381444
"Behavior",
382-
"Value",
383-
"AnimationDirection",
384445
""
385446
]
386447
}
@@ -960,12 +1021,12 @@
9601021
"objectGroups": []
9611022
},
9621023
{
963-
"description": "Change the animation name and direction of the object.",
1024+
"description": "Change the animation direction of the object.",
9641025
"fullName": "Animation name and direction",
9651026
"functionType": "Action",
9661027
"name": "SetAnimationDirection",
9671028
"private": true,
968-
"sentence": "Change the animation of _PARAM0_ to name: _PARAM2_ and direction: _PARAM3_",
1029+
"sentence": "Change the animation direction of _PARAM0_ to _PARAM2_",
9691030
"events": [
9701031
{
9711032
"type": "BuiltinCommonInstructions::Comment",
@@ -985,34 +1046,88 @@
9851046
"actions": [
9861047
{
9871048
"type": {
988-
"value": "SetStringVariable"
1049+
"value": "SetNumberVariable"
9891050
},
9901051
"parameters": [
991-
"AnimationName",
1052+
"AnimationDirection",
9921053
"=",
993-
"NewName"
1054+
"mod(mod(round(NewDirection), DirectionCount) + DirectionCount, DirectionCount)"
9941055
]
9951056
},
9961057
{
9971058
"type": {
9981059
"value": "SetNumberVariable"
9991060
},
10001061
"parameters": [
1001-
"AnimationDirection",
1062+
"AnimationElapsedTime",
10021063
"=",
1003-
"mod(mod(round(NewDirection), DirectionCount) + DirectionCount, DirectionCount)"
1064+
"Object.Animation::ElapsedTime()"
10041065
]
10051066
},
10061067
{
10071068
"type": {
1008-
"value": "SetNumberVariable"
1069+
"value": "TopDownMovementAnimator::TopDownMovementAnimator::UpdateAnimationName"
10091070
},
10101071
"parameters": [
1011-
"AnimationElapsedTime",
1012-
"=",
1013-
"Object.Animation::ElapsedTime()"
1072+
"Object",
1073+
"Behavior",
1074+
""
10141075
]
10151076
},
1077+
{
1078+
"type": {
1079+
"value": "AnimatableCapability::AnimatableBehavior::SetElapsedTime"
1080+
},
1081+
"parameters": [
1082+
"Object",
1083+
"Animation",
1084+
"=",
1085+
"AnimationElapsedTime"
1086+
]
1087+
}
1088+
],
1089+
"variables": [
1090+
{
1091+
"folded": true,
1092+
"name": "AnimationElapsedTime",
1093+
"type": "number",
1094+
"value": 0
1095+
}
1096+
]
1097+
}
1098+
],
1099+
"parameters": [
1100+
{
1101+
"description": "Object",
1102+
"name": "Object",
1103+
"type": "object"
1104+
},
1105+
{
1106+
"description": "Behavior",
1107+
"name": "Behavior",
1108+
"supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator",
1109+
"type": "behavior"
1110+
},
1111+
{
1112+
"description": "Direction",
1113+
"name": "NewDirection",
1114+
"type": "expression"
1115+
}
1116+
],
1117+
"objectGroups": []
1118+
},
1119+
{
1120+
"description": "Update the animation name.",
1121+
"fullName": "Update animation name",
1122+
"functionType": "Action",
1123+
"name": "UpdateAnimationName",
1124+
"private": true,
1125+
"sentence": "Update the animation name of _PARAM0_",
1126+
"events": [
1127+
{
1128+
"type": "BuiltinCommonInstructions::Standard",
1129+
"conditions": [],
1130+
"actions": [
10161131
{
10171132
"type": {
10181133
"value": "AnimatableCapability::AnimatableBehavior::SetName"
@@ -1066,31 +1181,6 @@
10661181
]
10671182
}
10681183
]
1069-
},
1070-
{
1071-
"type": "BuiltinCommonInstructions::Standard",
1072-
"conditions": [],
1073-
"actions": [
1074-
{
1075-
"type": {
1076-
"value": "AnimatableCapability::AnimatableBehavior::SetElapsedTime"
1077-
},
1078-
"parameters": [
1079-
"Object",
1080-
"Animation",
1081-
"=",
1082-
"AnimationElapsedTime"
1083-
]
1084-
}
1085-
]
1086-
}
1087-
],
1088-
"variables": [
1089-
{
1090-
"folded": true,
1091-
"name": "AnimationElapsedTime",
1092-
"type": "number",
1093-
"value": 0
10941184
}
10951185
]
10961186
}
@@ -1106,16 +1196,6 @@
11061196
"name": "Behavior",
11071197
"supplementaryInformation": "TopDownMovementAnimator::TopDownMovementAnimator",
11081198
"type": "behavior"
1109-
},
1110-
{
1111-
"description": "Name",
1112-
"name": "NewName",
1113-
"type": "string"
1114-
},
1115-
{
1116-
"description": "Direction",
1117-
"name": "NewDirection",
1118-
"type": "expression"
11191199
}
11201200
],
11211201
"objectGroups": []

0 commit comments

Comments
 (0)