A C++ brick breaker/breakout game built with raylib - a simple and easy-to-use library for game development.
Stupid Brick Breaker is a classic brick breaker game where you control a paddle to bounce a ball and destroy bricks on the screen. Try to clear all the bricks and achieve the highest score!
Before building the game, make sure you have the following installed:
- Xcode Command Line Tools - Required for compilation
xcode-select --install
- CMake (version 3.10 or higher)
brew install cmake
- raylib - Graphics library
brew install raylib
sudo apt-get install build-essential cmake libraylib-dev- Visual Studio or MinGW with C++ development tools
- CMake from https://cmake.org/download/
- raylib from https://github.com/raysan5/raylib/releases or through package managers
git clone <your-repo-url>
cd Stupid-Brick-Breaker-
Create a build directory:
mkdir build cd build -
Configure the project:
cmake ..
-
Build the executable:
make
Or on Windows with Visual Studio:
cmake --build . --config Release
After building, run the executable:
macOS/Linux:
./Untitled_GameWindows:
Untitled_Game.exeOr from the build directory:
./build/Untitled_GameStupid-Brick-Breaker/
├── CMakeLists.txt # CMake build configuration
├── main.cpp # Main game source code
├── raylib-cpp/ # raylib C++ wrapper library
└── build/ # Build output directory (created after building)
- Mouse: Move your paddle across the bottom of the screen
- Game Menu: Click buttons to start or navigate
- Pause: Press the pause button during gameplay
Make sure raylib is properly installed:
- macOS:
brew install raylib - Linux:
sudo apt-get install libraylib-dev - Windows: Download from https://github.com/raysan5/raylib
On macOS, if using Homebrew, raylib is typically installed in /opt/homebrew/opt/raylib/. The CMakeLists.txt is configured to look there by default.
If the game crashes with exit code 139, ensure your raylib installation is compatible with your system and properly linked.
If you want to build raylib from source instead of using the package manager:
- Clone raylib:
git clone https://github.com/raysan5/raylib.git - Follow building instructions at https://github.com/raysan5/raylib/wiki/Build-and-Installation
- Update the
CMakeLists.txtpaths to point to your custom raylib build
The game is written in C++ with the following key components:
- Game state management (MENU, PLAYING, GAME_OVER, etc.)
- Ball physics and collision detection
- Paddle control
- Score tracking
- Multiple game states and transitions
See the LICENSE file for details.
Feel free to fork this repository and submit pull requests with improvements!
For issues with raylib, visit: https://www.raylib.com/ For CMake help, visit: https://cmake.org/cmake/help/latest/