Skip to content

A high-speed sci-fi racing game built with React, Three.js, and Tailwind CSS. Inspired by F-Zero.

Notifications You must be signed in to change notification settings

EdwardAThomson/Nebula-Rush

Repository files navigation

Nebula Rush (Sci-Fi Racing Game)

High-speed anti-gravity racing inspired by F-Zero and Wipeout.

Overview

Nebula Rush is a high-speed 3D racing game built directly in the browser using modern web technologies. You pilot an anti-gravity ship through a series of tracks and compete against 19 AI opponents to top the leaderboard.

This project demonstrates a custom physics engine, procedural mesh generation, and performant 3D rendering with Three.js.

YouTube dev videos

I originally started building this game for free using Claude in the web browser. The free version of the model seems to be inhibited, so I eventually took it to my IDE. The first version was pretty rough!

Screenshot

Features

  • High-Speed Anti-Gravity Physics: specialized handling model featuring hovering, banking, drifting, and air-braking.
  • Procedural Track Generation:
    • Complex 3D spline-based tracks with loops, banked turns, and verticality.
    • Multiple unique tracks: The Awakening, Nebula Complex, Hyperion Raceway.
    • Dynamic mesh generation for track surfaces and walls.
  • Campaign Mode:
    • Multi-race championship with cumulative points.
    • Unlockable tracks (planned).
  • Ship & Pilot Selection:
    • 3 Ship Classes: Speedster (Fast), Fighter (Balanced), Tank (Heavy Grip).
    • 8 Unique Pilots: Generated avatars with unique modifiers for Acceleration, Handling, and Velocity.
  • Dynamic Environments:
    • Day/Night cycles and Weather effects (Rain/Snow/Fog) that affect visibility.
    • Runtime environment selection for testing.
  • 19 Opponent AI: Competitive AI agents that race alongside you, complete with lane-switching logic.
  • Combat & Speed mechanics:
    • Boost Pads: Drivers must hit energized zones for speed bursts.
    • Strafing: dedicated side-thrusters for tight cornering.
    • Jumping: Vertical thrusters to hop over obstacles or cut corners.
  • Full Race Loop:
    • Start sequence with functional traffic lights.
    • 5-Lap races with lap timing.
    • Post-race leaderboard tracking rank and points.
  • Dynamic Camera: Smart camera system that prevents motion sickness while maintaining the sensation of extreme speed.
  • Minimap: Real-time track position visualization.
  • Debug Tools:
    • Track Analysis for gradient/curvature.
    • Lighting Playground (Dev only).

Controls

Action Primary Key Secondary Key
Accelerate W Arrow Up
Steer Left/Right Q / E /
Strafe (Side Thrust) A / D -
Jump Space S /
Screenshot P -
Toggle HUD H -
Cheat: Instant Win F -
Cheat: Finish Opponents G -

Pro Tip: Combine Steer and Strafe to drift through tight corners without losing speed!

Tech Stack

Architecture

  • src/App.tsx: Main UI router (Start, Selection Screens, Game).
  • src/components/Game.tsx: Main entry point for the 3D scene. Handles the race state machine (intro, racing, finished, results), game loop, and rendering coordination.
  • src/game/PhysicsEngine.ts: Core physics simulation. Calculates velocity, friction, hover suspension, and collision response. State is detached from Three.js objects for stability.
  • src/game/TrackFactory.ts: Procedural content generation. Uses Catmull-Rom splines to generate the race track geometry and placement of game elements (boost pads, start line).
  • src/game/OpponentManager.ts: Manages entity lifecycle for AI opponents and their simple steering behaviors.
  • src/game/EnvironmentManager.ts: Controls lighting, skybox, and weather effects.

Getting Started

  1. Install dependencies:

    npm install
  2. Start the development server:

    npm run dev
  3. Build for production:

    npm run build

About

A high-speed sci-fi racing game built with React, Three.js, and Tailwind CSS. Inspired by F-Zero.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages