Skip to content

Repository files navigation

NeonGlide 3D: Synthwave Endless Racer

A 3D retro-synthwave endless racer built from scratch in Python using the Panda3D game engine. The player controls a hover-ship, speeds down a glowing neon grid, dodges red obstacles (by steering or jumping), and collects green energy cells to rack up points and speed.

This project is structured specifically to showcase clean game architecture, low-level engine integration, procedural asset generation, and best practices in Panda3D.


🚀 Visuals & Gameplay Features

  • Endless Procedural Road: Smoothly scrolling road segments that recycle dynamically once they pass the camera view.
  • Dynamic Physics & Steering: Smooth lateral ship movement with inertia interpolation, horizontal banking (roll rotation) while turning, and vertical jumps affected by gravity.
  • Polished Synthwave Atmosphere: Custom ambient and directional lights, fog-of-war depth fade for horizon blending, and emissive neon materials.
  • Responsive DirectGUI UI: Retro-themed Start Menu, Game Over Screen, and live HUD tracking Speed, Distance, and Score.
  • Self-Contained Sound & Textures: A procedural generator compiles all audio (.wav sounds, loops) and textures (.png) programmatically, keeping the repository 100% lightweight and runnable out-of-the-box.

🛠️ Engine Architecture & Concepts Showcased

Hiring teams reviewing this repository will see implementations of key Panda3D and game development patterns:

1. Scene Graph Hierarchy (main.py, player.py, track.py)

  • Standardized scene graph traversal and structure.
  • Separation of game entities onto logical paths (e.g., game_root container which can be cleared or repositioned instantly).
  • NodePath inheritance, transformations, scale manipulations, and visibility controls (show(), hide()).

2. Low-Level Procedural Geometry (player.py, track.py)

  • Renders 3D meshes (the hover ship, obstacles, and diamonds) dynamically in RAM using Panda3D's C++ rendering buffers:
    • GeomVertexFormat defining custom vertex layouts (Position, Normal, Color).
    • GeomVertexData writing data to graphics buffers using GeomVertexWriter.
    • GeomTriangles setting face indices with custom winding orders to leverage GPU backface culling.
  • Eliminates dependency on heavy .bam or .egg asset downloads, keeping the codebase fully self-contained.

3. Collision Subsystem (collision_mgr.py)

  • Implements Panda3D's collision architecture:
    • From Colliders: Active collision bodies (player ship has a CollisionSphere).
    • Into Colliders: Passive collision bodies (barriers have a CollisionBox; cells have a CollisionSphere).
  • Uses collision bitmasks (setFromCollideMask, setIntoCollideMask) to optimize performance and restrict check queries.
  • Utilizes CollisionHandlerEvent with pattern matching (%fn-into-%in mapping to 'player-into-obstacle' and 'player-into-gem') to leverage Panda3D's event loop, keeping collision handling decoupled from frame tick updates.

4. Real-time Task Manager & Key Polling (player.py, main.py)

  • Employs base.taskMgr to hook into the main thread game loop.
  • Uses frame-rate independent calculation (dt = globalClock.getDt()) to compute movement and gravity, ensuring consistency on high-refresh-rate monitors.
  • Employs Key Polling (base.mouseWatcherNode.isButtonDown) rather than keyboard event interrupts for player movement, which provides smooth, fluid player control.

5. Engine Configurations (config.prc)

  • Tailors Panda3D rendering properties globally using a Page Resource Configuration file:
    • Multi-sample anti-aliasing (MSAA) for smooth edges.
    • Window frame metrics (show-frame-rate-meter).
    • Audio mixer parameters (OpenAL driver).

📁 Project Structure

synth_runner/
│
├── config.prc             # Engine settings (antialiasing, window size, title, audio library)
├── main.py                # Main application class (ShowBase), camera, lighting, and game loop
├── game_state.py          # State machine coordinating game phases (MENU, PLAYING, GAMEOVER)
├── player.py              # Procedural 3D hover-ship model, inputs, gravity jump, and visual banking
├── track.py               # Procedural road scroller, obstacle generator, and obstacle recycler
├── collision_mgr.py       # Collision traverser, collision solids, and event handlers
├── ui.py                  # High-tech DirectGUI retro overlays and live gameplay HUD
├── audio_mgr.py           # Audio loader, background music looper, and SFX player
├── gen_assets.py          # Script generating wav audio and textures programmatically
└── README.md              # Documentation (This file)

⚙️ Installation & Running the Game

Prerequisites

Make sure you have Python 3.10+ installed.

1. Install dependencies

Install the required packages (panda3d for the game engine and pillow for texture generation):

pip install -r requirements.txt

(If you don't have a requirements.txt yet, simply run pip install panda3d pillow)

2. Generate the assets

Run the generator script to compile the textures and audio files in your local workspace:

python gen_assets.py

This generates:

  • Sound effects: assets/audio/collect.wav, assets/audio/crash.wav, assets/audio/music.wav
  • Textures: assets/textures/grid.png, assets/textures/starfield.png

3. Run the game

Start the game:

python main.py

🎮 How to Play

  • A / D or Left / Right Arrow: Steer the hover-ship left and right.
  • Spacebar or Up Arrow: Jump over low red barriers.
  • Goal: Collect green energy cells for points and speed boosts while steering clear of red walls and pillars!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages