Skip to content

A small 2D-game coded in C, using the MLX42 Graphics Library

Notifications You must be signed in to change notification settings

MKcodes2/so_long

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

so_long

A project coded in My Skills in accordance with The Norm of 42 School.

📝 Description

Welcome to so_long! This project is a fun and challenging 2D game where the player's goal is to help Santa collect all the gifts before his 'flight'. I chose to create a Christmas-theme, inspired by the season I developed the game.

👀 Preview:

overview_example

Graphics Library that was used: MLX42

🚀 Features

  • 2D game with a grid-based map.
  • Move your character using either W, A, S, D keys or the arrows.
  • Escape the map after collecting all gifts.
  • Movement count displayed on the screen (bonus feature).
  • Clean exit using ESC or the red cross.

🎯 Map requirements:

✔️ File extension must be .ber.
✔️ Must contain: 1 Start (P), 1 Exit (E) and at least 1 Collectible (C)
✔️ Surrounded by walls (1).
✔️ Rectangular in shape.

Basic Map Example:

111111
1P0C01
100001
1E0001
111111

✨ Bonus Features I added

  • 🐍 Enemy Patrols - Avoid Grinch that cause instant defeat.
  • 🎨 Sprite Animation - Animated gifts and Enemy.
  • 🖥️ Movement Counter on Screen - Track moves directly within the game.

⚙️ Installation

  1. Clone the repository:
git clone https://github.com/MKcodes2/so_long.git so_long_MK 
  1. Navigate to the project's directory:
cd so_long_MK
  1. Compile the program:
make
  1. Run the game, with any map of your choice. Example:
./so_long maps/smaller_map.ber

🛠️ Makefile Commands

  • make - Compile the game.
  • make clean - Remove object files.
  • make fclean - Remove all build files.
  • make re - Recompile everything.
  • make bonus - Compile the bonus features.

🔎 Troubleshooting

  • Ensure MiniLibX is properly installed.
  • Confirm that your .ber map is valid.
  • Check for memory leaks using valgrind.

🤝 Contributing

Feel free to fork this project, suggest changes, or add your own creative themes!

About

A small 2D-game coded in C, using the MLX42 Graphics Library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published