With our player movement, gravity, and jumping implemented in the last chapter, we’ll move on to give our player the ability to push off a nearby wall for an extra midair jump.
There are different ways to design a wall jumping mechanic. You might only allow a wall jump to be performed in the opposite direction that the player’s velocity is traveling in, to enforce the idea that they are “pushing off” of the wall and redirecting their momentum.
Our system will be a bit more allowing. We’ll simply test for collisions with walls near the player, and if we can find any, we’ll allow the ...