Skip to content

This project is a small 2D game with minilibx. You'll learn about textures, sprites and tiles.

Notifications You must be signed in to change notification settings

deydoux/42cursus-so_long

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

so_long

This project is a small 2D game with minilibx. You'll learn about textures, sprites and tiles.

About the project

This project is part of the 42 curriculum and focuses on creating a simple 2D game using the MinilibX graphics library. The main objectives include:

  • Working with textures, sprites, and basic game elements
  • Handling keyboard events for player movement
  • Implementing basic game mechanics (collecting items, reaching exit)
  • Managing window events and proper game closure
  • Reading and validating map files
  • Understanding basic game development concepts
Gameplay.webm

Key Requirements

  • The player must collect all collectibles before reaching the exit
  • The game must be viewed from a 2D perspective (top-down or profile)
  • The player must be able to move in 4 directions: up, down, left, right
  • The player cannot move through walls
  • Number of movements must be displayed in the shell
  • Must use MinilibX for graphics rendering
  • Valid path to complete the game
  • Map must be constructed with 5+1 components:
    • 0 Empty spaces
    • 1 Walls
    • P Starting position
    • C Collectibles
    • E Exit
    • R Rakes (Enemies bonus)

Map example

11111
1C1P1
10001
1E1R1
11111

Bonus features

  • Animated sprites
  • Enemies
  • Movement count display

Skills Learned

  • Graphics programming fundamentals
  • Event handling in a graphical environment
  • Game logic implementation
  • Memory management
  • File parsing and error handling

Getting started

Requirements

For Ubuntu/Debian

sudo apt-get install gcc libbsd-dev libxext-dev make xorg

For macOS

brew install xquartz
reboot

Build

make

Run

./so_long_bonus maps/maze10.ber
./so_long_bonus maps/maze10.ber -k zqsd # AZERTY layout

You can replace maps/maze10.ber by any .ber file.

Ressources

Sprites

About

This project is a small 2D game with minilibx. You'll learn about textures, sprites and tiles.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published