pacoman is a project where I create a simple 2D game using MiniLibX of 42network.
The player moves inside a map, collects all collectibles, and then escapes through the exit.
The game map is defined in a anypath/anyname.ber file.
It must respect the following rules:
- Rectangular: All rows must have the same length.
- Surrounded by walls: The map must be closed/surrounded by
1. - Allowed characters:
1โ Wall0โ Free spaceCโ CollectibleEโ ExitPโ Player starting position
- Required elements:
- At least 1 exit (
E) - At least 1 collectible (
C) - Exactly 1 player (
P)
- At least 1 exit (
- No invalid characters are allowed.
11111111111
1000000C001
1P1111111E1
10C0X000C01
11111111111
- W / โ โ Move up
- S / โ โ Move down
- A / โ โ Move left
- D / โ โ Move right
- ESC โ Close the game
./installdependencies
May take some seconds, sudo will ask you for sudopassword
./pacoman maps/0.ber
Choose the map you want, or create yours in /map folder or any other path.
