# Crater Raid: A Run-and-Gun on Destructible Terrain

> Run, shoot, roll and throw grenades across a seeded crater world where every tile can be blasted, in one offline HTML file: bullets chew dirt, grenades dig craters, fire spreads and a roll puts it out. Clear each outpost of patrols, dodgers and grenadiers; levels grow wider, lives run out and the best level is kept. Every sprite, tile and sound is drawn or synthesised 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/crater-raid

## What you get

Bring the theme, the hero and the enemies, and optionally the terrain, the weapons, the level growth and the HUD text. The Skill returns a downloadable Skill (the run-and-gun project, a customize guide, headless verification) and one playable example run.

## Install

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

```text
/crater-raid make a run-and-gun where <your hero> raids <your world>
```

## How it works

1. **Copy the run-and-gun game** Crater Raid starts with node scripts/new-project.mjs --out my-raid and npm ci, which fetches Vite and playwright-core. Your coding agent reads references/customize.md for palette and weather, terrain and outposts, the enemy table and escalation, movement, roll and grenades, props and barrels, HUD copy, the cover script and the touch layout. A prompt names your hero and the world they raid.
2. **Tune terrain, enemies and feel** The seeded generator builds one deterministic plan per seed and level, with level.baseSeed in config.js. Every sprite, tile texture, prop, sky and sound is drawn or synthesized in code under assets/crater-raid/src/, so there are no image or audio files. It runs on Canvas 2D only, with a fixed 60 fps axis-aligned tile world and no WebGL requirement.
3. **Build, shoot and read the report** npm run build:single writes dist-single/index.html, about 0.1 MiB. npm run shoot needs local Chrome, with SwiftShader acceptable, and plays the title, moving, shooting, breaking terrain, a grenade crater, a roll, a kill, damage and respawn, a level clear, game over and restart, plus a phone run. Look at shots/*.jpg and shots/report.json until every check passes.

## FAQ

### What happens in a Crater Raid level?

Crater Raid is a 2D run-and-gun on destructible seeded terrain. You run with A and D, jump with W or Space, shoot with Z, dodge-roll with X and throw a fuse grenade with C. Bullets chip dirt, glass and pipe, explosions carve craters and burning barrels chain-detonate. Clear every enemy on a sector to advance to a wider level.

### How smart are the Crater Raid enemies?

Crater Raid enemies run a small state machine, patrol, alert, fight and lost, with vision range, facing and line-of-sight raycasts. They spot you after a reaction delay, shoot, dodge-roll and lob grenades back. They are not pathfinders, so they walk, jump and use ladders and can be evaded.

### Is the Crater Raid level the same every run?

Yes, for a given seed. Crater Raid always builds the same world for sector N from level.baseSeed in config.js, and changing it gives a different planet. There is no hand-authored level data and no tile editor.

### Does Crater Raid save progress?

Only within the session. Crater Raid keeps best, the furthest sector reached, in an in-memory store, and closing the tab resets it. There is deliberately no disk persistence, because the sandbox allows no storage.

### Does Crater Raid need a key or downloaded assets?

No. Crater Raid calls no model, fetches nothing and uses no storage or workers, so there is no usage charge. Everything is original code, and npm run build:single writes a THIRD_PARTY_NOTICES comment at the top of the file that must not be stripped.

### What are the Crater Raid limits?

Crater Raid has no slopes, fluids or polygon terrain, and tiles are the unit of destruction with no partial-tile damage. It is single-player, its UI is English only and there is no co-op. Sound is synthesized with Web Audio on the first gesture, so a muted browser stays silent.

## Examples

- Crater Raid run-and-gun game (scene)
- First Run (video)
