Using drag in an Arcade Physics platformer (Phaser 3)

Here are two examples, with and without damping.

I add horizontal drag when the player is on a floor and vertical drag when he’s on a wall (he can slide down). There’s no drag when he’s in the air.

Here’s an example with air drag. You can see the player slow slightly at the end of his jump. If you add air drag, you’ll need to increase jump velocity to cover the same distance as before.

Here’s a slippery platform and a sticky platform:

Of course, you may not need vertical drag at all in your platformer. For that case, set drag once and then toggle it on when the player is on the ground or off otherwise:

Beware that in Arcade Physics friction has nothing to do with drag; it’s a special kind of motion transfer from platforms to riders.

5 Likes