E
Edward Griffith
Guest
Hi, I am programming a super smash type game and using coding to animate the sprite. I have several animations already in place such as idle, run and jump, and i am currently trying to implement a punch animation. However, when i set it up to 'Keyboard_Check_Pressed(Ord("F"))' (AKA punch), and have it to stop at the final frame of the animation (7), the game only plays the first frame of the punch and nothing else. Here is my code:
Code:
if (punch == 1)
{
sprite_index = spr_player_punch
if (image_index >= 7)
{
if (place_meeting(x, y+1, obj_platform))
{
if (move!=0) sprite_index = spr_player_running; else sprite_index = spr_player_idle;
}
else
{
if (vsp !=0) sprite_index = spr_jump;
}
}
}