Quote:
|
Originally Posted by Polo
1) We only need to do the sliding when only one direction is being pressed. If the player is trying to walk on a diagonal, the sliding should not be done. (It's fairly easy to prove this).
|
I actually lied a little bit here. There is one case where sliding when holding a diagonal can occur, but I thought it was a lot less common than it is. When holding the diagonal, you need to check for sliding along both leading edges of the player, but you only have to do half the check for each. They should not slide away from the diagonal which they are holding.
For example, if the player is holding up and right, then we can either face upwards and slide to the right, or face to the right and slide upwards. The other 2 checks, facing right and sliding downwards, and facing up and sliding to the left, would feel unnatural to the user, and should be avoided.