Basically, this project is about making a game from scratch, from the logic of movement to the “graphics engine” of the game, using MinilibX libary.
You have to learn how to work with textures, how to position them on the screen, and how to keep your project organized and clean. Following the rules of 42 School
My game follows the theme of the PAYDAY franchise. Where the "story" of my game is to steal things without using violence (basically, without using guns).
But watch your step! Some Cloakers are escorting the place... But don't worry, your friend Bain will guide you through the heist.
I'm glad you asked! The process is very simple.
git clone https://github.com/brennm2/so_long.git- MinilibX download
cd so_long
make update- MinilibX dependencies
sudo apt-get update && sudo apt-get install xorg libxext-dev zlib1g-dev libbsd-dev- If you want to play the base game:
make- If you want to play the bonus game (recommended):
make bonusNow you have to choose a map. If you have only compiled so_long base, then you should choose the map "map_tester.ber"
But if you've compiled the bonus game, then you can choose from 4 maps:
- map_syntax_error.ber
- map_aftershock.ber
- mapdw_jewelry_store.ber
- mapdw_firestarter.ber
Now… the game has 2 “difficulties”, Normal and Death Wish
Choosing the map with the initial mapdw_ will start the map with more enemies!
Here's how to start the game:
./so_long maps/map_tester.beror
./so_long_bonus maps/map_aftershock.ber- You move your character with the arrow keys or WASD
- You must avoid the Cloakers, they move randomly only after the player moves, and ONLY IF the player moves
(no walking on the wall to escape from enemies ;) ) - You need to collect ALL the money bags in order to escape the heist
- An additional objective is to try to finish the map with as little movement as possible.
This won't influence anything, just another way to improve your performance! - If you want to stop playing, just press 'ESC' or close the window with the X button.
One idea I had was to have dialogues in the game. Texts will appear in the shell depending on what happens in the game.
In total, the game has 4 dialogue scenarios, and each scenario has 4 different sets of dialogue to choose from at random.
In short, there are 16 different dialogues! Four of them only happen if you're on Death Wish difficulty
I won't show you an example because I want YOU to find out for yourself, can you beat it on this difficulty?
Here are some examples:
The game's HUD has 2 states, 1 - POLICE ASSAULT and 2 - POINT OF NO RETURN.
The first state indicates that the player has to collect the money bags and shows the total movement.
The second state indicates that the player has collected all the money bags and needs to leave the map.
I had a problem with the HUD, as the map can be completely modular, so the size of the window also changes, and you have to re-calculate to place it in the right pixel. So, depending on the size of the map, the HUD won't be perfectly centered on the screen.
The map can be modified, altered or even created in a simple and functional way, as long as it follows these rules:
- Only have ONE Player (P)
- Only have ONE Exit (E)
- There has to be AT LEAST one Collectible (C)
- It has to be enclosed by Walls (1)
- And it needs to be filled with floors (0)
- You can place enemies (X)
- It has to be rectangular
- The player must find a way to collect all the collectibles and reach the exit
- The map can only use the following characters: 1, 0, E, P, C and X(This will not work if you run the base game)
- The map extension must be ".ber"Here's a simple example:
11111111111
1000E0CX001
1000P00C001
10011111001
1X0CX0X0011
1000C000001
10011111001
100C0000001
1000C000X01
11111111111In every project we must follow certain rules, here are the rules for this project:
- The project must not have memory leaks
- The project must use the flags -Wall -Wextra -Werror
- Each function can have a maximum of 25 lines
- Each file should only have 5 functions
- We should keep the code as clean as possible, for example, declarations should be on separate lines
- We cannot use "for", "do...while", "switch", "case", "goto", ternary operators, or variable-length arrays- Wall and floor Texture
- Dallas Texture
- Cloaker Texture
- Money Bag Texture
- Manhole Texture
- All my friends who helped me do this project