BattleBeyz is the first 3D Beyblade game with accurate spinning top physics.
I also wanted to learn from the process of creating a game from scratch, so everything is written in C++ (OpenGL / ImGui) with no physics libraries. Any collaboration or feedback is welcome!
- Centralized Game Engine and States
- Realistic Beyblade Physics
- JSON-style saving and loading
- Profile and Input Manager
- 3D Camera Control and Rendering
- Texture, Mesh, Lighting/Shading
- Logging and Debug Mode
- Mesh import (.obj), loaded off the main thread
- Pre-match screen: drag beyblades into place, set spin, launch
- Fixed-timestep physics with interpolated rendering
- Round-end logic and rematch
- Opposite-spin collision modelling
git clone https://github.com/TheRickyZhang/BattleBeyz
cd BattleBeyzAll dependencies are downloaded and built by CMake. Only Linux needs system packages, and only because GLFW links against the display server libraries.
No additional system dependencies required.
brew install cmakesudo apt install build-essential cmake pkg-config libgl1-mesa-dev \
libwayland-dev libxkbcommon-dev libx11-dev libxrandr-dev \
libxinerama-dev libxcursor-dev libxi-devsudo pacman -S base-devel cmake wayland libxkbcommon \
libx11 libxrandr libxinerama libxcursor libxicmake -S . -B build
cmake --build build -j$(nproc)The first build will take longer as CMake downloads dependencies (GLFW, GLEW, GLM, ImGui, etc.).
./build/BattleBeyz- Open
build/BattleBeyz.slnin Visual Studio 2022 - Choose Debug or Release configuration
- Run with
Ctrl+F5or debug withF5
.\build\Debug\BattleBeyz.exe
# or
.\build\Release\BattleBeyz.exeBattleBeyz/
├── src/ # Source files
├── tests/ # Unit tests (doctest)
├── assets/ # Game assets (textures, models, etc.)
├── build/ # Build files (generated by CMake)
└── CMakeLists.txt # CMake build configuration
Unit tests cover the units system and the physics that does not need a GL context. They are built by default alongside the game.
cd build && ctest --output-on-failure
# Or run the binary directly for per-case output
./build/battlebeyz_testsConfigure with -DBATTLEBEYZ_BUILD_TESTS=OFF to skip them.
The following libraries are automatically fetched by CMake during configuration:
- GLFW - Window and input handling
- GLEW - OpenGL extension loading
- GLM - Mathematics library
- Dear ImGui - Immediate mode GUI
- ImGuiFileDialog - File dialog for ImGui
- nlohmann/json - JSON parsing
- stb - Image loading
- tinyobjloader - OBJ model loading
- FreeType - Font rasterisation
- doctest - Unit test framework
