Make a top-down action game where the player controls a spaceship. Enemy ships…
- User
Make a top-down action game where the player controls a spaceship. Enemy ships constantly spawn at the top and fire slow-moving lasers toward the player. The player can use the arrow keys to dodge and click to shoot lasers at enemies.
Assistant
Now I'll build the game. I'll create a dedicated game component using canvas and a game loop, then wire it into
App.tsx.I need to fix the TypeScript null-check issue for
ctxby using a non-null assertion after the initial guard.Now let's wire this into
App.tsxand update the page title.Now let's build the project to confirm everything compiles correctly.
The build succeeded. Here's a summary of what I built:
Nova Strike — a top-down space action game rendered on an HTML5 canvas with a React UI layer:
- Player ship: Move with Arrow keys or WASD, always aims toward the mouse cursor, and fires glowing laser bolts on click (hold to auto-fire on a cooldown).
- Enemies: Spawn continuously at the top of the screen, descend to a random hover altitude, strafe side-to-side, and periodically fire slow, aimed lasers at the player's position. Spawn rate, enemy speed, and enemy toughness (HP) scale up the longer you survive.
- Combat: Circle-based collision detection between player lasers/enemies, enemy lasers/player, and direct ramming collisions — all with particle explosion effects and screen shake.
- Game feel: Twinkling parallax starfield background, glowing laser trails, engine flame on the player ship, brief invulnerability + blinking after taking damage.
- UI/State: Start screen with instructions, live HUD (score, wave, lives), and a game-over screen with final score/survival time and a restart button. Space/Enter/click also start or restart the game.
Updated
src/App.tsxto render the game and changed the page title inindex.htmlto "Nova Strike — Top-Down Space Shooter". The project builds successfully.Files built:
src/components/NovaStrikeGame.tsx,src/App.tsx,index.html
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.