How to handle jumping up a slope in a runner game?

Posted by you786 on Game Development See other posts from Game Development or by you786
Published on 2013-10-23T17:21:09Z Indexed on 2013/10/23 22:07 UTC
Read the original article Hit count: 196

Filed under:

In an 2D endless runner, what should happen when the player is running "too fast" up a slope and jumps?

For example, in a "normal" case:

    .O.
   . __..O_____
  . /
 . /
 O/
_/

If he is moving to the right slowly enough, he will jump upwards and land on the flat part of the surface. However, if he is moving too fast, the jump will have no effect as his forward motion will bring him back in contact with the slope before he can get high enough to pass over it. When the speed is sufficiently high, there will effectively be no jump.

     _________
    /
 .O/
 O/
_/

Are there any known ways to solve this issue? I know it's physically correct*, but are there techniques that other games use to overcome this in a reasonable manner?

As a last resort I'll have to just remove all slopes that are too slanted.

*If you constrain the player to never jumping backwards.

© Game Development or respective owner

Related posts about 2d-physics