The Maze A 3D Game
- Ahmed Muawia
- Oct 26, 2024
- 3 min read

Introduction
This project is a labyrinth Game and it’s adding an immersive experience by simulating real-world effects, like rain, to add a dynamic layer to the game. The team members who contributed building this game are Ahmed Muawia & Omer Elbasheer. In this project We wanted to focus in building the core game environment and adding a dynamic layer to it. I (Ahmed) worked on constructing the game walls, ceiling and the floor and handling the rain effect, Omer worked on the maze 3D map and the mini-map also the map parser.
Why this project?
Since all the team enjoy C language because it’s a low level language, We wanted to find A project where we can apply our C language skills, Programming in C really makes you feel genius or like you’re a hacker. We found a framework that is used to build simple games and works with C, It’s called SDL2. We also wanted to simulate some real world effect so we choosed 3D game.
Game MVP & algorithm

Core game algorithm
Game technology
Programming Language: C
Game Framework: SDL2 (Simple DirectMedia Layer)
Rendering Engine: Raycasting for 3D Maze Rendering
Map Loader: Parses external text files for map generation
features
3D Maze Rendering: Raycasting algorithm for wall detection and texture mapping
Rain: Raindrops simulated using an array of particles with gravity and resetting positions once they reach the bottom
Collision Detection: Player movement constrained by wall boundaries
2D Minimap: A minimap is displayed on the screen, showing the player’s position and orientation within the maze.
Technical challenges
The first challenge we faced is installing SDL2 framework for WSL (Windows Subsystem for Linux) that cost us a lot of time so we stepped back and went for installing SDL2 on windows.
In the second week of working on “The Maze,” one of the trickiest challenges we faced was getting the raycasting to work correctly. The core of raycasting involves shooting invisible rays from the player’s point of view and figuring out where they hit the walls in the game world. The tough part was ensuring that the distance from the player to the wall was calculated accurately, because even a small error could make the walls look distorted-too stretched or squished-on the screen, which broke the 30 effect we was aiming for.
Another problem came when we had to make sure the colors for the walls and the ground/ceiling were different. SDL2 gives you pretty basic tools for rendering, so we had to figure out how to keep the walls distinct from the rest of the scene. This meant splitting the screen correctly, so the top part would show the ceiling, the bottom would show the ground, and the middle would show the walls, all based on the raycasting results. It took a lot of trial and error to get everything lined up and looking right, out eventually, it started to come together.
Key Learnings and Interests
Learning how game engines handle 3D environments, such as raycasting, was an eye-opener.
Gained hands-on experience with SDL2, C programming, and particle systems.
Realized the complexity of balancing performance with dynamic effects like rain in a real-time system.
This article by Ahmed Muawia, A software engineer presenting his final project of ALX SE foundation program. Here is the link for the Game repository: https://github.com/Muawia24/The_maze_3d
My profiles:



Comments