Skip to content

mikail7963/so_long

Repository files navigation

So Long - 42 Istanbul

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.

🚀 Overview

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.

🛠 Technical Implementation

  • 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 .ber files 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.

📋 Features

  • 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.

🕹 Instructions

Compilation

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

Execution

./so_long maps/map.ber

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors