# CCC Game Kit — Template

A juicy Phaser 3 starter that already meets the CCC GAME STANDARD: Boot → Preload (progress bar) → Menu → Game → GameOver, full juice (screen shake, hit-stop, particles, flash, squash & stretch, score popups), Web-Audio SFX + music loop, localStorage best score, object pooling, pixelRatio capped at 1, and keyboard + pointer + touch input.

Run it: `python3 -m http.server 8000` then open `http://localhost:8000`. It plays out of the box with placeholder shapes — you make it yours by editing **three places**.

## The 3 places you edit

### 1. Assets — `src/scenes/Preload.js`
Find the `ASSET LIST — EDIT POINT #1` block. Uncomment / add your images:

```js
this.load.image('bg',   'assets/bg.png');
this.load.image('hero', 'assets/hero.png');
this.load.image('good', 'assets/good.png');
this.load.image('bad',  'assets/bad.png');
```

Generate cohesive art with the kit tool:

```bash
node ../tools/gen-assets.mjs ./assets ./assets.json
```

where `assets.json` is `[{ "name": "bg", "prompt": "..." }, ...]`. For sprites that need transparency, put **"isolated on solid #FF00FF background"** in the prompt — the tool chroma-keys magenta to transparent and trims.

### 2. Mechanic — `src/scenes/Game.js`
Find `// === YOUR MECHANIC HERE ===`. Everything between that marker and `endGame()` is the gameplay. Rewrite it for your game. Keep using:
- `this.physics.add.group()` for recyclable actors (built-in pooling),
- `Juice.*` for feel, `Audio.sfx('name')` for sound,
- `this.endGame()` when the run ends.

### 3. Tuning — `src/config.js`
`window.GAME.tuning` holds every gameplay knob (lives, spawn rate, fall speed, difficulty ramp, player speed) plus title, colors, and the localStorage key. Change feel here without touching logic.

## Juice API (`src/juice.js`)
`Juice.screenShake(scene, dur, intensity)` · `Juice.hitStop(scene, ms)` · `Juice.burstParticles(scene, x, y, color, count)` · `Juice.flash(scene, dur, [r,g,b])` · `Juice.squashStretch(scene, obj, amount, dur)` · `Juice.scorePopup(scene, x, y, text, color)`

## Audio API (`src/audio.js`)
`Audio.sfx('move'|'catch'|'score'|'hit'|'lose'|'start'|'miss')` · `Audio.startMusic()` · `Audio.stopMusic()` · `Audio.toggleMute()`. AudioContext resumes on first gesture automatically.

## Verify (definition of done)
```bash
node ../tools/verify.mjs .
```
Serves the folder, loads it in a real browser, fails on ANY console error, confirms the canvas rendered, and saves `verify-screenshot.png`. Zero errors = shippable.
