Emerald Maze Game is a simple grid-based game where the player navigates through a maze, collects stars, and avoids walls. The project also includes visualizations such as a Mandelbrot fractal and some SDL-based demonstrations.
- Project Structure
- Prerequisites
- Installation
- Building the Project
- Running the Games and Visualizations
- Cleaning Up
- Contributing
- License
action.c
/action.h
: Handles the logic for entity actions such as moving and interacting with objects.base.c
/base.h
: Provides basic utility functions.direction.c
/direction.h
: Manages directional movement and related calculations.display.c
/display.h
: Uses SDL2 for rendering and display management.entity.c
/entity.h
: Manages game entities and their interactions.fractal.c
: Generates and visualizes a Mandelbrot fractal.grid.c
/grid.h
: Manages the grid structure for the game.maze.c
: Implements the main game logic for the maze.state.c
/state.h
: Manages the state of the game.hellodisplay.c
andhellosdl.c
: Simple SDL demos.Makefile
: Automates the build process.
- C Compiler: GCC or Clang
- SDL2 Library: The Simple DirectMedia Layer (SDL) library is required to compile and run the graphical components of the project.
For Ubuntu/Debian-based systems:
sudo apt update
sudo apt install libsdl2-dev
For macOS (using Homebrew): brew install sdl2
For Windows:
Install SDL2 from the SDL website and ensure the libraries are available in your compiler's search path.
Clone the repository to your local machine:
git clone https://github.com/yourusername/emerald_maze_game.git
cd emerald_maze_game
The project uses a Makefile to manage the build process. Use the make command to build different parts of the project:
make maze
make fractal
Build the Base Module Test:
make base
After building the executables, you can run them as follows:
./maze
./fractal
./base
- Maze Game: Use the arrow keys to move the player around the maze. Collect stars while avoiding walls. Press ESC to exit.
- Fractal Visualization: Zoom in and out using the Z and X keys. Use the arrow keys to navigate. Press ESC to exit.
To clean up the build directory and remove all generated executables, run:
make clean
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch: git checkout -b feature-branch-name.
- Make your changes and commit them: git commit -m 'Description of changes'.
- Push to the branch: git push origin feature-branch-name.
- Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.