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
- Pre-match selection screen and reset
- Open your terminal (Command Prompt, PowerShell, or your preferred terminal).
- Navigate to the folder where you'd like to store the project.
- Run the following command to clone the repository:
git clone https://github.com/TheRickyZhang/BattleBeyz
- Open PowerShell as Administrator.
- Clone the
vcpkg
repository:git clone https://github.com/microsoft/vcpkg.git C:\vcpkg cd C:\vcpkg
- Run the bootstrap script to build vcpkg:
.\bootstrap-vcpkg.bat
- Add
vcpkg
to your system'sPATH
temporarily:For permanent access, update your environment variables in System Settings.$env:PATH += ";C:\vcpkg"
- Open a terminal.
- Clone the
vcpkg
repository:git clone https://github.com/microsoft/vcpkg.git ~/vcpkg cd ~/vcpkg
- Run the bootstrap script to build vcpkg:
./bootstrap-vcpkg.sh
- Add
vcpkg
to yourPATH
by appending this line to your shell configuration file (~/.bashrc
or~/.zshrc
):export PATH=$PATH:~/vcpkg
Make vcpkg's toolchain file available to CMake.
vcpkg integrate install
vcpkg install glfw3:x64-windows-static
vcpkg install glew:x64-windows-static
vcpkg install freetype:x64-windows-static
vcpkg install zlib:x64-windows-static
vcpkg install glm:x64-windows-static
For Mac/Linux users:
- Replace
x64-windows-static
withx64-osx
orx64-linux
. - Install system dependencies for OpenGL and GLFW (if not handled by vcpkg):
sudo apt install libglfw3-dev libglew-dev freeglut3-dev zlib1g-dev
If you prefer to use dynamic libraries, simply omit the -static
from the above commands.
The project already includes prebuilt libraries (ImGui, stb, tinyobjloader). However, if they are missing for some reason and need to rebuilt from scracth, you can execute the following.
cd lib
# ImGui
curl -LO https://github.com/ocornut/imgui/archive/refs/tags/v1.90.8.zip
unzip v1.90.8.zip
# stb
curl -LO https://github.com/nothings/stb/archive/refs/tags/v0.8.zip
unzip v0.8.zip
# tinyobjloader
curl -O https://raw.githubusercontent.com/tinyobjloader/tinyobjloader/release/tiny_obj_loader.h
After installation, your project structure should have these at minimum: (remember that /vcpkg should be installed in your root!)
Project Root/
├── src/ # Source files
├── lib/ # Local libraries (ImGui, stb, tinyobjloader)
│ ├── imgui-1.90.8/
│ ├── stb/
│ ├── tiny_obj_loader.h
├── assets/ # Game assets (textures, models, etc.)
├── build/ # Build files (generated by CMake)
└── CMakeLists.txt # CMake build file
Make sure your CMakeLists.txt
file points to the correct locations for vcpkg and libraries. The current version should be correct, but ensure you modify it if vcpkg is located elsewhere.
set(CMAKE_TOOLCHAIN_FILE "C:/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file")
set(CMAKE_PREFIX_PATH "C:/vcpkg/installed/x64-windows-static" CACHE PATH "Path to vcpkg installed packages")
Run CMake to generate the Visual Studio solution and project files:
cmake -S . -B build
- Open Visual Studio 2022, and either:
- Select File -> Open -> Project/Solution, then click
BattleBeyz.sln
, located in /build - Right click
BattleBeyz.sln
and open with Visual Studio
- Select File -> Open -> Project/Solution, then click
- Choose the desired build configuration:
- Debug for development and debugging. (Preferred for development)
- Release for optimized performance.
- Run the application with
Ctrl+F5
or debug it withF5
.