Skip to content

Zaiicko/so_long

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

So_Long        42 logo little

Language: C

Introduction

So_Long is a simple 2D game where the player must collect items and find the exit on a predefined map. The game is inspired by the universe of Freeze Corleone. It utilizes textures, sprites, and basic gameplay mechanics. The primary goal of this project is to help you work with basic computer graphics, window management, and event handling using the MiniLibX library.

Gameplay GIFs

gameplay_gif

gameplay_gif2

Template_esmall

Features

  • Game Objective:

    • The player must collect all collectibles on the map and reach the exit.
    • The game is controlled with the keyboard using either the W, A, S, and D keys or the arrow keys for movement.
    • Movement should be restricted to valid spaces, avoiding walls.
    • The number of moves is displayed in the terminal after each action.
  • Map:

    • The map is built from specific characters: 0 for empty space, 1 for walls, C for collectibles, E for exits, and P for the player's start position.
    • Maps must be rectangular, surrounded by walls, and contain at least one exit, one collectible, and one starting point.

Usage

To use the so_long program:

  1. Compile the Project:

    make
  2. Run the Program:

    ./so_long <map_file.ber>

    Replace <map_file.ber> with the path to a valid .ber map file.

  3. Example:

    ./so_long maps/simple_map.ber

    This will start the game using the specified map file.

Example Maps

Here is an example of a valid .ber map file:

1111111
1P00001
100C0E1
1111111

P - Player's starting position.
C - Collectible.
E - Exit.
1 - Wall.
0 - Empty space.

System Compatibility

This project is compatible with both macOS and Linux systems, but there is a graphical issue where sprites are not rendering as transparent on Linux.

Resources

I used PiskelApp to modify the player sprite to show the back view and to make the exit appear closed. Here are the links to the assets used in the project :

Screenshot

Capture d’écran 2024-08-02 à 02 34 22

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published