|
9 | 9 | "name": "TopDownMovementAnimator", |
10 | 10 | "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Arrows/a6026156355ae5f03613b03971e4ddb50d0c95b8901e7a21edc57f33f0032e42_Arrows_thin_arrows_all_directions_cross.svg", |
11 | 11 | "shortDescription": "Change the animation according to the movement direction.", |
12 | | - "version": "0.2.2", |
| 12 | + "version": "0.2.3", |
13 | 13 | "description": "Change the animation according to the movement direction.", |
14 | 14 | "origin": { |
15 | 15 | "identifier": "TopDownMovementAnimator", |
|
110 | 110 | ] |
111 | 111 | } |
112 | 112 | ] |
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 | | - ] |
129 | 113 | } |
130 | 114 | ], |
131 | 115 | "parameters": [ |
|
232 | 216 | "conditions": [ |
233 | 217 | { |
234 | 218 | "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" |
291 | 220 | }, |
292 | 221 | "parameters": [ |
293 | | - "NewAnimationDirection", |
294 | | - "=", |
295 | | - "Object.Behavior::Direction()" |
| 222 | + "AnimationName", |
| 223 | + "!=", |
| 224 | + "\"\"" |
296 | 225 | ] |
297 | 226 | } |
298 | 227 | ], |
| 228 | + "actions": [], |
299 | 229 | "events": [ |
300 | 230 | { |
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 | + ] |
311 | 256 | }, |
312 | 257 | { |
313 | 258 | "type": "BuiltinCommonInstructions::Standard", |
314 | 259 | "conditions": [ |
315 | 260 | { |
316 | 261 | "type": { |
317 | | - "value": "BuiltinCommonInstructions::CompareNumbers" |
| 262 | + "value": "BooleanVariable" |
318 | 263 | }, |
319 | 264 | "parameters": [ |
320 | | - "abs(Object.Behavior::DirectionDifference(NewAnimationDirection, AnimationDirection))", |
321 | | - ">", |
322 | | - "0.5 + 0.03125" |
| 265 | + "IsScalingAnimation", |
| 266 | + "True", |
| 267 | + "" |
323 | 268 | ] |
324 | 269 | } |
325 | 270 | ], |
326 | 271 | "actions": [ |
327 | 272 | { |
328 | 273 | "type": { |
329 | | - "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationDirection" |
| 274 | + "value": "TopDownMovementAnimator::TopDownMovementAnimator::SetAnimationSpeedScale" |
330 | 275 | }, |
331 | 276 | "parameters": [ |
332 | 277 | "Object", |
333 | 278 | "Behavior", |
334 | | - "NewAnimationDirection", |
335 | 279 | "" |
336 | 280 | ] |
337 | 281 | } |
338 | 282 | ] |
339 | | - } |
340 | | - ], |
341 | | - "variables": [ |
| 283 | + }, |
342 | 284 | { |
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 | + ] |
347 | 349 | } |
348 | 350 | ] |
349 | 351 | } |
|
0 commit comments