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!
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.
- Clone repo
git clone https://github.com/marsdevx/maze-escape.git ~/Downloads/Maze-Escape
- Compile project
cd ~/Downloads/Maze-Escape && make macos
- Clone repo
git clone https://github.com/marsdevx/maze-escape.git ~/Downloads/Maze-Escape
- Compile project
cd ~/Downloads/Maze-Escape && make linux
- Navigate to the Game Directory
cd ~/Downloads/Maze-Escape
- Run the Game
./maze_escape levels/lvl1 textures/pacman
- 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
You can add custom maps to the game, as long as they follow these rules:
- The map must be a
.ber
file. - The map can only contain the following characters:
CHAR | OBJECT |
---|---|
1 | Wall |
C | Collectible |
E | Exit |
P | Player |
0 | Background |
11111111111
10000P1C001
11111011101
10001000001
101011111E1
11111111111
You can add custom textures to the game, as long as they follow these rules:
- The
textures
folder must contain exactly 5 files. - All files must be in the
.xpm
format. - 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)