# Bruce Snake

Arcade Snake for Bruce firmware (LilyGO T-Embed CC1101): rotary control, color/speed levels, obstacles, persistent high scores. JS.

LilyGO T-Embed CC1101 上的贪吃蛇，代码是一段 JavaScript，交给 Bruce 固件的解释器执行。

- id: koua29-bruce-snake
- author: koua29
- repository: https://github.com/koua29/bruce-snake
- license: MIT
- shape: square
- scenes: games
- boards: LilyGo T-Embed
- browser_playable: no
- preview: Project screenshots
- html: https://esp32gallery.com/projects/koua29-bruce-snake/
- html_zh: https://esp32gallery.com/zh/projects/koua29-bruce-snake/
- json: https://esp32gallery.com/data/catalog/projects/koua29-bruce-snake.json

## Hardware

Supported hardware: LilyGo T-Embed. Confirm the exact board revision and pin map in the upstream repository.

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

## English

```
Snake written as a JavaScript script for the Bruce firmware's JS interpreter, sized for the LilyGO T-Embed CC1101 and its rotary encoder. Turning the knob steers left or right relative to the snake's heading, so it can never reverse into itself, clicking pauses, and ESC opens the menu. Every few apples the snake levels up, changing colour from an eight-colour palette and speeding up from 180 ms to 60 ms per step, with a LEVEL flash; walls start appearing at level 3. The top five scores persist in /snake_scores.json on the SD card, arcade style, asking for three initials on a new record. Installation is copying Snake.js to the card and picking it from JS Interpreter; no build step is involved, since the firmware itself comes from Bruce.
```

## 中文

```
LilyGO T-Embed CC1101 上的贪吃蛇，代码是一段 JavaScript，交给 Bruce 固件的解释器执行。旋钮按蛇头朝向左右打方向，所以掉头撞自己这件事不会发生；按下就是暂停，ESC 回到菜单。吃够几个苹果升一级，蛇身从八色调色板换成另一种颜色，每步间隔由 180 毫秒缩到 60 毫秒，屏幕闪出 LEVEL n；墙从第 3 级开始出现。成绩取前五名，落盘到 SD 卡根目录的 /snake_scores.json，破纪录时照街机规矩敲三个字母。玩之前把 Snake.js 拷进卡里，从解释器菜单挑中即可，本体固件并不在里面。
```
