A first-person 3D obstacle course game built with C++ and OpenGL.
- OpenGL
- GLFW3 (Graphics Library Framework)
- FreeType (Font rendering)
- CMake (build system)
sudo apt-get install libglfw3-dev libfreetype-dev libgl1-mesa-dev libglu1-mesa-dev cmake build-essentialsudo dnf install glfw-devel freetype-devel mesa-libGL-devel mesa-libGLU-devel cmake gcc-c++sudo pacman -S glfw freetype2 mesa glu cmake base-develbrew install glfw freetype cmakeRun the included setup script that handles everything automatically:
generate_vs.batThis script will:
- Install vcpkg (if not already installed) to
C:\vcpkg - Install required dependencies (glfw3, freetype)
- Generate a Visual Studio 2022 solution
Prerequisites:
- Git
- CMake (add to PATH during installation)
- Visual Studio 2022 with "Desktop development with C++" workload
-
Install vcpkg:
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg cd C:\vcpkg bootstrap-vcpkg.bat -
Set environment variable:
setx VCPKG_ROOT "C:\vcpkg"
-
Install dependencies:
vcpkg install glfw3:x64-windows freetype:x64-windows vcpkg integrate install
-
Generate Visual Studio solution:
mkdir build_vs cd build_vs cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake ..
-
Open
build_vs\cpp_3d_jump.slnin Visual Studio
Note: The first build requires an internet connection to download miniaudio.h (~1MB). This is done automatically by CMake. Subsequent builds work offline.
mkdir build
cd build
cmake ..
makeAfter running generate_vs.bat or manual setup:
- Open
build_vs\cpp_3d_jump.slnin Visual Studio - Select Debug or Release configuration
- Press F5 to build and run (or Ctrl+F5 to run without debugging)
The working directory is automatically set to the project root, so assets will be found correctly.
./cpp_3d_jumpRun from Visual Studio (F5) or execute build_vs\Debug\cpp_3d_jump.exe (make sure to run from project root directory for assets to load).
- W/A/S/D: Move forward/left/backward/right
- Mouse: Look around
- Space: Jump
- Shift: Crouch (hold to duck under low obstacles)
- ESC: Exit
- 3D grid rendering
- First-person camera control
- Mouse look (captured cursor)
- WASD movement
- Jump mechanics with gravity
- Crouching (Shift key)
- Jump and run obstacle course with:
- Barriers to jump over
- Walls to navigate around
- Low tunnels to crouch through
- Narrow passages
- Collision detection
- Fullscreen window
The popup notification sound can be customized in src/Menu.cpp in the generatePopupSound() function:
- frequency: Any value in Hz works. Recommended range: 200-2000 Hz
- 261.63 Hz = C4 (Middle C)
- 440.00 Hz = A4 (Concert pitch)
- 523.25 Hz = C5
- 659.25 Hz = E5
- 880.00 Hz = A5
- 1046.50 Hz = C6
- duration: Length in milliseconds (50-200 recommended for a short blip)
The sound is generated as a sine wave with harmonics and an envelope for a pleasant "blob" effect.
- The code uses legacy OpenGL (immediate mode) for simplicity
- Camera is implemented using manual matrix transformations
- Audio is handled by miniaudio (single-header library, downloaded automatically on first build)
This project uses the following external library that is downloaded automatically during the first build:
| Library | Purpose | License |
|---|---|---|
| miniaudio | Cross-platform audio | Public Domain / MIT-0 |
- implement server side time saving for leader board (database and api prob)
- fix I hate my self difficulty (just spam space and run forward to complete, no kind of difficulty if exploit is known)
- add crouching, wallriding and double jump obsticales that work
- sprint ability with storing velocity for further jumps if jumped while sprint