$npx -y skills add majidmanzarpour/threejs-game-skills --skill threejs-gameplay-systemsBuild and iterate playable Three.js game systems. Combines starter scaffold creation, architecture, game design, level design, gameplay implementation, combat/encounter design, and game-feel tuning (hitstop, screenshake, easing, impact feedback). Use for first playable slices, ne
| 1 | # Three.js Gameplay Systems |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | Create or evolve a playable browser game loop with clear ownership, responsive controls, deterministic update order, strong design intent, playable spaces, and verified player-facing behavior. |
| 6 | |
| 7 | ## Use When |
| 8 | |
| 9 | Starting a new game, repairing a weak prototype, adding mechanics/entities, designing architecture, defining a game design brief, planning levels/arenas/tracks/waves/holes/puzzles, tuning camera/controls, implementing rules/objectives, building encounters, or improving game feel. |
| 10 | |
| 11 | ## Workflow |
| 12 | |
| 13 | Load `references/gameplay-workflows.md` as the first action when the task includes first playable setup, architecture, mechanics, entities, input, camera, collision/physics, scoring, objectives, feedback, or feel tuning. |
| 14 | |
| 15 | Load `references/game-design-level-design.md` before broad new-game creation, major gameplay changes, level/arena/track/wave/hole/puzzle design, combat/encounter design, progression/difficulty work, or any claim that gameplay is premium, polished, complete, or less generic. |
| 16 | |
| 17 | Load `references/physics-engine-selection.md` before adding or changing physics, collision-heavy gameplay, vehicle movement, rolling balls, mini-golf, pool/snooker, pinball, rigid-body puzzles, character controllers, sensors, high-speed projectiles, moving platforms, or physics QA. |
| 18 | |
| 19 | Load `references/game-feel.md` before feel/juice/impact tuning, or before claiming gameplay is premium or polished. Track every loaded reference in a reference ledger with yes/no, path, and failure reason. Do not mark the gameplay phase complete while a required reference is skipped. |
| 20 | |
| 21 | Load `references/checklists/new-game-definition-of-done.md` before claiming a new game or first playable slice is complete. |
| 22 | |
| 23 | Load `references/checklists/game-design-level-design.md` before claiming a new game, major gameplay upgrade, level/encounter pass, premium gameplay, or polished gameplay is complete. |
| 24 | |
| 25 | Load `references/checklists/game-feel.md` before claiming feel/impact tuning or premium gameplay is complete. |
| 26 | |
| 27 | Load `references/checklists/endless-runner-premium-quality.md` for endless runner work. |
| 28 | |
| 29 | Load `references/prompt-templates.md` only when the user asks for reusable prompts, starter prompts, or a task template. |
| 30 | |
| 31 | Load `threejs-audio-generator` when implementing real SFX, ambience, UI sounds, voice/TTS, or audio cleanup beyond simple placeholder hooks. Gameplay code should emit audio events; the audio skill should generate or process the actual assets and define the runtime audio matrix. |
| 32 | |
| 33 | 1. Inspect project structure, scripts, dependencies, current loop, input, camera, entities, state, UI, and diagnostics. |
| 34 | 2. Write the compact game design brief: player promise, target feeling, primary verb, objective, pressure, reward, fail/retry, skill expression, non-goals. |
| 35 | 3. Define the core loop contract: verb, objective, pressure, reward/progression, fail/retry. |
| 36 | 4. Define the level/encounter plan before implementation: start, first decision, first threat, first reward, landmarks, escalation, recovery beats, readability, and tuning knobs. |
| 37 | 5. Choose small architecture boundaries: `core`, `game`, `entities`, `systems`, `assets`, `ui`, `tests`. |
| 38 | 6. Implement mechanics in playable increments: input, state, entity, collision/physics, feedback, HUD/audio hook, diagnostics. |
| 39 | 7. Tune feel with `references/game-feel.md`: movement, acceleration, camera follow/FOV/shake, hitstop, impact feedback, cooldowns, difficulty, restart loop. |
| 40 | 8. Keep hot paths allocation-light and update order explicit. |
| 41 | 9. Verify with build, browser, screenshot, canvas pixels, console/page errors, and one real input path. |
| 42 | |
| 43 | ## Packaged Scaffold |
| 44 | |
| 45 | Use the bundled scaffold when starting a new project or when the user asks for a starter game: |
| 46 | |
| 47 | ```bash |
| 48 | python3 <this-skill-dir>/scripts/create_threejs_game.py ./my-game |
| 49 | ``` |
| 50 | |
| 51 | The script copies `assets/threejs-vite-game/`, rewrites the project name in `package.json` and `package-lock.json`, and keeps generated games self-contained with their own visual test and canvas-inspection script. Use `--force` only when the target directory may be overwritten. |
| 52 | |
| 53 | ## Library Guidance |
| 54 | |
| 55 | - Use TypeScript, Vite, Three.js modules. |
| 56 | - Physics/collision engine choice (custom collision vs Rapier vs cannon-es), timestep, and collider strategy: follow `references/physics-engine-selection.md`. |
| 57 | - `lil-gui` for live-tuned constants when useful. |
| 58 | - Web Audio for ru |