Hey, I have a bit of a problem that I have tried to resolve several different ways, but I can't fix.
I have tried to make it so when the player presses <space> that it will show the slash sprite. Here is the code I am currently using to show the sprite:
if(keyboard_check(vk_space) && slashReady) {
for(i = 0; i = 1; i += 1)
{
if(wspeed == 0 ) image_speed = (wspeed + 3) / 10;
if(wspeed == 0 && sprite_index = spr_idle_right) sprite_index = spr_slash1_right;
if(wspeed == 0 && sprite_index = spr_idle_left) sprite_index = spr_slash1_left;
}
slashReady = false;
alarm[0] = 5;
}
I don't think I'm using the 'for' loop correctly. Anyway, I had managed to get it to half work, but you would still be able to move when you pressed space. I want the player stop when they slash.
I have tried many ways to get this to work, but I just can't. So if someone could be so kind to help I would be very thankful.