Home
Softono
Nebula-Runner-Game

Nebula-Runner-Game

Open source MIT TypeScript
11
Stars
0
Forks
0
Issues
0
Watchers
1 month
Last Commit

About Nebula-Runner-Game

A browser-based endless space runner dodge asteroids, collect orbs, and survive the void.

Platforms

Web Self-hosted

Languages

TypeScript
Nebula Runner Logo

Nebula Runner

A browser-based endless space runner dodge asteroids, collect orbs, and survive the void

Live Demo License TypeScript React Next.js Tailwind CSS


Nebula Runner

Overview

Nebula Runner is a fully browser-based endless space runner built with Next.js 15 and the HTML5 Canvas API no backend, no sign-up, no configuration required. It runs entirely offline with all game state persisted to localStorage. Unlike Flash-era games or heavy Unity WebGL exports, it loads instantly and plays at 60fps on any modern browser, including mobile.


โœจ Features

  • ๐Ÿš€ Physics-based ship movement smooth velocity and tilt with mouse, touch, and D-pad controls
  • ๐ŸŽฏ 4 escalating difficulty tiers EASY โ†’ MEDIUM โ†’ HARD โ†’ INSANE, each unlocking new obstacle types
  • ๐Ÿ’ฅ Combo multiplier system chain orb collections for up to 5ร— score multiplier
  • ๐Ÿ›ก๏ธ Power-ups Shield, Slow Motion, and Invincibility with expiry warnings
  • โ˜„๏ธ Asteroid split mechanic near-misses at MEDIUM+ have a 25% chance to fracture asteroids
  • ๐ŸŒ€ Black holes accretion disk visuals and gravitational lensing effects
  • โšก Laser beam obstacles 1.5s warning phase followed by a 2s active kill zone (HARD+)
  • ๐ŸŽ๏ธ Speed zones entering one doubles ship speed for 3 seconds (INSANE)
  • ๐ŸŒŸ 3-layer parallax star field warp-speed motion blur kicks in above score 200
  • ๐ŸŽต Procedural audio 13 distinct sounds synthesized via Web Audio API, zero audio files
  • ๐Ÿ† Achievement system unlockable achievements persisted to localStorage
  • ๐Ÿ“ฑ Mobile D-pad 60fps continuous movement with diagonal support via held directions
  • ๐Ÿ’ซ Particle effects collision burst, orb collection spiral, thruster exhaust
  • ๐Ÿ“ณ Screen shake on collision with linear decay

๐Ÿ›  Tech Stack

Category Technology
Framework Next.js 15 (App Router + Turbopack)
UI React 18 + TypeScript 5
Styling Tailwind CSS v3 + shadcn/ui
Game Rendering HTML5 Canvas API
Audio Web Audio API (procedural synthesis)
Persistence localStorage
Deployment Vercel

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • pnpm (npm install -g pnpm)

Installation

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

# 2. Install dependencies
pnpm install

# 3. Run the development server
pnpm dev

# 4. Open in browser
# http://localhost:3000

๐Ÿ” Environment Variables

No environment variables are required. The game runs fully offline with zero configuration.

If you want to add optional deployment or analytics integrations, create a .env.local file:

# Deployment (optional)
NEXT_PUBLIC_APP_URL=https://your-domain.com

# Analytics (optional)
NEXT_PUBLIC_ANALYTICS_ID=your-analytics-id

๐Ÿ“ Project Structure

nebula-runner/
โ”œโ”€โ”€ public/              # Static assets (favicon, robots.txt)
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/             # Next.js App Router (layout, page, sitemap)
โ”‚   โ”œโ”€โ”€ components/      # UI + game components (GameCanvas, MobileControls, etc.)
โ”‚   โ”‚   โ””โ”€โ”€ ui/          # shadcn/ui primitives
โ”‚   โ”œโ”€โ”€ hooks/           # Custom React hooks (useGameEngine, use-mobile)
โ”‚   โ””โ”€โ”€ lib/
โ”‚       โ””โ”€โ”€ game/        # Core game engine (audio, constants, types, utils)
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ README.md

๐Ÿ“ฆ Available Scripts

Command Description
pnpm dev Start development server with Turbopack
pnpm build Build for production
pnpm start Start production server
pnpm lint Run ESLint
pnpm typecheck TypeScript type check

๐ŸŽฎ Game Controls

Input Action
Mouse move Aim ship
Touch drag Aim ship
Space / Escape Pause / Resume
Mobile D-pad (bottom-right) Move ship in 4 directions

๐ŸŒ Deployment

This project is deployed on Vercel.

Deploy Your Own

Deploy with Vercel

  1. Click the button above
  2. Connect your GitHub account
  3. Deploy no environment variables needed

๐Ÿ—บ Roadmap

  • [x] Physics-based ship movement
  • [x] 4 difficulty tiers with unique obstacles
  • [x] Combo multiplier system
  • [x] Power-ups (Shield, Slow Motion, Invincibility)
  • [x] Procedural Web Audio synthesis
  • [x] Achievement system with localStorage persistence
  • [x] Mobile D-pad with 60fps continuous movement
  • [ ] Global leaderboard
  • [ ] Additional power-up types
  • [ ] Unlockable ship skins

๐Ÿค Contributing

Contributions are welcome! Feel free to:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

Distributed under the MIT License. See LICENSE for more information.


๐Ÿ‘จโ€๐Ÿ’ป Built by The MVP Guy

Muhammad Tanveer Abbas SaaS Developer | Building production-ready MVPs in 14โ€“21 days

Portfolio Twitter LinkedIn GitHub

If this project helped you, please consider giving it a โญ