Skip to content

MuhammadTanveerAbbas/Nebula-Runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Nebula Runner ๐ŸŒŒ Game ๐ŸŽฎ


An Endless runner game featuring advanced physics, power ups, combo system, and particle effects ๐Ÿš€ Built with Next.js 15, TypeScript, Canvas API, and Web Audio API with professional architecture and 60fps performance.


โœจ Features

๐ŸŽฎ Gameplay

  • Endless Runner with procedurally generated obstacles
  • Combo System - Chain dodges for up to 5x score multiplier
  • 3 Power Ups - Shield, Slow Motion, Invincibility
  • Score Boosters - Collect for +25 points (affected by combo)
  • Progressive Difficulty - Dynamic spawn rates and speeds
  • High Score System - Persistent localStorage tracking

๐Ÿช Obstacles

  • Asteroids - Procedurally generated rock shapes
  • Debris - Fast-moving square obstacles
  • Black Holes - Gravity physics that pull your ship

๐ŸŽจ Visual Effects

  • Particle System - 30+ particles on collision/collection
  • Warp Speed Stars - Accelerate based on score
  • Dynamic Animations - Pulsing, rotating, glowing effects
  • Power-Up UI - Real-time progress bars

๐Ÿ”Š Audio

  • Web Audio API - Procedural sound generation
  • 4 Sound Effects - Collect, collision, power up, combo
  • Volume Controls - Separate music and SFX

๐Ÿ—๏ธ Architecture

  • Enterprise-Level Code - Modular, scalable, maintainable
  • TypeScript Strict Mode - Full type safety
  • Custom Hooks - Reusable game engine logic
  • Performance Optimized - 60fps with ref based state
  • Configuration-Driven - All constants eternalized

๐Ÿ› ๏ธ Getting Started

# Clone the repository
git clone https://github.com/MuhammadTanveerAbbas/nebula-runner.git
cd nebula-runner

# Install dependencies
npm install

# Run development server
npm run dev

๐Ÿ“ Project Structure

src/
โ”œโ”€โ”€ lib/game/          # Game engine core
โ”‚   โ”œโ”€โ”€ constants.ts   # Configuration
โ”‚   โ”œโ”€โ”€ types.ts       # TypeScript types
โ”‚   โ”œโ”€โ”€ audio.ts       # Audio manager
โ”‚   โ”œโ”€โ”€ storage.ts     # LocalStorage
โ”‚   โ””โ”€โ”€ utils.ts       # Utilities
โ”œโ”€โ”€ hooks/
โ”‚   โ””โ”€โ”€ useGameEngine.ts  # Game state hook
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ GameCanvas.tsx    # Main game
โ”‚   โ”œโ”€โ”€ Hero.tsx          # Landing page
โ”‚   โ”œโ”€โ”€ CTA.tsx           # Buttons
โ”‚   โ””โ”€โ”€ Stats.tsx         # Statistics
โ””โ”€โ”€ app/
    โ”œโ”€โ”€ page.tsx          # Main page
    โ””โ”€โ”€ layout.tsx        # Root layout

๐ŸŽฏ Game Controls

  • Desktop: Move mouse to control ship
  • Mobile: Touch and drag to control ship
  • Objective: Dodge obstacles, collect power ups, maximize combo

๐Ÿ† Scoring System

  • Dodge Obstacle: +1 point ร— combo multiplier
  • Collect Booster: +25 points ร— combo multiplier
  • Combo Multiplier: +0.5x per dodge (max 5x)
  • Combo Timeout: 3 seconds without dodging

๐Ÿ”ง Configuration

All game parameters are in src/lib/game/constants.ts:

  • Spawn rates
  • Speeds
  • Power up durations
  • Particle counts
  • Audio volumes

๐Ÿ“Š Statistics

The game tracks:

  • High score (persistent)
  • Total games played
  • Average score
  • Stored in localStorage

๐Ÿš€ Performance

  • 60 FPS gameplay
  • < 100ms input latency
  • Optimized collision detection
  • Efficient particle system
  • No memory leaks

๐Ÿงช Tech Stack

  • Next.js 15 - React framework with App Router
  • TypeScript - Type safe development
  • Tailwind CSS - Utility first styling
  • Canvas API - 2D game rendering
  • Web Audio API - Sound generation
  • LocalStorage - Data persistence

๐Ÿ“œ License

MIT License


Made with โค๏ธ by Muhammad Tanveer Abbas

About

Nebula Runner ๐ŸŒŒ Game ๐ŸŽฎ

Topics

Resources

License

Stars

Watchers

Forks

Languages