• 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!

Help with sprites for a vehicle

M

Molox MX

Guest
Hey everybody.

So, I'm new at using GameMaker and I have a little doubt about the sprites. I'm trying to create a vehicle for my game. I've already made an idle animation and an animation for its movement. What I wanna know is if there's any possiblity of changing a sprite into two different sprites; I used some sprites that make the vehicle seem like it's braking. When the vehicle stops moving, I want it, firstly, to show the braking animation and finally return to the idle animation. I hope you can help me.

Thanks
 

NightFrost

Member
You can use the inbuilt sprite_index variable to switch an object's sprite any time you want. Like,
Code:
sprite_index = spr_car_braking;
...
...
sprite_index = spr_car_idle:
 
M

Molox MX

Guest
You can use the inbuilt sprite_index variable to switch an object's sprite any time you want. Like,
Code:
sprite_index = spr_car_braking;
...
...
sprite_index = spr_car_idle:
Thanks. I'm going to try it out
 
Top