← Documentation Home

LunarBasic Step-by-Step Tutorials

Back to Welcome

This course teaches LunarBasic by building small, working programs. Follow the lessons in order if you are new, or jump directly to a feature you want to learn.

How to Use This Course

  1. Create a new .lb file for each lesson.
  2. Type the examples instead of pasting them when possible; this helps the syntax become familiar.
  3. Run after every numbered step. Fix the first error before moving on.
  4. Complete the checkpoint and challenge at the end of each lesson.
  5. Command-click on macOS or Ctrl-click on a built-in function on Windows to open its reference page.

Course

  1. Language Foundations — variables, types, expressions, strings, comments, and line continuation.
  2. Decisions, Data, and Routines — conditions, loops, arrays, functions, Subs, enums, and objects.
  3. Your First Interactive Program — create a window, build a game loop, move a player, and draw a HUD.
  4. Drawing, Camera, and Buffers — primitives, circles, clipping, transforms, drawing state, and off-screen rendering.
  5. Input, Assets, and Audio — keyboard, mouse, controllers, text input, images, sprites, fonts, and sound.
  6. Files, Paths, and Save Data — portable paths, text files, typed binary data, and safe resource cleanup.
  7. Particle Effects (Pro) — build sparks, tune motion, add bounds, and use attraction efficiently.
  8. Build a Physics Game (Pro) — bodies, fixed-step simulation, collision queries, filtering, rotation, and rendering.

Keep the References Nearby