Skip to content

About

2d game

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Rocket Battle

🚀 Rocket Battle

Two players. One screen. No mercy.

A local multiplayer space shooter built with Next.js and PixiJS. Two players share the same keyboard and battle it out in space — dodge, aim, and destroy your opponent's rocket.

You can play the game and see how it works here: https://rocket-battle.vercel.app


Gameplay


Gameplay

  • Health system — each rocket starts at 100 HP, bullets deal damage on hit
  • Wrap-around movement — fly off one edge and reappear on the opposite side
  • Countdown start — 3-2-1-GO! before each round, no shooting early
  • Animated background — planets drift slowly across the space battlefield

Controls

Action 🔴 Player 1 🔵 Player 2
Rotate A / D ← / →
Thrust W ↑
Brake S ↓
Fire F Space

Tech Stack

Framework Next.js 14 (App Router)
Rendering PixiJS 7 + @pixi/react
Styling Tailwind CSS
Language TypeScript

Getting Started

npm install
npm run dev

Open http://localhost:3000 — the main menu will appear. Click Press Start to play.


Project Structure

src/
├── app/                    # Next.js pages
│   ├── page.tsx            # Main menu
│   └── offlinegame/        # Game page
├── widgets/
│   └── game-canvas/        # Main game canvas & loop orchestration
├── features/
│   ├── game-loop/          # Per-player RAF game loop
│   └── keyboard-controls/  # Keyboard input (e.code based)
├── entities/
│   ├── rocket/             # Rocket model + PIXI view
│   └── bullet/             # Bullet model + PIXI view
└── shared/
    ├── constants/          # Canvas size fallback constants
    └── ui/                 # HealthBar component

About

2d game

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages