FrostyTBB
Member
Hello! For a few days now I've trying to set up an animation to play when I press the space bar, and I want it to go through the full animation. However, It usually only plays for one or two frames before being overwritten by the idle or movement sprites, when I'd like for it to stay there for atleast a little longer. Image indexes didn't work, alarms broke it, and image speed does nothing. Any help would be amazing at this point.
GML:
if (shank_delay > 0)
{
shank_delay -= 1; // count down to the next shot by subtracting 1 from gun_delay
}
if (keyboard_check(vk_right)) {
x+= 5;
sprite_index = GuyWalk;
}
else if (keyboard_check(vk_left)) {
x-= 5;
sprite_index = GuyWalk;
}
else
{
sprite_index = GuyIdle;
}
if (speed>5)
speed=5
if (keyboard_check_pressed(vk_space))
if (shank_delay <= 0)
{
bullet = instance_create_depth(x,y+60,layer,Bullet)
bullet.direction = image_angle + -90
shank_delay=45
sprite_index = GuySwing;
image_index = 0;
}