This is a cross-platform 2D plane game built with C++ and SFML. The project is designed with modern C++ features (such as concepts in template programming) and follows software design patterns to ensure maintainability and scalability.
- Cross-platform support (Windows & Linux)
- Uses CMake for project configuration
- Dependency management via vcpkg
- Leverages modern C++ (C++20 concepts, smart pointers, and more)
- Implements software design patterns for better code organization
- Engaging SFML-powered gameplay with smooth graphics
- GitHub Workflow for automatic testing on Windows and Ubuntu
- Use vcpkg as a submodule to get the same experience on all platforms
- Use CMakePresets to simplify the build process
- CMakeUserPresets.json for user-specific CMake configurations (Optional)
Ensure you have the following installed:
- CMake (≥3.28)
- SFML (via vcpkg)
- C++ compiler (MSVC, GCC, or Clang)
- vcpkg for dependency management
- CMakePresets.json for the default CMake configurePresets (Optional)
- CMakeUserPresetsTemplate.json for the CMake workflow configurePresets (Optional)
# Run those commands in Developer PowerShell for VS 2022
git clone --recurse-submodules -j8 https://github.com/lucas-utd/plane-game.git
cd plane-game
# Configure and build
cmake --workflow --preset x64-releasegit clone --recurse-submodules -j8 https://github.com/lucas-utd/plane-game.git
cd plane-game
# Configure and build
cmake --workflow --preset x64-release-
Controls:
- Arrow keys: Move the plane
- Spacebar: Fire
- Escape: Pause/Exit
-
Objective:
- Avoid enemies and obstacles
- Destroy enemy planes to score points
src/- Game source filesinclude/- Header filesMedia/- Game assets (images, sounds, etc.)CMakeLists.txt- Build configurationCMakePresets.json- CMake Preset.github/workflows/- GitHub Actions workflow files
This project includes a GitHub Actions workflow that automatically builds and tests the game on Windows and Ubuntu. The workflow ensures that all commits and pull requests maintain code quality and compatibility across platforms.
- C++20 (Concepts, smart pointers, structured bindings)
- SFML (Graphics, Audio, Input handling)
- CMake (Cross-platform build system)
- vcpkg (Dependency management)
- Software Design Patterns (Singleton, Factory, Observer, etc.)
- GitHub Actions (Automated CI testing)
Contributions are welcome! If you’d like to improve the game, follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature-xyz) - Commit your changes (
git commit -m "Add feature XYZ") - Push the branch (
git push origin feature-xyz) - Open a Pull Request
This project is licensed under the MIT License – feel free to use and modify it!