Skip to content

In this project, we'll code a simple 2D game to get familiar with the mlx library and UI in general.

Notifications You must be signed in to change notification settings

whymami/so_long

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


So_Long


About the project

The objective of this project is to create a small 2D game where the player has to collect all the collectibles and go to the exit.

GAME RULES

  • The game we choose must follow a set of rules. The executable so_long will receive a map as the only argument, and this map will have a .ber filetype.
  • Only P (character), 1 (wall), 0 (ground), C (collectible), and E (exit) will be accepted characters in our map.
  • The map must be rectangular, i.e. all rows must have the same length
  • There must be at least one exit, one player, and one collectible on the map
  • The map must be closed, i.e. surrounded by walls
  • If any of these checks fail, the game must end with Error\n followed by a custom message.
  • The goal is for the player(s) to collect all the collectibles on the map before going to an exit in the least possible number of steps

Installing and running the project

Clone this repository: git clone https://github.com/whymami/so_long.git

Compilation

To compile the project, run the following command make Run the following command to compile the bonus part make bonus

Usage

To start the game, ./so_long maps/map2.ber

If you compiled the bonus part

./so_long_bonus maps/map_bonus/map2.ber

Structure of the map

Character Description
0 Ground
1 Wall
P Player
E Exit
C Collectable
X Villain

Controls

Keyboard Action
W Moving Up
S Moving Down
A Moving left
D Moving right
ESC, Close the game

Images:

Mandatory part


Bonus:

About

In this project, we'll code a simple 2D game to get familiar with the mlx library and UI in general.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published