Look at this sprite sheet.


It is clear that frame 1-3 are the "jump up" frames after which the last frame will be fixed until the "peak" of the jump (when gravity starts pulling back). When moving back down frame 4-7 are used and it all ends with an "idle" frame (which is not shown here in this jump sprite).

My question is about frame 6 and 7 in this sprite. When the entity "lands" after a jump it is suppose to run animation 6-7 as the "landing" animation. When moving down in a jump frame 4-5 are easy because they are the "start" of the animation. Frame 5 can be kept for as long as you fall... but what is the appropriate way to go from frame 5 to 6-7-x? Do you check if the frame after the next is a fall and then "initiate" landing or do you do that when you have actually hit the ground?

It can't be timed because of various scenarios such as jumping off a cliff or jumping under a low roof hitting your head and bouncing you back down.

Any ideas?


2 Answers 2


I guess the usual approach is to have three jump-related states: Jumping (a hero rises to the highest point of jump), Falling (from the highest point of jump to the ground), Landing (jump ends with hero standing on the ground).

There are several ways of detecting these states, usually it's a several collision checks setting state flags. For example, in a character's physics step we may check for collisions below, and if there aren't any, then character is in the air. Now if a character has positive vertical speed, it's a Jumping state, otherwise it's a Falling state. If it's a Falling state, and we detected a collision below, than it's a Landing state, so lets switch to the landing animation.

This animation usually plays when hero has actually hit the ground. The animation sequence is short, so landing will look high-speed, also it creates a feeling of crisp and precise controls. Sometimes character can do a long landing sequence, but then it's possible for a character to cancel landing animation and start running, e.g. Castlevania: SotN.

  • \$\begingroup\$ +1. Good point about states. From states you can figure out other details / modes. \$\endgroup\$
    – Kromster
    Commented Aug 19, 2011 at 18:36

I've seen this done two ways:

  1. When the bounding box first collides with the ground make a fast transition 5->6->7.
  2. Have a second 'ghost' bounding box, that extends a small portion below the actual bounding box to initiate the 5->6, then upon the actual bounding box colliding do 6->7.
  • \$\begingroup\$ Liked the 2nd case. Seems very flexible because the ghost bounding box can be set far away depending on the speed of the character! \$\endgroup\$
    – pek
    Commented Aug 19, 2011 at 17:24
  • \$\begingroup\$ Interesting approach Nbr 2. I never ended up trying it but i will keep it in mind thank you. \$\endgroup\$
    – sPirc
    Commented Aug 21, 2011 at 9:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .