// a raycasting engine for esp32, desktop & web

YARI

Yet Another Raycast Implementation

A small C game engine for building vintage first-person games in the spirit of Wolfenstein 3D. Written for ESP32 hardware - the same game code also runs on macOS, Linux and, right here, compiled to WebAssembly.

C99 ESP32 · ST7789 raylib 5.5 SDL2 WebAssembly
YARI raycaster running live on an ESP32 with an ST7789 display

running on real ESP32 hardware - ST7789, 240×136

// webassembly builds

Play in the browser

Two complete example games, compiled with Emscripten from the exact same C engine that ships to ESP32 hardware.

Keyboard required - ↑ ↓ ← → or WASD to move, space to start.

// one engine, three targets

Small, portable, hackable

YARI isn't a general-purpose engine. It stays small and understandable, while keeping desktop development fast enough to iterate without flashing a board after every change.

[render]

C raycasting renderer

Column-based wall rendering, sprite z-buffering, distance shading and floor/ceiling casting.

[esp32]

ESP32-first design

ST7789 SPI backend, RGB565 framebuffer, configurable pins and ready-to-build ESP-IDF examples.

[desktop]

Fast desktop iteration

The same game runs on macOS and Linux through raylib or SDL2 for quick debugging.

[web]

WebAssembly output

Full game examples compile to WASM through Emscripten and run straight in a browser.

[assets]

Static, embedded assets

Textures and fonts are packed into C arrays, ready to ship inside embedded firmware.

[api]

Tiny game-facing API

A game implements yr_init_game() and yr_update_game() - YARI owns the rest.

Wiring diagram of an ESP32 with an ST7789 display, joystick and four buttons

ESP32 + ST7789 + analog joystick + 4 buttons

// runs on real hardware

Built for a $5 microcontroller

The ESP32 backend targets an ST7789 SPI display in landscape orientation, driven from an RGB565 framebuffer. Digital buttons map to pull-up GPIOs and an analog joystick covers the two movement axes - all configured with a handful of macros.

  • ST7789 SPI display, configurable pins and clock speed
  • Pull-up GPIO buttons + dual-axis analog joystick
  • Ships as a normal ESP-IDF component
↗ Open the interactive Wokwi diagram
Screenshot of the YARI map builder visual level editor

the built-in raylib/raygui level editor

// content pipeline

A level editor that speaks YARI

map_builder is a visual raylib/raygui editor for walls, entities, floors, ceilings, collision layers and sprite animations. Save, and it writes a plain C header straight into your game.

// generated level.h, included directly #include "level.h" void yr_init_game(YrContext *ctx) { load_level(ctx); }