https://github.com/marsdevx/maze-escape
🎮 🧩 Simple 2D puzzle game built in C for Linux and macOS.
https://github.com/marsdevx/maze-escape
2d 2d-game 42 c c-programming c-programming-game clanguage educational-game educational-project game-development gamedev linux macos maze-game maze-generator mlx so-long
Last synced: 4 months ago
JSON representation
🎮 🧩 Simple 2D puzzle game built in C for Linux and macOS.
- Host: GitHub
- URL: https://github.com/marsdevx/maze-escape
- Owner: marsdevx
- License: mit
- Created: 2025-01-02T19:40:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-10T16:57:17.000Z (12 months ago)
- Last Synced: 2025-04-05T03:11:26.743Z (10 months ago)
- Topics: 2d, 2d-game, 42, c, c-programming, c-programming-game, clanguage, educational-game, educational-project, game-development, gamedev, linux, macos, maze-game, maze-generator, mlx, so-long
- Language: C
- Homepage:
- Size: 1.29 MB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/marsdevx/maze-escape/commits/main "Last Commit")
[](https://github.com/marsdevx/maze-escape "Platforms")
[](https://github.com/marsdevx/maze-escape "Languages")
[](https://github.com/marsdevx/maze-escape "Genre")
[](https://github.com/marsdevx/maze-escape/tree/main/textures "Assets")
[](https://github.com/marsdevx/maze-escape/tree/main/levels "Levels")
[](https://github.com/marsdevx/maze-escape/blob/main/LICENSE "License")
---
# 🧩 Maze Escape
This project is a simple **2D puzzle game** built for educational purposes using the **C language** and the **MiniLibX Graphics Library**. Designed to run on **Linux** and **macOS**, this open-source project showcases the basics of **game development** with **C**.
* **2D game** using **XPM** images as assets.
* Includes 6 different asset packs and 4 challenging levels.
* A perfect introduction to game development with C language.
* Lightweight and easy to customize for learning.
Explore how C can bring games to life with this opensource puzzle game!
---
## 🖼️ Preview
---
## 🛠️ Installation
To install this project, Launch the Terminal app on your system, and run the commands below.
- If a pop-up appears prompting you to download the Xcode Command Line Tools after the first command, click “Download” and then run the first command again.
### macOS
1. **Clone repo**
```bash
git clone https://github.com/marsdevx/maze-escape.git ~/Downloads/Maze-Escape
```
2. **Compile project**
```bash
cd ~/Downloads/Maze-Escape && make macos
```
### 🐧 Linux
1. **Clone repo**
```bash
git clone https://github.com/marsdevx/maze-escape.git ~/Downloads/Maze-Escape
```
2. **Compile project**
```bash
cd ~/Downloads/Maze-Escape && make linux
```
---
## 🚀 Usage
1. **Navigate to the Game Directory**
```bash
cd ~/Downloads/Maze-Escape
```
2. **Run the Game**
```bash
./maze_escape levels/lvl1 textures/pacman
```
3. **Customize Your Game**
You can modify the level and texture by changing the corresponding arguments in the command:
- Levels: Replace `levels/lvl1` with one of the following:
- `levels/lvl1`
- `levels/lvl2`
- `levels/lvl3`
- `levels/lvl4`
- Textures: Replace `textures/pacman` with one of the following:
- `textures/pacman`
- `textures/adventurer`
- `textures/chicken`
- `textures/pokemon`
- `textures/space-ship`
- `textures/time-adventure`
---
## ⚙️ Advanced Options
### Add Your Own Map
You can add custom maps to the game, as long as they follow these rules:
1. The map must be a `.ber` file.
2. The map can only contain the following characters:
| CHAR | OBJECT |
|------|---------------|
| 1 | Wall |
| C | Collectible |
| E | Exit |
| P | Player |
| 0 | Background |
#### Example of a valid map
```
11111111111
10000P1C001
11111011101
10001000001
101011111E1
11111111111
```
### Add Your Own Textures
You can add custom textures to the game, as long as they follow these rules:
1. The `textures` folder must contain **exactly 5 files**.
2. All files must be in the `.xpm` format.
3. The files must be named as follows:
- `bg.xpm` (background)
- `exit.xpm` (exit point)
- `item.xpm` (collectible items)
- `player.xpm` (player character)
- `wall.xpm` (walls)
---
## 📋 License
All the code contained in this repo is licensed under the [MIT License](LICENSE)
```
MIT License
Copyright (c) 2025 marsdevx
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
---
## ⭐ Support
If you like this project, don’t forget to ⭐ **star** it and **follow** me!
Your **support** helps me create more projects. 🚀
🔗 **Explore more of my work on [GitHub](https://github.com/marsdevx?tab=repositories) and discover other exciting projects!**