Skip to content

Commit 246cd5c

Browse files
committed
[Community] [Top-down animator] Avoid to change the animation when the name is not set yet
1 parent c3e46f5 commit 246cd5c

File tree

1 file changed

+101
-99
lines changed

1 file changed

+101
-99
lines changed

extensions/community/TopDownMovementAnimator.json

Lines changed: 101 additions & 99 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.2",
12+
"version": "0.2.3",
1313
"description": "Change the animation according to the movement direction.",
1414
"origin": {
1515
"identifier": "TopDownMovementAnimator",
@@ -110,22 +110,6 @@
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-
]
129113
}
130114
],
131115
"parameters": [
@@ -232,118 +216,136 @@
232216
"conditions": [
233217
{
234218
"type": {
235-
"value": "BooleanVariable"
236-
},
237-
"parameters": [
238-
"IsPausingAnimation",
239-
"True",
240-
""
241-
]
242-
}
243-
],
244-
"actions": [
245-
{
246-
"type": {
247-
"value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationPause"
248-
},
249-
"parameters": [
250-
"Object",
251-
"Behavior",
252-
""
253-
]
254-
}
255-
]
256-
},
257-
{
258-
"type": "BuiltinCommonInstructions::Standard",
259-
"conditions": [
260-
{
261-
"type": {
262-
"value": "BooleanVariable"
263-
},
264-
"parameters": [
265-
"IsScalingAnimation",
266-
"True",
267-
""
268-
]
269-
}
270-
],
271-
"actions": [
272-
{
273-
"type": {
274-
"value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationSpeedScale"
275-
},
276-
"parameters": [
277-
"Object",
278-
"Behavior",
279-
""
280-
]
281-
}
282-
]
283-
},
284-
{
285-
"type": "BuiltinCommonInstructions::Standard",
286-
"conditions": [],
287-
"actions": [
288-
{
289-
"type": {
290-
"value": "SetNumberVariable"
219+
"value": "StringVariable"
291220
},
292221
"parameters": [
293-
"NewAnimationDirection",
294-
"=",
295-
"Object.Behavior::Direction()"
222+
"AnimationName",
223+
"!=",
224+
"\"\""
296225
]
297226
}
298227
],
228+
"actions": [],
299229
"events": [
300230
{
301-
"type": "BuiltinCommonInstructions::Comment",
302-
"color": {
303-
"b": 109,
304-
"g": 230,
305-
"r": 255,
306-
"textB": 0,
307-
"textG": 0,
308-
"textR": 0
309-
},
310-
"comment": "Use a small margin is used to avoid to flicker between 2 directions."
231+
"type": "BuiltinCommonInstructions::Standard",
232+
"conditions": [
233+
{
234+
"type": {
235+
"value": "BooleanVariable"
236+
},
237+
"parameters": [
238+
"IsPausingAnimation",
239+
"True",
240+
""
241+
]
242+
}
243+
],
244+
"actions": [
245+
{
246+
"type": {
247+
"value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationPause"
248+
},
249+
"parameters": [
250+
"Object",
251+
"Behavior",
252+
""
253+
]
254+
}
255+
]
311256
},
312257
{
313258
"type": "BuiltinCommonInstructions::Standard",
314259
"conditions": [
315260
{
316261
"type": {
317-
"value": "BuiltinCommonInstructions::CompareNumbers"
262+
"value": "BooleanVariable"
318263
},
319264
"parameters": [
320-
"abs(Object.Behavior::DirectionDifference(NewAnimationDirection, AnimationDirection))",
321-
">",
322-
"0.5 + 0.03125"
265+
"IsScalingAnimation",
266+
"True",
267+
""
323268
]
324269
}
325270
],
326271
"actions": [
327272
{
328273
"type": {
329-
"value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationDirection"
274+
"value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationSpeedScale"
330275
},
331276
"parameters": [
332277
"Object",
333278
"Behavior",
334-
"NewAnimationDirection",
335279
""
336280
]
337281
}
338282
]
339-
}
340-
],
341-
"variables": [
283+
},
342284
{
343-
"folded": true,
344-
"name": "NewAnimationDirection",
345-
"type": "number",
346-
"value": 0
285+
"type": "BuiltinCommonInstructions::Standard",
286+
"conditions": [],
287+
"actions": [
288+
{
289+
"type": {
290+
"value": "SetNumberVariable"
291+
},
292+
"parameters": [
293+
"NewAnimationDirection",
294+
"=",
295+
"Object.Behavior::Direction()"
296+
]
297+
}
298+
],
299+
"events": [
300+
{
301+
"type": "BuiltinCommonInstructions::Comment",
302+
"color": {
303+
"b": 109,
304+
"g": 230,
305+
"r": 255,
306+
"textB": 0,
307+
"textG": 0,
308+
"textR": 0
309+
},
310+
"comment": "Use a small margin is used to avoid to flicker between 2 directions."
311+
},
312+
{
313+
"type": "BuiltinCommonInstructions::Standard",
314+
"conditions": [
315+
{
316+
"type": {
317+
"value": "BuiltinCommonInstructions::CompareNumbers"
318+
},
319+
"parameters": [
320+
"abs(Object.Behavior::DirectionDifference(NewAnimationDirection, AnimationDirection))",
321+
">",
322+
"0.5 + 0.03125"
323+
]
324+
}
325+
],
326+
"actions": [
327+
{
328+
"type": {
329+
"value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationDirection"
330+
},
331+
"parameters": [
332+
"Object",
333+
"Behavior",
334+
"NewAnimationDirection",
335+
""
336+
]
337+
}
338+
]
339+
}
340+
],
341+
"variables": [
342+
{
343+
"folded": true,
344+
"name": "NewAnimationDirection",
345+
"type": "number",
346+
"value": 0
347+
}
348+
]
347349
}
348350
]
349351
}

0 commit comments

Comments
 (0)