Changing sprites [SOLVED]

K

kmce

Guest
Hi,

So I want to be able to change some sprite, basically, i want :

My character to be walking along, with his walk animation going. Then I press J i want him to change sprite which would make him look like he is punching, I can do this, but it continues to punch. I want to be able to press J, the punch animation to happen once, then the walk animation to appear again, or another animation if need be.

Does anyone know the best way to do this, preferably in drag and drop, but I can handle some simple code too XD

Thanks
 
W

whale_cancer

Guest
Hi,

So I want to be able to change some sprite, basically, i want :

My character to be walking along, with his walk animation going. Then I press J i want him to change sprite which would make him look like he is punching, I can do this, but it continues to punch. I want to be able to press J, the punch animation to happen once, then the walk animation to appear again, or another animation if need be.

Does anyone know the best way to do this, preferably in drag and drop, but I can handle some simple code too XD

Thanks
I wouldn't know how to do this in D&D as I don't use D&D, but it should be possible. You basically want to use the 'animation ends' event. In that event, check to see if your object's sprite_index is the punching sprite. Then, if it is, change it back to the walking sprite.
 
K

kmce

Guest
Ah ok, I havent got much experience with the animation end event, but I'll give it a go. thanks
 
K

kmce

Guest
Do you know if it is possible to get the animation to complete before i can press the button again. Just now the way i have it, i can spam the J button and only a small part of the animation plays
 
Top