# Pin Alley: A 3D Ten-Pin Bowling Game

> Line up and flick a bowling ball down a real alley, in one offline HTML file: ten rigid-body pins, full ten-frame scoring with strikes, spares and a 10th-frame bonus, a hook shot that bends on the lane, and a game-over scorecard. Lanes, pins, ball and sounds are all generated in code; the physics runs deterministic per throw.

- 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/pin-alley

## What you get

Bring the alley look, ball and pins, and optionally the numbers, scoring and feel. The Skill returns a downloadable Skill (the reference game project, a customize guide, headless verification) and one playable example match.

## Install

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

```text
/pin-alley make a ten-pin bowling game with <your alley look> and <your rules>
```

## How it works

1. **Choose the alley look** Pin Alley takes a prompt such as 'Use pin-alley to make a ten-pin bowling game with a neon night alley and a heavier ball.' node scripts/new-project.mjs --out <dir> copies the game, which needs Node 22.4 or later. The lane, gutters, pins, ball, masking panel and two neighbour lanes are modelled and painted in code with three.js.
2. **Tune physics and scoring** Your coding agent edits src/config.js for numbers and src/game/ and src/physics/ for rules. Ten rigid-body pins run on cannon-es at a fixed 1/240 s step, and the world is rebuilt per ball so a throw always repeats. PHYS.hookAccel sets how much a curved flick hooks. src/game/scoring.js is a pure function covering strikes, spares and tenth-frame bonus balls.
3. **Build and shoot the frames** npm ci && npm run build:single writes one dist-single/index.html under 8 MiB with no fetch, storage or external URLs. npm run shoot needs Chrome, or CHROME_PATH, and writes shots/report.json. Release 0.1.1 passed ten checks: lane, aim, roll, strike, spare, gutter, tenth frame, game over, scorecard and new game. After a physics change, the strike and spare throws may need replacing.

## FAQ

### How do I bowl in Pin Alley?

Pin Alley has you drag the ball sideways to line up, then flick toward the pins: the flick sets direction, its speed sets power and a curved flick adds hook. On the keyboard, left and right move, Q and E aim, Z and X spin, W and S set power, Space bowls and N starts a new game.

### Does Pin Alley score like real bowling?

Yes. Pin Alley scores a full ten-frame game by the usual ten-pin rules, with strikes, spares, misses, tenth-frame bonus balls, running totals and a game-over card. The scoring function was tested on games of 300, 0 and 150 and on a real game.

### Is Pin Alley a realistic lane simulation?

No. Pin Alley shortens the lane to about a fifth of real length so the whole run fits on screen, and the hook is a side-force rule tuned for feel, not measured lane oil. The pin action is a genuine rigid-body simulation.

### Does Pin Alley use paid APIs or asset files?

No. Pin Alley makes no network calls and ships no image, model, sound or font file; rolling and pin sounds are synthesised in the browser. Nothing in a game reaches SandBase billing. Without a GPU, SwiftShader may drop it below the 30 fps check.

### Does Pin Alley work on phones?

Yes. Pin Alley lines up the ball with a sideways drag and bowls with a flick on touch screens. That was checked under touch emulation. The game text is English only, with no second language.

## Examples

- Pin Alley bowling lane (scene)
- Classic Lane (video)
