A simple 2D game engine built using the SDL2 library. This engine provides foundational functionalities for creating 2D games, including player movement, world rendering, and a modular entity system to facilitate the addition of new in-game objects and mechanics.
- Basic player character with 4-directional movement.
- Simple world/tile rendering system.
- Modular entity system: Easily add new game objects or mechanics by implementing the
IEntity
interface. - Event handling for all entities, enabling interaction and response to player inputs or other game events.
- Collision detection to handle interactions between entities.
- Easily extendable architecture for developing more complex game features.
- IEntity: Base interface for all entities in the game, providing a contract for rendering, event handling, and updating logic.
- Character: Abstract base class for movable entities, extending
IEntity
with common attributes like position, texture, and collision detection.- Player: Represents the player character, implementing specific movement logic and player-related functionalities.
- NPC: Non-player characters with potential for AI behaviors, quest interactions, or other game mechanics.
- World: Handles the rendering of the game environment, such as tiles or static background elements, implementing the
IEntity
interface to fit within the game's update and rendering loop.
- Character: Abstract base class for movable entities, extending
- SDL2
- SDL2_image
- SDL2_ttf (optional, for future text rendering features)
- Ensure the SDL2, SDL2_image, and SDL2_ttf libraries are installed on your system.
- Clone the repository:
git clone https://github.com/araujo88/nano-game-engine.git
- Navigate to the project directory and compile the game:
mkdir build cd build cmake .. make
- Execute the compiled game binary:
./game # from within the build folder
- Navigate the player character using the arrow keys (
↑
,↓
,←
,→
). - Extend the game by creating new subclasses of
IEntity
orCharacter
for diverse gameplay elements. - Implement custom behaviors for NPCs or interactive world elements to enrich the game environment.
Contributions are welcome to enhance and expand the Nano Game Engine:
- Review the
TODOs
documentation for areas of potential improvement. - Fork the repository.
- Create a feature branch (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -am 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a pull request.
This project is released under the MIT License - see the LICENSE
file for details.