Super Mango manualPlay

The Super Mango manual

29 pages, written next to the code and checked against it. Here to learn? Start with Sandbox School. Looking for something specific? Everything is listed below, or filter the page list.

Super Mango Editor

Play a C11/raylib platformer, build TOML worlds, and learn how the engine works.

Super Mango is a 2D platformer built in C11 with raylib, designed as an educational project for learning game development. The game features dynamic multi-screen TOML worlds with parallax backgrounds, enemies, hazards, collectibles, and fixed-time-step physics, building natively on macOS/Linux/Windows and as WebAssembly for browser play.


Learn by Doing

Page Description
Sandbox School Eight guided labs, from first frame to reproducible experiments
Debugging C Sanitizer reports, lldb/gdb on a real crash, and a quick profiling pass
Optimization Lessons make bench, each optimization with before/after numbers, the two that were allowed to change pixels, and the ones left out
C in This Codebase Each C idea (ownership, offsetof tables, goto cleanup, overflow checks) mapped to where the game uses it
Mechanics Museum Six standalone levels for focused inspection
Entity Walkthrough Trace a collectible through file format, runtime and editor; the checklist for adding any entity

Engine & Code

Page Description
Architecture Game loop, init/loop/cleanup pattern, module dependencies, GameState container, 33-layer render order
Glossary Logical pixel, fixed step, LevelDef, AppSession, borrowed pointer and the other terms, each with a pointer to the code
Controls & Input Keyboard, gamepad, browser/WASM, replay, smoke, and runtime flag reference
Testing & Smoke Matrix Which local/CI checks to run for runtime, editor, docs, WASM, and release changes
Source Files Module-by-module reference for every .c / .h file
Player Module Input, physics, animation and lifecycle across src/player/
Constants Reference Curated gameplay constants and runtime-width distinctions
Design Decisions Why raylib, TOML, the fixed step, entity tables, QOA and the rest: context, decision, consequences

Content & Assets

Page Description
Entities & Hazards All 6 enemy types and 7 hazard types: behaviour, constants, TOML placement
Collectibles & Surfaces Coins, stars, bouncepads, rails, float platforms, climbable surfaces
Assets All sprite sheets, tilesets, and generated sounds in assets/; text uses raylib’s built-in font
Sounds The 12 generated QOA files in assets/sounds/ and how the game plays them
Asset Inventory Generated raw asset sizes and budget
Asset Provenance Code, artwork, audio and font license records
Level Catalog Generated inventory of every stage selected by the v1 campaign manifest, its progression link, and content count
Overlay Snapshots Generated text snapshots for pause and terminal overlays

Building & Contributing

Page Description
Build System Makefile, compiler flags, build targets, prerequisites for all platforms
Troubleshooting No window, no audio device, no file picker, toolchain mismatches: symptom, cause and fix
Level Design — TOML Reference Full TOML schema for every entity type; minimum level template
Level Editor Visual editor: canvas, palette, properties, undo, play-test, file I/O
Developer Guide Coding conventions, ownership rules, physics, sound, music and text workflows
Release Checklist Source, docs, WebAssembly, archive, CI, and Pages gates before shipping

Key Features

  • 2D side-scrolling platformer with dynamic multi-screen worlds (configurable via screen_count)
  • 33 render layers drawn back-to-front with per-level configurable parallax backgrounds
  • Fixed-time-step physics (1/60 s steps fed by an accumulator); make timing-lab shows why variable steps made results depend on the frame rate
  • Six enemy types (spider, jumping spider, bird, faster bird, fish, faster fish)
  • Seven hazard types (spike, spike block, spike platform, circular saw, axe trap, blue flame, fire flame)
  • Five collectible types (coin, star yellow/green/red, last star)
  • Climbable vines, ladders, ropes; three bouncepad tiers (small/medium/high); crumble bridges; float platforms (static/crumble/rail-riding)
  • TOML-only level workflow: levels/campaigns/main.toml orders the sandbox and two volcanic stages; --level <path> also opens the separate learning labs
  • Authored [[checkpoints]] supply explicit respawns; levels without records retain automatic screen-boundary respawns
  • Pause, game-over, and level-completion overlays: terminal menus support Next Level, Replay, Level Select, Exit, or Retry as applicable; Up/Down or D-pad selects, Enter/Space/Start confirms (A also confirms), Esc/Back exits (B also exits)
  • Standalone visual level editor with undo, copy/paste, validation blocking, recent files, autosave, and play-test integration
  • Start menu, HUD, lives, F1 settings, saved preferences and per-level best results
  • Opt-in debug inspector: freeze/step, slow motion, live tuning and experiment capture/replay
  • Keyboard, hot-plug gamepad and browser touch controls
  • Builds natively on macOS, Linux, Windows; WebAssembly via Emscripten

Play in browser →


Project at a Glance

Item Detail
Language C11
Compiler clang recommended for CI/local parity; gcc compatible
Window size 800 × 600 px OS window by default (native settings scale the canvas 1×–4×)
Logical canvas 400 × 300 px (2× pixel scale)
Simulation rate 60 fixed steps per second (TARGET_FPS); drawing follows the display’s refresh rate
Audio raylib/miniaudio-negotiated device format; decoded effects and streamed music, both QOA
Libraries raylib 6.2 (bundled GLFW on desktop), tomlc17 (TOML parser)
Level format TOML (.toml files in levels/)

Quick Start

Install the prerequisites first: a C compiler, make, CMake, Python 3 and Node.js, listed per platform in Build System (the README has the same list). make doctor says what is missing. Then:

# Build and run the game
make run

# Build and run the level editor
make run-editor

# Run a specific level file
make run-level LEVEL=levels/labs/01_collision.toml

# Optional local WebAssembly preflight (CI is authoritative for WASM releases)
make web

The editor is a native program. The browser page plays the game and does not include the editor. make run-editor opens an empty level; Open (Ctrl+O) loads a file from levels/ or levels/labs/. See Level Editor.

The Makefile builds with clang by default; add CC=gcc to use GCC. See Build System for every target and flag, and Troubleshooting when a build or test fails for a reason outside the code.