A 2D game project from 42 School
So_long is a 2D game project developed during the 42 curriculum, where the goal is to create a simple yet engaging game through solid programming practices and creative design. The game is built using the MLX graphics library and features a maze-like map where the player collects items and navigates through obstacles.
While the base project is open to any theme, I chose a subtle nod to the classic Pacman for an added nostalgic touch—not as the main focus, but as an inspiration to enhance the gameplay experience.
- Interactive Gameplay: Navigate through the maze to collect items and reach the exit.
- Graphics & Animations: Utilizes the MLX library to provide smooth and dynamic visual effects.
- Event Handling: Real-time keyboard input for responsive and fluid movement.
- Map Validation: Ensures the provided map (in
.ber
format) is valid and playable. - Bonus Features:
- Seamless animations.
- Optional enemy movements.
- Enhanced effects (including optional sound support, if available).
- C — Core programming language.
- MLX (MiniLibX) — Graphics and window management library.
- Makefile — Build automation tool.
Start by cloning the repository and then compile using the provided Makefile commands:
# Compile the project
make all
# Remove object files
make clean
# Remove object files and executable
make fclean
# Clean and recompile
make re
To launch the game, run the executable with a map file (in .ber
format) as an argument:
./so_long maps/my_map.ber
Note: Ensure your environment meets the prerequisites for MLX (e.g., X11 on Linux).
- Arrow Keys or W, A, S, D: Move your character around the maze.
- ESC: Exit the game immediately.
Note: Ensure your environment meets the prerequisites for MLX (e.g., X11 on Linux) before running the game.
The project has undergone extensive testing to guarantee:
- Fluid and responsive navigation within the maze.
- Correct map validation and layout consistency.
- Proper functionality of animations and bonus features.
Custom map tests and internal debugging tools helped optimize the gameplay experience.
Here’s my score for the Push_swap project:
- MLX Documentation: Essential documentation for mastering the MLX graphics library.
Feel free to reach out or contribute to this project on GitHub!