A platformer that feels right
Jumping is harder than it looks. Here's why, and how.
Build time ~1 day
A platformer is a physics problem with a feel problem sitting on top of it. The physics takes an afternoon. The feel is what separates a game people play from one they close.
1. Movement before levels
Build one rectangle in an empty room and spend real time on how it moves. Acceleration, friction, maximum speed, gravity, jump strength. Nothing else matters until running and jumping feel good.
Build the movement core for a 2D platformer. Canvas, one file. A player rectangle with: - Horizontal acceleration and friction, not instant start-stop. - Gravity, with a maximum fall speed. - Variable jump height — releasing the button early cuts the jump short. - Different gravity going up versus coming down. Put every number in one CONFIG object at the top, with a comment on what each does to the feel. No level yet, just a floor.
That last point — asymmetric gravity — is used by almost every good platformer and by almost no first implementations. Falling faster than you rise makes jumps feel snappy rather than floaty.
2. Add the forgiveness
Three techniques, all of which make the game feel fairer without making it easier:
Coyote time. The player can still jump for a few frames after walking off a ledge. Nobody notices it's there; everybody notices when it isn't.
Jump buffering. A jump pressed slightly before landing fires on landing, instead of being dropped.
Corner correction. A jump that clips the corner of a platform nudges the player around it rather than stopping them dead.
3. Collision, carefully
Resolve horizontal and vertical movement separately — move on X, resolve collisions, move on Y, resolve again. Doing both at once produces the classic bug where running into a wall while falling sticks you to it.
4. Then build a level
Only now. A simple tile array, drawn as characters in a string, is enough to start and is easy to edit by hand.
Tune the numbers while playing, not while reading them. Put them on screen with sliders if you have to — feel is not something you can reason your way to.