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

GameMaker How to code an object to only progress in the animation if i press enter

Night-Ninja

Member
so i've got an animation in a room that i only want to progress if I press Enter

for example when i press enter i want it to go from frame 1 to frame 2 and when i press it again frame 2 to frame 3, how do i do this?
 

CloseRange

Member
Code:
image_speed = 0;
if(keyboard_check_pressed(vk_enter)) image_index++;
setting image_speed to 0 will stop it from animating automaticly
image_index is the variable that determines the animation frame.
This goes in the step event of whatever object has the sprite attached to it
 

Night-Ninja

Member
Code:
image_speed = 0;
if(keyboard_check_pressed(vk_enter)) image_index++;
setting image_speed to 0 will stop it from animating automaticly
image_index is the variable that determines the animation frame.
This goes in the step event of whatever object has the sprite attached to it
Thank you! it works well
 
Top