# ESP32 Spooky Maze Game

Rust Bare Metal implementation of maze game for ESP32 with Bevy ECS no_std

一只小幽灵在随机生成的迷宫里捡金币、躲障碍、扔炸药，同一套游戏逻辑同时跑在电脑键盘、浏览器和好几块嵌入式板子上，既有 ESP32-S3 型号也有初代 ESP32。

- id: georgik-esp32-spooky-maze-game
- author: georgik
- repository: https://github.com/georgik/esp32-spooky-maze-game
- license: MIT
- shape: square
- scenes: games, home
- boards: ESP32
- browser_playable: no
- preview: Project screenshots
- html: https://esp32gallery.com/projects/georgik-esp32-spooky-maze-game/
- html_zh: https://esp32gallery.com/zh/projects/georgik-esp32-spooky-maze-game/
- json: https://esp32gallery.com/data/catalog/projects/georgik-esp32-spooky-maze-game.json

## Hardware

Supported hardware: ESP32. Confirm the exact board revision and pin map in the upstream repository.

支持硬件：ESP32。烧录前请在上游仓库核对板卡版本与引脚定义。

## English

```
A ghost wanders a randomly generated maze picking up coins, dodging obstacles and setting off dynamite, and the same game logic runs on a desktop keyboard, in the browser and on several embedded boards, including both ESP32-S3 and original-ESP32 models. Bevy ECS holds the rules in a no_std core; each port replaces Bevy's renderer with the Embedded Graphics crate and turns its own input - arrow keys, an accelerometer, or a GT911 touchscreen's on-screen D-pad - into events. Frames go to PSRAM on boards that have it and to the internal heap on the smallest one with 180 KB. The stack is Rust, esp-hal 1.0.0-beta.1 and Bevy 0.16.1; flashing needs espflash and espup, and Xtensa targets also need the compiler toolchain from ESP-IDF v5.5.
```

## 中文

```
一只小幽灵在随机生成的迷宫里捡金币、躲障碍、扔炸药，同一套游戏逻辑同时跑在电脑键盘、浏览器和好几块嵌入式板子上，既有 ESP32-S3 型号也有初代 ESP32。规则写在 Bevy ECS 的 no_std 核心里，每个移植只换渲染和输入：桌面用方向键，带加速度计的板子倾斜操作，带触摸屏的那块用 GT911 上的虚拟方向键。Bevy 自带的渲染在 no_std 下不可用，改用 Embedded Graphics 自己画。有 PSRAM 的板子把帧缓冲放外部内存，内部内存只有 180 KB 的那块就放片内堆。烧录要装 espflash 和 espup，Xtensa 目标还得另外准备 ESP-IDF 5.5 的编译器工具链。
```
