lmoraesdev / so_long

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

so_long

42 São Paulo's project

`so_long` is a project developed as part of the 42 São Paulo curriculum. It focuses on creating a basic 2D game using the minilibx graphical library, where the player navigates through a map, collects items, and avoids enemies.


The goal of so_long is to create a game that fits within the following constraints:

  • The game must take place on a single map.
  • The map must be rectangular, composed of walls, empty spaces, collectible items, and one exit.
  • The player must be able to move through the map using the keyboard arrows.
  • The player must be able to collect items and reach the exit to win the game.
  • The player must face enemies that move independently throughout the map.
  • The game must follow specific behavioral rules for the player and enemies.
  • The game must display the player's movements, actions, and any necessary information on the screen.
  • The project must manage memory appropriately and avoid leaks.

Mandatory

  • The game must be able to display an image of the player's character, enemies, collectible items, and map layout.
  • The player must interact with the game using keyboard inputs for movement and actions.
  • The game must handle player-enemy interactions, including collisions and game over scenarios.
  • The game must include visual and behavioral feedback for player actions and game state changes.
  • The project must be implemented in C language, using the minilibx graphical library provided.

Overview

In so_long, the player is placed within a defined map environment and must navigate through it to achieve specific objectives. The map consists of various elements such as walls, empty spaces, collectible items, enemies, and an exit. The player can move in four directions using the keyboard arrows, collecting items and avoiding enemies as they progress. The game ends when the player successfully navigates to the exit or encounters a game-over condition.

The project challenges the developer to implement interactive gameplay mechanics, handle graphical rendering using the minilibx library, manage game state transitions, and ensure smooth user interactions throughout the gameplay experience.


Usage

Installation

Clone the so_long repository to your local machine:

$ git clone https://github.com/lmoraesdev/so_long.git path/to/so_long

Navigate to the project directory:

$ make

Running the Game

To start the so_long game, run the executable with a map file as an argument:

$ ./so_long maps/map.ber

Controls

  • Use the arrow keys (↑, ↓, ←, →) to move the player character.
  • Collect items (C) and reach the exit (E) to complete the game objectives.

Features

  • Graphics: Utilizes the minilibx library for graphical rendering.
  • Map Parsing: Reads and interprets map files in the .ber format.
  • Player Interaction: Implements player movement, item collection, and game state handling.
  • Enemy AI: Includes basic AI for enemy movement and interaction with the player.

Requirements

  • Operating System: Compatible with Unix/Linux environments.
  • Dependencies: Requires minilibx graphical library for rendering.

About


Languages

Language:C 86.1%Language:Roff 10.2%Language:Makefile 2.6%Language:Shell 0.8%Language:Perl 0.3%