This project has been created as part of the 42 curriculum by mikkayma.
So Long is a simple 2D top-down game developed in C using the MiniLibX graphical library. The project focuses on core game development concepts such as window management, event handling, and rendering textures to create an interactive experience.
The objective of the game is for the player to collect all items on the map and reach the exit while navigating through a maze of walls. The challenge lies in managing resources (collectibles) and movements efficiently within a grid-based environment.
- Language: C.
- Graphics Library: MiniLibX (Internal 42 graphical library).
- Event Handling: Real-time keyboard input processing for player movement (W, A, S, D).
- Map Parsing: Parsing of
.berfiles with strict validation for map integrity (walls, exit, starting position, and collectibles). - Algorithm: Implementation of a pathfinding check to ensure the map is solvable before the game starts.
- Graphic Management: Smooth window management, including minimization and clean exit via ESC or the window cross.
- Movement Tracking: Real-time display of the total movement count in the terminal.
- Robust Validation: Detailed error handling with explicit "Error" messages for misconfigured map files.
- 2D Rendering: Sprite-based rendering for walls, collectibles, player, and exit.
The project is managed via a Makefile with the required rules:
make # Compiles the so_long executable
make clean # Removes object files
make fclean # Removes object files and the executable
make re # Recompiles the project./so_long maps/map.ber