# Siege Sling: A Slingshot Physics Game With Sentries

> Drag the loaded round back and let go to topple towers of wood, ice and stone and knock out the clockwork sentries, in one offline HTML file: eight levels with stored solutions, four ammo kinds (stone, dash, split, bomb) and a firebox chain, plus spare-shot bonuses and star ratings. Blocks, landscape 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/siege-sling

## What you get

Bring the tower layouts, materials and projectile kinds, and optionally the numbers and theme. The Skill returns a downloadable Skill (the reference game project, a customize guide, a level solver, headless verification) and one playable example level.

## Install

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

```text
/siege-sling make a slingshot physics game with <your towers> and <your ammo kinds>
```

## How it works

1. **Copy the finished siege game** Siege Sling hands your agent a complete physics game: node scripts/new-project.mjs --out my-siege, then npm ci. The engine runs cannon-es at a fixed 1/60 s step, with damage from impact speed and mass, crack stages, four round types, powder-crate chains, scoring, stars, eight levels with stored solutions, a follow camera, slow motion, synthesised sound, touch input and a window.__scene test API.
2. **Edit levels, materials and rounds** references/customize.md has one entry per change: setting and light, palette, tower materials, sentries, rounds, levels, numbers, copy and sound. Levels are text in src/levels.js and every tunable number sits in src/config.js. After moving or adding pieces, run node scripts/find-route.mjs --search with the level id and paste the printed solution into that level. All editing happens locally.
3. **Shoot, replay and deliver** npm run build:single writes dist-single/index.html, which must stay under 8 MiB and pass the sandbox CSP with no network, storage or workers. npm run shoot plays it in local Chrome, covering level 1, aiming, flight, collapse, level clear, the tricks, a later level and a phone launch, and node scripts/find-route.mjs replays every stored solution. Read shots/report.json and the screenshots before delivering.

## FAQ

### How do you play Siege Sling?

Siege Sling has you drag the loaded round back from a wheeled sling, watch a dotted arc and let go to topple forts of planks, ice and stone guarded by clockwork sentries. Tap in flight for a trick: the Comet dashes, the Scatter splits into three and the Bomb explodes through red powder crates. Leftover rounds add 5,000 points each toward up to three stars.

### Does Siege Sling need an API key or a paid service?

No. Siege Sling's textures and sounds are drawn or synthesised in code in src/view/textures.js and src/audio.js, and nothing calls a model or a paid service. npm ci fetches pinned packages from the public npm registry, so restyling and rebuilding the game stays off your SandBase bill.

### How big is the Siege Sling file?

Siege Sling builds to about 0.7 MiB, most of it three.js and cannon-es, inside an 8 MiB limit. The package has no image, audio or font file. npm run build:single embeds THIRD_PARTY_NOTICES.txt as an HTML comment at the top of the file, which must not be stripped.

### Can I add my own levels to Siege Sling?

Yes. Siege Sling keeps levels as text layouts in src/levels.js, and scripts/find-route.mjs --search finds a clearing shot for a new layout that you paste in as its stored solution. If an edit makes a level unwinnable, the Node replay and the level-clear step of npm run shoot catch it.

### Why can't I clear a Siege Sling level the stored way by hand?

Siege Sling's stored solutions are exact shots that clear the level in the simulation with those precise numbers. A player aiming by hand does not hit the same values, and nudging a solution's speed by 3 percent either way drops its clear rate to between 0 and 45 percent. Star thresholds come from replayed scores, not many human plays.

### What are the physics limits in Siege Sling?

Siege Sling uses cannon-es with box, cylinder and sphere shapes only, and broken blocks become visual debris rather than new bodies. Very tall or thin towers can wobble before the first shot, so the loader warms up and sleeps everything. The camera works in the z near 0 plane, so layouts spread deep along z are not framed.

### Does Siege Sling keep my progress?

No. Siege Sling keeps unlocked levels and best scores only for the visit, because the sandbox has no storage. The eight levels unlock in order, from a single timber gate to a five-sentry foundry citadel. Multiplayer, end-user level editors and real-time networking are not supported.

## Examples

- Siege Sling catapult game (scene)
- Timber Gate (video)
