GameMaker Jump Animation

G

Gorshalox

Guest
So I'm making 2d platformer and I don't know how to make correct the animation of jump, in my case the player jump and the animation is playing very fast and ends in air, I will post the my animation code in Step Event below

GML:
//Animation

//===Walk

if (key_right) {

    sprite_index = s_PlayerR;

    if (image_xscale = -1) {

        image_xscale = 1

    }

} else if (key_left) {

    sprite_index = s_PlayerR;

    image_xscale = -1;

} else {

    sprite_index = s_Player;

}

//===Jump

if (key_jump) {

    sprite_index = s_PlayerJ;

    if (key_right) {

    if (image_xscale = -1) {

        image_xscale = 1

    } else if (key_left) {

    image_xscale = -1;}

}
 

curato

Member
usually what I would do there is stop the animation at the end and pick back up when I hit the ground again.
 
G

Gorshalox

Guest
usually what I would do there is stop the animation at the end and pick back up when I hit the ground again.
So i need to do smth like " if (image_index = 8) {
image_speed = 0;
}" or smth else?
 

curato

Member
you can do something like that but I personally like using the animation end event then just check the status if I am jumping then change the image_speed otherwise do nothing. also good for shooting at the end of an animation.
 
Top