This project is a work in progress aimed at building out core game engine modules while leveraging the capabilities of raylib for rendering, window management, and input handling. The ultimate goal is to create a modular, extensible game engine that powers the game "Snake" and act as the foundation for other future games.
- Core Modules:
- Provides essential interfaces such as
IGameStateandIStateMachineto manage game states and transitions in a modular way.
- Provides essential interfaces such as
- Rendering:
- Utilizes raylib for rendering 2D graphics and managing window operations.
- Input Handling:
- Supports an input abstraction framework through
InputManager, utilizing raylib's input backend.
- Supports an input abstraction framework through
- Game-Specific Implementation:
- Includes game-specific UI components such as
MainMenuUIand the game state logic built on top of theIGameStatecore module.
- Includes game-specific UI components such as
- Decoupled Design:
- Cleanly separates engine functionality (
Core) from game-specific implementations (Gamenamespace).
- Cleanly separates engine functionality (
The project is divided into several modules, highlighting its modular design:
-
Core Module:
- Contains reusable interfaces and abstractions for managing game logic.
- Interfaces include
IGameState(for states) andIStateMachine(for managing state transitions).
-
Platform Module:
- Handles platform-related functionality such as input, windowing, and configuration of the game environment.
- raylib is integrated here as the foundational library for rendering and input.
-
Game Module:
- Implements game-specific functionality such as:
- Gameplay State handling with
GameplayStateMachine SnakeandAppleEntities that make up the core gameplay functionality
- Gameplay State handling with
- Implements game-specific functionality such as:
-
Raylib Module:
- Adapts raylib functionality into classes and abstractions used throughout the project.
-
Engine Module:
- Holds the Application class and initial setup related functionality
-
Renderer-2D Module:
- Contains 2D Render Components that handle drawing
- Acts as an abstraction layer
To build and run the project, you need the following installed on your system:
- C++ Compiler:
- GCC/Clang on Linux
- Apple Clang on macOS
- MSVC on Windows
- CMake (minimum version 3.20):
- For build configuration.
- raylib (latest version):
- The project currently leverages raylib for rendering, windowing, and input handling. Ensure that raylib is both installed and accessible for the build process.
bash git clone https://github.com/DeanWilsonDev/snake/tree/game-with-engine-architecture && cd snake- Create a build directory:
mkdir build && cd build
- Configure the build with CMake:
cmake ..
- Build the project:
cmake --build .
Once built, you can run the generated executable (e.g., Snake) from the build directory:
This project is still under active development. Some key areas currently in progress include:
-
Input System Integration:
- Consolidating all input functionality under
InputManagerto ensure abstraction from raylib's input methods.
- Consolidating all input functionality under
-
State Management:
- Expanding game-specific logic for transitioning between
GameStateimplementations (e.g., fromMainMenuStatetoGameplayState).
- Expanding game-specific logic for transitioning between
-
UI Improvements:
- Enhancing interaction layers with better rendering abstraction.
-
Core Features:
- Building out reusable components and patterns for other future games.
The following is a list of tasks that need to be completed still. These have their appropriate markers to show the importance. These markers may also be found through out the codebase
- MAIN QUEST: Must be completed for the project to be considered done.
- SIDE QUEST: Tasks that will increase the quality of the project but could be skipped and done in the next one
- 1UP: Improvements
- REAPER: Clean up jobs
- RAID BOSS: Large tasks that need to be made to the engine code
- WORLD BOSS: Large tasks that need to be made to the game code, i.e. a new feature idea
- Modular support for multiple rendering and input backends beyond raylib.
- Creation of a complete "Snake" playable game.
- Abstracted and reusable UI framework built on top of the core engine.
- Potential support for other games leveraging the same engine foundation.
This project heavily relies on raylib, a simple and easy-to-use library designed for games and multimedia programming. We appreciate the incredible work from the raylib team and the surrounding community.
For more information about raylib, visit: https://www.raylib.com
This project is a foundational portfolio item. Contributions will not be accepted. Thank you.
This project is licensed under the MIT License. Feel free to use, modify, and distribute the project as per the license terms.