How to handle jumping up a slope in a runner game?
- by you786
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.