All paths

Game dev on microcontrollers

Write a space platformer in C++ on an ESP32-C3 with a tiny OLED, three buttons and a piezo: game loop, sprites, input, collision, gravity and sound, one idea at a time.

ESP32-C3-DevKitM-1Free7 lessons5 h4 chapters1,774 XPCoding · Intermediate+150 XP

0 of 7 done

Start the course freeThe game loopBuild it as a kitRetails for about $17.70, free on Mokxi.Lesson plan for teachers
What you will build

3 projects, built step by step

7 lessons in 4 chapters, about 5 hours on a simulated ESP32-C3-DevKitM-1. Free, in your browser, every step checked by the simulator.

Chapter 1 project

Sprites and frames

An 8x8 astronaut stored as eight bytes, a two-frame walk cycle, a mirrored turn that costs no memory, and erasing exactly what you drew.

Open it in the simulator
Chapter 2 project

Collision

Axis-aligned boxes and four comparisons: collect crystals, stop at a boulder by undoing the move, and tune a hitbox until the game feels fair.

Open it in the simulator
Chapter 3 project

Sound effects

A piezo, tone() and note tables: a start jingle, a rising jump and a crystal chime, played from the game loop by priority without ever freezing the game.

Open it in the simulator
The map

Chapter by chapter

Each lesson opens when the one before it is done, and each chapter ends in a project.

Chapter 1

Loop and pictures

A steady frame rate and sprites stored as bytes.

  1. Open187 XP

    The game loop

    Read, update, draw, wait: a parallax starfield at a fixed 25 frames a second, a frame budget you can measure, and what happens when the work outgrows it.

    0 of 5 steps

  2. ProjectLocked410 XP

    Sprites and frames

    An 8x8 astronaut stored as eight bytes, a two-frame walk cycle, a mirrored turn that costs no memory, and erasing exactly what you drew.

    0 of 5 steps

4 questions, graded as you go.
Chapter 2

Make it playable

Buttons read like a game reads them, and boxes that touch.

  1. Locked174 XP

    Input

    Three buttons read once a frame into a snapshot: held for walking, pressed for jumping, and why reading once a frame also tames contact bounce.

    0 of 4 steps

  2. ProjectLocked312 XP

    Collision

    Axis-aligned boxes and four comparisons: collect crystals, stop at a boulder by undoing the move, and tune a hitbox until the game feels fair.

    0 of 4 steps

4 questions, graded as you go.
Chapter 3

Physics and sound

Fixed-point gravity and sound effects that never freeze the game.

  1. Locked156 XP

    Gravity

    Velocity, acceleration and sixteenths of a pixel: a jump that is a true parabola, moon gravity in one constant, and landing on a ledge from above.

    0 of 4 steps

  2. ProjectLocked348 XP

    Sound effects

    A piezo, tone() and note tables: a start jingle, a rising jump and a crystal chime, played from the game loop by priority without ever freezing the game.

    0 of 4 steps

4 questions, graded as you go.
Chapter 4

Boss

Everything in one platformer, then a level of your own.

  1. Locked187 XP

    Boss: a platformer

    Everything in one game: three crystals on the moon, floating rocks, a crater that costs a life and a portal that opens when you have them all. Then make it yours.

    0 of 5 steps

3 questions, graded as you go.
Syllabus

Every lesson in the course

All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.

Chapter 1

Loop and pictures

  1. The game loopRead, update, draw, wait: a parallax starfield at a fixed 25 frames a second, a frame budget you can measure, and what happens when the work outgrows it.
  2. Sprites and framesAn 8x8 astronaut stored as eight bytes, a two-frame walk cycle, a mirrored turn that costs no memory, and erasing exactly what you drew.
Chapter 2

Make it playable

  1. InputThree buttons read once a frame into a snapshot: held for walking, pressed for jumping, and why reading once a frame also tames contact bounce.
  2. CollisionAxis-aligned boxes and four comparisons: collect crystals, stop at a boulder by undoing the move, and tune a hitbox until the game feels fair.
Chapter 3

Physics and sound

  1. GravityVelocity, acceleration and sixteenths of a pixel: a jump that is a true parabola, moon gravity in one constant, and landing on a ledge from above.
  2. Sound effectsA piezo, tone() and note tables: a start jingle, a rising jump and a crystal chime, played from the game loop by priority without ever freezing the game.
Chapter 4

Boss

  1. Boss: a platformerEverything in one game: three crystals on the moon, floating rocks, a crater that costs a life and a portal that opens when you have them all. Then make it yours.
Kits

Build it on your bench too

Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.

The kit for this course

Game Dev Kit

An ESP32-C3, an OLED display (128x64), a pushbutton and a piezo speaker: a moon platformer you build and tune yourself.

Open the kit
Have a kit already?

Find your kit

Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.

See every kit
Questions

About Game dev on microcontrollers

Is Game dev on microcontrollers free?

Yes. All 7 lessons of Game dev on microcontrollers are free and run in your browser, with nothing to install and no parts to buy before you start.

Do I need a real ESP32-C3-DevKitM-1?

No. Every lesson runs on a simulated ESP32-C3-DevKitM-1 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.

How long does Game dev on microcontrollers take?

About 5 hours: 7 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.

What will I build?

Each chapter ends in a project that puts it together: Sprites and frames, Collision and Sound effects.

Where do I start?

With "The game loop", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.