Any good way to assign animations to actions?

Been making a game, the idea is a bloodborne x catstlevania game. But, i have 3 different versions of it. The trouble im having on all of those is assigning animations to a sprite’s action, to an enemy’s action to be more specific. Did the coding, the enemy can patrol, if the enemy sees the hero in its range, it chases him with higher speed, if it gets in range, it stops and starts attacking, the enemy can never overlap another enemy. But when i start putting animations in them, it gets VERY clunky. The issue seems to be the “for element value of array of sprites of type enemy” block. If i put the animation block in it, it either is gonna play only the first frame (beause it is on forever loop), or its gonna make the logic making (do i stop attacking, do i start chasing, do i stop) very slowly becuse of a pause block in it.

Any idea or technique you have to simplify this? Any way to smoothly make characters animate without interrupting the code itself?

Perhaps you should try the

Did you consider using the character-animation extension? You can set states, and apply animations when a certain state is triggered. It sounds just like the use-case you need. It’s a built in extension, so you can just add it

1 Like