# Windsurf rules — Phaser 3 + TypeScript

- Phaser 3, TypeScript, Vite. One class per Scene in `src/scenes/` (Boot, Preload, Menu, Game, UI).
- Load all assets in `PreloadScene`; reference them by constant keys from `src/assets/keys.ts`.
- Game objects extend Phaser classes in `src/objects/`. Keep game rules out of scenes when they grow beyond ~200 lines.
- Use Arcade Physics unless the design needs Matter. Use groups + `setActive/setVisible` pooling for bullets and particles.
- Frame-rate independent movement: multiply by `delta / 1000` in `update`.
- UI runs in a separate parallel scene, communicating via `this.events`/the registry.
- Run `pnpm dev` and describe what to test manually; run `pnpm build` before finishing.
