I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: PlasmaKaboom on April 21, 2017, 04:09:52 PM

Title: How can I make a sprite's animation not loop (only play once and then stop)?
Post by: PlasmaKaboom on April 21, 2017, 04:09:52 PM
Is there an easy way to tell an object not to loop it's sprite animation? When I restart a room I want an animation of one of my sprites to only play once and then stop, only repeating when I restart the room again.
Title: Re: How can I make a sprite's animation not loop (only play once and then stop)?
Post by: WetWookie on April 21, 2017, 04:38:54 PM
There's an animation end event. I think you can just set the image_speed to 0 in it.
Title: Re: How can I make a sprite's animation not loop (only play once and then stop)?
Post by: PlasmaKaboom on April 21, 2017, 09:40:41 PM
I should have been more specific. The suggestion I was just given does make the sprite animation play just once, however it disappears once it's done. I need it to pause after it plays once (meaning I need it to freeze in place on the sprites last animation frame). Is there a way to do that?
Title: Re: How can I make a sprite's animation not loop (only play once and then stop)?
Post by: Denferok on April 22, 2017, 08:12:52 AM
Put this into the animation end event and it should work
image_index = the last image number of your sprite's animation
image_speed = 0
Title: Re: How can I make a sprite's animation not loop (only play once and then stop)?
Post by: PlasmaKaboom on April 22, 2017, 04:17:10 PM
Oh my gosh thank you! That's exactly what I was looking for!