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.
- 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
- Asteroids - Procedurally generated rock shapes
- Debris - Fast-moving square obstacles
- Black Holes - Gravity physics that pull your ship
- 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
- Web Audio API - Procedural sound generation
- 4 Sound Effects - Collect, collision, power up, combo
- Volume Controls - Separate music and SFX
- 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
# Clone the repository
git clone https://github.com/MuhammadTanveerAbbas/nebula-runner.git
cd nebula-runner
# Install dependencies
npm install
# Run development server
npm run devsrc/
โโโ 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
- Desktop: Move mouse to control ship
- Mobile: Touch and drag to control ship
- Objective: Dodge obstacles, collect power ups, maximize combo
- 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
All game parameters are in src/lib/game/constants.ts:
- Spawn rates
- Speeds
- Power up durations
- Particle counts
- Audio volumes
The game tracks:
- High score (persistent)
- Total games played
- Average score
- Stored in localStorage
- 60 FPS gameplay
- < 100ms input latency
- Optimized collision detection
- Efficient particle system
- No memory leaks
- 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
MIT License
Made with โค๏ธ by Muhammad Tanveer Abbas