# Grid Serpent: A 3D Snake Game With Three Landscapes

> Steer a cartoon serpent round a 20×20 board in 3D, in one offline HTML file: three landscapes, two render styles, chase, eye-level and top-down cameras, a speed-up with every fruit and a win for a full board. Models, textures and sounds are all generated in code.

- Type: Lab Skill (downloadable Agent Skill)
- Category: [Game creation](https://www.sandbase.ai/skills/games)
- Version: 0.1.1
- Runs online: yes
- Page: https://www.sandbase.ai/skills/games/grid-serpent

## What you get

Bring a landscape, its fruit and the serpent’s look, and optionally the speed, rules and sounds. The Skill returns a downloadable Skill (the reference game project, a customize guide, headless verification) and one playable example run.

## Install

Download the Skill package from https://www.sandbase.ai/skills/games/grid-serpent (sign-in required), unzip it into your agent's skills folder, then ask your agent to use it:

```text
/grid-serpent make a 3D snake game set in <your landscape>, with <your fruit> and <your serpent look>
```

## How it works

1. **Copy the reference serpent** Grid Serpent starts with node scripts/new-project.mjs --out my-serpent and npm ci. The project is complete: rules, pace, turn buffer, autopilot, landscapes, styles, cameras, sound, HUD, touch controls and the window.__scene test API. A prompt such as "Use grid-serpent to make a 3D snake game set in a coral reef, with sea grapes and a snorkel" sets the re-skin.
2. **Re-skin the landscape** Most looks are data in src/config/themes.js, and references/customize.md names the file and symbol for sky, board, serpent, wearables, scenery, a new landscape or fruit, speed, controls and sound. The default is a 20 by 20 board with Meadow and cherries, Dunes and dates, or Frostfield and lingonberries, in faceted low-poly or banded plush shading. Meshes, textures and sound are all generated in code.
3. **Build and shoot the run** npm run build:single writes dist-single/index.html, about 0.6 MiB and at most 8 MiB, with no network, storage, workers or WebAssembly. npm run shoot needs Node 22.4 or newer and local Chrome, falling back to SwiftShader without a GPU. It covers start, eating, turns, pause, cameras, a crash, each landscape and style, a cleared board and a 390 by 844 phone. Read shots/report.json.

## FAQ

### How does Grid Serpent handle quick turns?

Grid Serpent queues turns two deep and checks each against the newest queued heading, so two quick taps never reverse the serpent into its body. Turns are relative to the heading in the chase or eye-level view, and the top-down view uses compass arrows. The game speeds up slightly per fruit, down to a floor.

### Can Grid Serpent use imported 3D models?

Yes. Grid Serpent accepts models as bundled imports parsed in place, and requires every added model, texture, font or sound to be listed in assets/grid-serpent/CREDITS.json with source and licence. Use models the user made or owns, or CC0 ones, never models taken from another game or a product site. Today the list is empty.

### Does Grid Serpent keep high scores?

No. Grid Serpent keeps the best score and your choices for the visit only, because the sandbox frame has no storage. Landscape and style change only between runs, so a menu click never throws a run away.

### Does Grid Serpent need an API key?

No. Grid Serpent calls no model or paid service, and its meshes, canvas textures and Web Audio sounds are all made in code, so nothing is billed. npm ci downloads pinned packages from the public npm registry.

### Is the Grid Serpent autopilot a perfect player?

No. Grid Serpent's autopilot, used for the cover and act('autoplay'), is a short-sighted path finder. It can crash before filling the board. Filling the whole board yourself counts as a win.

### Can I change the Grid Serpent board size?

Yes. Grid Serpent reads the size from BOARD_SIZE, but the meadow's paths, benches and lamps sit at fixed coordinates, so check them after a change. Update verify.json when you change the board size, the pace, or rename landscapes, fruits or wearables.

## Examples

- Grid Serpent 3D snake game (scene)
- Meadow Run (video)
