threejs-gameplay-systems

Builds and iterates playable Three.js browser games with design briefs, physics, and game-feel tuning.

1|Updated Aug 20, 2023
One-click install
npx skills add https://github.com/imanlangaran/mini-projects --skill threejs-gameplay-systems-imanlangaran
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-gameplay-systems
Source: https://github.com/imanlangaran/mini-projects/tree/main/building-sell/.claude/skills/threejs-gameplay-systems
Command: npx skills add https://github.com/imanlangaran/mini-projects --skill threejs-gameplay-systems-imanlangaran

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? Turning a Three.js scene into an actual playable game requires coordinated work across architecture, input, physics, level design, and game feel, and prototypes often end up as static demos with mechanics bolted on afterward. This Skill enforces a design-first workflow that produces a verified playable loop instead of a decorative scene. ## Core Features & Use Cases - Scaffolded Game Creation: Generates a self-contained Vite + TypeScript + Three.js starter game via a bundled script, complete with HUD, touch controls, Playwright visual tests, and a canvas-inspection tool. - Design-First Workflow: Requires a game design brief, core loop contract, and level/encounter plan before implementation, with checklists gating any claim that gameplay is complete or polished. - Physics and Game Feel Guidance: Provides decision rules for custom collision vs Rapier vs cannon-es, plus copy-pasteable code for hitstop, trauma-based screenshake, squash-and-stretch, FOV punch, and deterministic seeded randomness. - Use Case: Ask for a new endless runner or mini-golf prototype; the Skill scaffolds the project, defines the core loop and level plan, implements input/entities/collision/HUD, tunes feel, and verifies with build, browser run, screenshots, and canvas pixel checks. ## Quick Start Ask the AI to use the threejs-gameplay-systems skill to create a new playable Three.js game in a folder named my-game and verify it runs in the browser.

Frequently Asked Questions about threejs-gameplay-systems

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new Three.js game with Vite and TypeScript?

Run the bundled script with python3 scripts/create_threejs_game.py followed by your target directory. It copies the packaged Vite + TypeScript + Three.js scaffold, rewrites the project name in package.json, and includes Playwright visual tests and a canvas inspection script.

Which physics engine should I use for a Three.js browser game?

Use custom collision for arcade triggers and simple overlap tests, Rapier for rigid bodies, balls, ramps, sensors, and high-speed collisions, and cannon-es as a lightweight JS fallback for small scenes. Rapier is the default for serious browser-game physics.

How do I add hitstop and screenshake to a Three.js game?

Scale only the gameplay delta for hitstop while camera, tweens, and HUD keep the real delta, and use trauma-based screenshake where shake equals trauma squared with linear decay and a hard cap. The game-feel reference provides copy-pasteable TypeScript implementations.

Does the scaffold support mobile touch controls?

Yes, the bundled scaffold includes a touch joystick and dash button in its HTML, and its Playwright config runs an iPhone 13 mobile project alongside desktop Chrome. Input is converted into game intents separate from simulation.

Why does my Three.js prototype feel like a static scene instead of a game?

A playable loop requires real input mapped to a primary verb, a visible objective, pressure, reward that changes game state, and a fast fail/retry path. The Skill rejects slices that cannot be controlled or restarted and requires verification through one real input path.

How is randomness handled for deterministic Three.js game testing?

All gameplay and effect randomness routes through a seeded createSeededRandom utility instead of Math.random, and time-based effects use accumulated game time rather than wall clock. This keeps seed and reduced-motion test hooks reproducible for visual baselines.