Skip to content

StarchyBomb/browser-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🕹️ browser-engine

Web games that are actually playable — not screensavers with a score counter

walk-through rocks collision fps dims physics

Ask an AI for a browser game and you get a rock you walk straight through, a "wall" that's just wallpaper, movement that runs double-speed on a gaming monitor, and 60fps that dies the moment three enemies spawn. It looks like a game. It plays like a screensaver.

browser-engine is a Claude Code plugin that builds the other 80% — the part that makes a game a game. It knows the real constraints of web game dev and how to beat them, in 2D and 3D.

browser-engine: ghost rock you walk through vs a real solid body — slide the line

the bug it exists to kill

You asked for a rock. You got a picture of a rock.

👻 what AI ships 🕹️ browser-engine
a "solid" rock drawImage(rock) — no body, walk right through sprite + collider, wired + seen in the debug overlay
top-down tree whole sprite solid → invisible wall around the leaves footprint hitbox at the trunk; you walk behind the canopy
fast bullet phases through thin walls (tunneling) swept / raycast — can't skip a collider
movement x += 5 — 2× speed at 144Hz, half under load fixed timestep — identical on every machine
200 enemies O(n²), slideshow spatial grid + object pool, holds 60fps
"physics" one if that half-works axis-separated resolution: slide along walls, don't stick

the three laws

  1. If it looks solid, it IS solid — or it doesn't exist. Every blocker owns a collision body you can see in the debug overlay. Drawing a thing is not making a thing.
  2. Simulate on a clock, not a frame. Movement advances by time, never "per frame drawn." The renderer's speed never changes the game's speed.
  3. Never allocate in the loop. Bullets, particles, enemies — all pooled. Steady state makes zero garbage.

what's inside

Five skills that load when you're building a game — plus drop-in tools, not just docs:

  • browser-engine — the router. Genre → collision model → stack (Phaser 4 for 2D, Three.js/Babylon + Rapier for 3D), the web's real constraints (tab throttling, rAF, one thread, GC, DPR), and what "playable" means (input buffering, coyote time, game feel).
  • brainstorm-game-design — design the concept before code (pillars, core loop, hook, scope) and write it to game-design/GDD.md in your project. Ships scaffold-design-memory.mjs — one command sets up the memory + every agent's loader.
  • brainstorm-level-design — design levels from the game's own pillars (teach → test → twist, difficulty curve, honoring the collision model), persisted to game-design/levels/.
  • game-collision — the heart. sprite≠body rule, footprint hitboxes, tilemap collision layers, y-sort depth, axis-separated resolution, anti-tunneling. Ships collision-debug.js (see every hitbox) and aabb-resolver.js (correct swept, axis-separated, broad-phased resolution).
  • game-optimization — 60fps under load. Ships game-loop.js (fixed-timestep accumulator) and object-pool.js (zero-GC spawning); covers batching, atlases, spatial partitioning, and profiling.

design memory — the AI never loses the thread

Agents forget (Antigravity resets every session; Claude & Cursor start blind). So when you come back and say "add the next level," they reinvent instead of continue. The brainstorm modes fix this by writing every decision into your game project — a single source of truth that travels with the repo:

your-game/
├── AGENTS.md                 # the universal loader — Claude, Cursor, Antigravity, Copilot… all read it
├── game-design/
│   ├── GDD.md                # the source of truth
│   ├── decisions.md          # dated log
│   └── levels/<name>.md
├── CLAUDE.md   → @AGENTS.md
└── .cursor/rules/game-design.mdc

One command scaffolds it (idempotent):

node <plugin>/skills/brainstorm-game-design/tools/scaffold-design-memory.mjs --name "My Game"

works in every leading agent

Built on the Agent Skills open standard, anchored by AGENTS.md (Linux Foundation) — read natively by Claude Code, Cursor, Antigravity, Copilot, Codex, Gemini CLI, Windsurf, Zed. One source of truth, thin per-agent pointers, zero maintenance tax. Full guide: INSTALL.md.

Summon

Claude Code

/plugin marketplace add StarchyBomb/browser-engine
/plugin install browser-engine@browser-engine

Codex / ChatGPT

This repo is also a Codex plugin. Install it from a local clone:

codex plugin add ./browser-engine

Or copy the skill folders into your Codex skills directory:

cp -R skills/* ~/.codex/skills/

Codex reads .codex-plugin/plugin.json and loads the bundled skills from ./skills/. Invoke them by name: $browser-engine, $game-collision, $game-optimization, $brainstorm-game-design, $brainstorm-level-design. The drop-in tools (.js / .mjs) are framework-agnostic and work the same regardless of agent.

Then ask your agent to build any browser game. It will build collision before art, and you'll be able to see every hitbox.

not just prompts

skills/game-collision/tools/ and skills/game-optimization/tools/ are real, framework-agnostic ES modules you can drop into a raw-canvas game today — a collision debug overlay, a correct swept-AABB resolver with grid broad-phase, a fixed-timestep loop, and a generic object pool. Each one also tells you how to wire the same idea in Phaser / Rapier / Three instead of reinventing it.

License

MIT — build something you can't walk through. 🕹️

About

Build browser games that are actually playable — real collision (not sprites you walk through), 60fps, 2D+3D. Brainstorm game+level design into a project memory every agent (Claude, Cursor, Antigravity) reloads.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages