• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

SOLVED How to make a Sprite not cycle through frames but change a frame when something happens

T

Twinimi13

Guest
I am making a tower defense game, and you are protecting a house. I have different frames in the house sprite for different levels of being broken by the enemy. I would like it to stay on the first frame, but if something happens, such as the health going down by 25, it will go to the next frame. How could I do that?
 
Make image_speed 0 which will stop the sprite from animating

Then use image image_index to change what frame you want. (image index starts at 0)

I don't know how you are handling health but if you do something similar to

Code:
if hp<=25

       {

                image_index=1;

       }
 
T

Twinimi13

Guest
Make image_speed 0 which will stop the sprite from animating

Then use image image_index to change what frame you want. (image index starts at 0)

I don't know how you are handling health but if you do something similar to

Code:
if hp<=25

       {

                image_index=1;

       }
Thanks so much!
 
Top