Skip to content

A project involving the creation of a small 2D game. Coded in C with MinilibX library

Notifications You must be signed in to change notification settings

josephcheel/42-So_long

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

So_long |  42 Cursus Complete

A project involving the creation of a small 2D game with a graphical library. Using MiniLibX, the 42 graphical library.



What is the project about

This project is focused on developing a 2D game that can be interacted with using your keyboard. The task is divided into two parts: the mandatory and the bonus. Each of these parts is compiled and executed separately. The bonus section includes the same features as the mandatory part, along with some additional enhancements.

General Instrucctions

  • Makefile will compile your source files. It must include 'all' and 'bonus' rules for the Mandatory and Bonus parts, respectively. It should not relink.
  • You are required to use MiniLibX for this project.
  • The program should be compiled using the following commands:
> ./so_long map.ber
> ./so_long_bonus map.ber

Warning

Maps must have the .ber extension

Mandatory Instrucctions

  • The number of movements must be displayed in the shell.
  • Pressing ESC or closing the window should result in quitting the program.

  • The map must be constructed using five components: walls, collectibles (at least one), empty spaces, exits (at least one), and the player (only one). These five characters compose the map:
    • 0 for an empty space
    • 1 for a wall
    • C for a collectible
    • E for a map exit
    • P for the player’s starting position

  • To move the main character, use the W A S D keys:
    • W to move up ↑
    • S to move down ↓
    • D to move right ➞
    • A to move left ←

Bonus Instrucctions

  • Add X to the map for spawn patrols
  • Make the player lose when they touch an enemy patrol
  • Add some sprite animation.
  • Display the movement count directly on screen instead of writing it in the shell.

How to compile it

Compilation is managed through the Makefile rules.

  • If you use make command, the ./so_long executable file, will be generated.
  • You can use make bonus command to generate the ./so_long_bonus executable file
> <install your mlx either Linux or MacOS in a folder called /mlx>
> make
> make bonus

About

A project involving the creation of a small 2D game. Coded in C with MinilibX library

Topics

Resources

Stars

Watchers

Forks