A little platformer written in C. Play it here, then take it apart.

Every system in Super Mango is plain, commented C11 you can read in an afternoon: the game loop, collisions, the level loader, even the level editor. Built with raylib, it runs right here in your browser, and it is meant to be studied.

C11raylib 63 levels1.1 MB of art & soundMIT

Press start

You begin in Creator's Playground. Debug mode is the same game with the inspector switched on: every hitbox drawn, and time you can freeze, step and slow down.

Ready when you areThe game downloads only when you press play: about 1.1 MB of art and sound plus the engine.

  • ←→ or AD move
  • Space jump
  • Shift run
  • Esc pause
  • F1 settings
  • Gamepads work too, and phones get touch buttons. Tab leaves the game.

What's in the cartridge

Three hand-built levels, from a grassy playground to two volcanic stages, plus six small lab levels for studying one mechanic at a time.

Who you'll meet

Learn C by taking it apart

Super Mango started as a way to learn C properly, by building something we actually wanted to play. So the code prefers being readable over being clever: simple loops, explicit ownership, and comments that explain why, not just what.

Nothing is hidden behind an engine. Open any file and you are one or two function calls away from raylib.

src/core/game_loop.cpulled from the source when this page was built
int steps = game_inspector_steps(gs, frame_seconds);
for (int i = 0; i < steps; i++) {
    /* Live steps are GAME_FIXED_STEP; a replayed experiment supplies its
     * recorded step and 0 once the tape has ended. */
    float step_dt = game_experiment_dt(gs, GAME_FIXED_STEP);
    if (step_dt <= 0.0f) break;
    cam_x = game_update_active(gs, step_dt, cam_x);
    /* Completion, game over or a route stops the remaining steps. */
    if (game_simulation_blocked(gs)) break;
}

Every frame turns real time into a whole number of fixed 1/60 s steps. That is why a jump reaches the same height at 60 Hz and at 144 Hz, and why a recorded run replays exactly.

The manual

Every page was written next to the code it describes, and checked against it.

Open the manual

Take it home

Native builds for each platform come with every tagged release. To get the level editor and the learning labs too, build from source with make builder.