Skip to content

ricvrdv/so_long

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

42 - SO_LONG

So Long

SUMMARY

In this repository you can find the code implementation for the SO_LONG project for 42. The goal of the project is to create a simple yet engaging game using the MinilibX graphics library. The player navigates a character through a map, collecting items and reaching the exit to win the game.

This project demonstrates skills in C programming, graphics programming, memory management, and algorithm design (e.g., pathfinding).

REPOSITORY STRUCTURE

Version for Linux and macOS inside linux_version and macos_version directories, respectively.

  • src: Contains the source code for the program.
  • includes: Contains the header file so_long.h, libft, which is a custom library for utility functions, and the graphics library minilibx.
  • Makefile: Tells make how to compile and link the program.
  • maps: Contains valid and invalid maps that can be used to run and test the program.
  • textures: Contains .xpm image files that are loaded into the game.
  • README.md: Project overview and usage instructions.

KEY FEATURES

Dynamic map parsing: Reads and validates maps from .ber files.

Player movement: Allows the player to move up, down, left, and right.

Collectibles: The player must collect all items before reaching the exit.

Win condition: The game ends when the player reaches the exit after collecting all items.

Graphics: Renders the game using the MinilibX library.

Error handling: Robust error handling for invalid maps, missing files, and memory allocation issues.

Path validation: Ensures the map has a valid path for the player to collect all items and reach the exit.

USAGE

  1. Compile the program:
make
  1. Run the program with a map file:
./so_long maps/valid/map4_valid.ber

To win the game open all chests to unlock the computer and exit the game. To close the game press ESC or click the cross on the window with the mouse.


🐸 Feel free to fork, clone, or contact me for questions or feedback.

About

A 2D game built in C using MinilibX, where players navigate a map to collect items and reach the exit, showcasing skills in graphics programming, memory management, and algorithm design.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors