No description
Find a file
2026-01-31 13:36:06 +01:00
.vscode MongoDB Push and Pull + Makefile 2026-01-31 02:12:24 +01:00
assets Merge new assets and track from origin/main 2026-01-31 13:20:24 +01:00
docs New Models, Fixes and QOS 2026-01-31 12:18:56 +01:00
include Fixes after merge 2026-01-31 13:36:06 +01:00
src Fixes after merge 2026-01-31 13:36:06 +01:00
tools Broken new Code with more cares, Helmets, Better World Gen, Free Ride Mode, Car Selection 2026-01-31 12:15:49 +01:00
.gitignore Merge remote-tracking branch 'origin/dbcon' 2026-01-31 05:04:08 +01:00
BUGS.md Broken new Code with more cares, Helmets, Better World Gen, Free Ride Mode, Car Selection 2026-01-31 12:15:49 +01:00
data.json MongoDB Push and Pull + Makefile 2026-01-31 02:12:24 +01:00
leaderboard.txt New Models, Fixes and QOS 2026-01-31 12:18:56 +01:00
Makefile Fixes after merge 2026-01-31 13:36:06 +01:00
race_data.json New Models, Fixes and QOS 2026-01-31 12:18:56 +01:00
racer Fixes after merge 2026-01-31 13:36:06 +01:00
racer.exe this works on my machine, also added 10 colour vars for each driver 2026-01-31 09:38:42 +01:00
README.md Basic Racer Game 2026-01-30 23:40:09 +01:00
settings.cfg WIP: Phase 4 and Repair system before merge resolution 2026-01-31 13:20:01 +01:00
users.json Fixes after merge 2026-01-31 13:36:06 +01:00
VERIFY_CARS.sh Broken new Code with more cares, Helmets, Better World Gen, Free Ride Mode, Car Selection 2026-01-31 12:15:49 +01:00

RaylibRacer - 3D Racing Game

A simple 3D racing game built with C++ and Raylib.

🎮 How to Build and Run

# Compile the game
make

# Run the game
make run

# Clean build files
make clean

Or simply run:

./racer

🕹️ Controls

  • W / Up Arrow - Accelerate
  • S / Down Arrow - Brake / Reverse
  • A / Left Arrow - Turn Left
  • D / Right Arrow - Turn Right
  • ESC - Quit Game

📁 Project Structure

RaylibRacer/
├── src/           # Source code files
│   └── main.cpp   # Main game code
├── include/       # Header files (for future use)
├── assets/        # Game assets (models, textures, sounds)
├── build/         # Compiled object files
├── Makefile       # Build configuration
└── racer          # Executable (after building)

🚗 What's Currently Implemented

  1. 3D Camera - Follows the car from behind
  2. Simple Car Physics
    • Acceleration and braking
    • Friction/deceleration
    • Speed-based turning
    • Basic momentum
  3. Simple Track - Green ground plane with red boundary markers
  4. UI Elements - Speed display and controls info

🎯 Next Steps to Improve Your Game

Beginner Level:

  1. Change car color - Modify the car's color in main.cpp:131
  2. Add more boundaries - Create walls or cones around the track
  3. Change track size - Modify the ground plane size
  4. Adjust car speed - Change car.maxSpeed value

Intermediate Level:

  1. Load 3D models - Replace the cube car with a real 3D model
  2. Add checkpoints - Create a race lap system
  3. Add a timer - Track race time
  4. Better camera - Add different camera angles
  5. Sound effects - Engine sounds, collision sounds

Advanced Level:

  1. Multiple cars - Add AI opponents
  2. Better physics - Implement proper car physics
  3. Track editor - Design custom tracks
  4. Particle effects - Dust, smoke, sparks
  5. Collision detection - Proper boundaries and walls

📚 Learning Resources

🔧 Understanding the Code

Main Game Loop (main.cpp):

  1. Input (lines 46-63) - Handles keyboard input
  2. Physics (lines 65-82) - Updates car position and velocity
  3. Camera (lines 84-87) - Follows the car
  4. Rendering (lines 90-119) - Draws everything on screen

Key Concepts:

  • Vector3 - Represents 3D positions (x, y, z)
  • deltaTime - Time between frames (for smooth movement)
  • DEG2RAD - Converts degrees to radians for math functions
  • Camera3D - The viewpoint that renders the 3D scene

💡 Tips

  • Start small - add one feature at a time
  • Test frequently - run make run after each change
  • Read Raylib examples - they're very helpful
  • Don't worry about perfection - have fun!

Happy racing! 🏎️