This project is a very small 2D game. Its purpose is to make you work with textures, sprites, and some other very basic gameplay elements. My game was made in C with the graphical library MLX42. The goal of the game is to collect all pickups and go through the exit and...
- DFS Algorithm - Depth first Search or Depth first traversal is a RECURSIVE algorithm for searching all the vertices of a graph or tree data structure. Traversal means visiting all the nodes of a graph.
- MLX42 - MiniLibX is a tiny graphics library which allows you to do the most basic things for rendering something in screens
- Check inputed arguments if argc < 2 or argc > 2
- Program has to take as parameter a map description file ending with the .ber extension.
- The map has to be constructed with 3 components: walls, collectibles, and free space.
- The map can be composed of only these 5 characters: 0 for an empty space, 1 for a wall, C for a collectible, E for a map exit, P for the player’s starting position.
- The map must contain at least 1 exit, 1 collectible, and 1 starting position.
- If the map contains a duplicates characters (exit/start), you should display an error message.
- The map must be rectangular.
- The map must be closed/surrounded by walls. If it’s not, the program must return an error.
- You have to check if there’s a valid path in the map
- You must be able to parse any kind of map, as long as it respects the above rules.
- Get whole the map with gnl and place it to string
- Split string to 2D array and assing to map2
- Split string to 2D array and assing to tmp (it will be use to find a valid path to exit(check DFS))