A journey through the shadows of the maze.
A 2.5D maze game built using raycasting techniques in C and SDL2.
- Introduction
- Inspiration
- Technical Challenges
- Project Timeline
- Features
- Architecture
- APIs and Methods
- Data Model
- User Stories
- Mockups
- Installation
- Usage
- Future Iterations
- Contributing
- License
RayMaze is a maze game where the player navigates through a maze to reach the end. The game is built using SDL2 for graphics rendering. RayMaze is a 2.5D maze game inspired by classic games like DOOM. It leverages raycasting techniques to render a 2.5D environment using the SDL2 library in C. The game challenges players to navigate through a maze, avoiding obstacles and finding the exit.
The inspiration for RayMaze came from my fascination with early 3D games and the technical challenge of implementing raycasting. I wanted to create a project that not only showcases my skills in C programming and SDL2 but also brings a nostalgic gaming experience to life.
One of the main technical challenges was implementing the raycasting algorithm. Raycasting involves calculating the distance from the player to the walls of the maze to render a 3D perspective. This required a deep understanding of trigonometry and optimization techniques to ensure smooth gameplay.
- Week 1: Research and project proposal
- Week 2: MVP design and initial implementation
- Week 3: Development and testing
- Week 4: Feature expansion and bug fixes
- Week 5: Final testing and deployment
- Week 6: Landing page creation and presentation preparation
- Week 7: Blog post reflection and GitHub cleanup
- 3D Rendering: Real-time 3D rendering using raycasting.
- Maze Generation: Procedurally generated mazes for endless gameplay.
- Obstacle Avoidance: Dynamic obstacles to increase difficulty.
- User Interface: Intuitive UI for easy navigation and gameplay.
The architecture of RayMaze consists of the following components:
- Game Engine: Handles the core game logic and rendering.
- Maze Generator: Generates the maze layout.
- Input Handler: Manages user inputs.
- Renderer: Uses SDL2 to render the 3D environment.
- /api/maze
- GET: Returns the current maze layout.
- POST: Generates a new maze layout.
- initialize_game(): Initializes the game environment.
- render_frame(): Renders a single frame of the game.
- handle_input(): Processes user inputs.
The data model for RayMaze includes:
- Player: Stores player position and state.
- Maze: Represents the maze layout.
- Obstacles: Dynamic obstacles within the maze.
- As a player, I want to navigate through a 3D maze so that I can find the exit.
- As a player, I want to avoid obstacles so that I can reach the exit without losing.
- As a developer, I want to generate mazes procedurally so that each game is unique.
- SDL2 library
To install SDL2 run:
sudo apt-get install libsdl2-dev
-
Clone the repository:
git clone https://github.com/AyomideA-S/RayMaze.git cd RayMaze
-
Build the project using
make
:make
Run the game:
./bin/RayMaze
Alternatively, you can run the Bash script:
./run.sh
- Use the arrow keys to navigate through the maze.
- Avoid obstacles and find the exit to win the game.
- Multiplayer Mode: Implement a multiplayer mode for competitive gameplay.
- Enhanced Graphics: Improve the graphics with textures and lighting effects.
- Mobile Version: Develop a mobile version of the game.
Contributions are welcome! Please read the contributing guidelines before submitting a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.