Displaced Gamers Explains Mario’s Physics

Displaced Gamers’s Behind the Code series is one of the best code explainers on Youtube, and here they describe, in 35 minutes worth of no-nonsense detail, how Mario in Super Mario Bros. moves, runs, skids and jumps.

Super Mario Bros. basically created an entire genre of video games, but it probably wouldn’t have happened without its exacting attention to how Mario moves, which is a large portion of the gameplay. A few of the details:

  • Mario’s position and velocity are stored in pages, pixels and subpixels, but acceleration is handled additionally using fractions of a subpixel.
  • When Mario is facing a direction other than he’s moving, his acceleration doubles! Speedrunners actually take advantage of this fact.
  • When Mario runs with the B button, he doesn’t slow immediately when it’s released, but waits for ten frames before he drops back to walking speed. This is why he doesn’t slow down when throwing fireballs when running, and also helps players who slide their finger to the A button to jump.

Leave a Reply

Your email address will not be published. Required fields are marked *