A simple 2D game engine built with C++ and Raylib, featuring sample games including Pong and Space Invaders.
-
Core Engine Components:
- GameObject base class for game entities
- Collider system for collision detection
- Background rendering
- Circle shape utilities
- Vector2 math utilities
-
Sample Games:
- Pong: Classic paddle ball game with scoring
- Space Invaders: Retro space shooter with invaders and bullets
In the future, I plan to integrate pure OpenGL, DirectX, and Vulkan rendering backends for enhanced graphics capabilities, cross-platform support, and add 3D rendering features.
-
CMake (version 3.16 or higher)
- Download: https://cmake.org/download/
- Installation: Follow the installer for your platform
-
C++ Compiler
- MSVC (Windows): Install Visual Studio Community (free)
- Download: https://visualstudio.microsoft.com/downloads/
- Select "Desktop development with C++" workload during installation
- GCC (Cross-platform):
- Windows: Install MinGW-w64 from https://www.mingw-w64.org/
- Linux/macOS: Usually pre-installed or available via package manager
- Clang (Cross-platform):
- Windows: Available through Visual Studio or LLVM installer
- Download: https://llvm.org/
- MSVC (Windows): Install Visual Studio Community (free)
-
Raylib Library (automatically downloaded and built via CMake FetchContent)
- No manual installation required - handled by the build process
- Clone or download the project
- Navigate to the project root directory
- Create a build directory:
mkdir build # create build directory cd build # enter build directory - Generate build files with CMake:
cmake .. # execute into the ./build directory - Build the project:
cmake --build . --config Release # execute into the ./build directory - builds the code into the .exe into release folder
- Open the project
- Generate build files with CMake::
cmake -S . -B build # CMAKE initial build - Build the project:
cmake --build build # builds the code into the .exe
- Run the PowerShell build script from the project root:
.\scripts\build.ps1 -BuildType Release
- To clean and rebuild:
.\scripts\build.ps1 -Clean -BuildType Release
After building, the executable will be located in build/bin/Release/. Run the game engine to start with the default game, or modify the code to select different games.
include/- Header files for engine components and gamessrc/- Source files for implementationbuild/- Build artifacts (generated by CMake)scripts/- Build and utility scriptsCMakeLists.txt- CMake build configurationREADME.md- Project documentationCHANGELOG.md- Version history and changesCONTRIBUTING.md- Guidelines for contributorsLICENSE- MIT license file.clang-format- Code formatting configuration.editorconfig- Editor configurationVERSION- Current version number
Feel free to contribute by adding new games, improving the engine, or fixing bugs. Please ensure code follows C++ best practices and includes appropriate documentation.
I would like to express my sincere gratitude to the following:
-
Raylib – for providing a simple and powerful library for videogame programming, and to its community and developers for their continuous work and support.
- Website: https://www.raylib.com/
- License: zlib/libpng
-
AIV (Accademia Italiana Videogiochi) – and its teachers for their guidance, support, and for helping me build the knowledge and foundation to implement this code.
- Website: https://www.aiv01.it/
This project is licensed under the MIT License - see the LICENSE file for details.