Skip to content

The So Long is a basic computer graphics application using the MiniLibX library. It focuses on improving skills in window management, event handling, colors, and textures. The project aims to enhance C programming abilities, algorithmic thinking, and problem-solving while encouraging hands-on learning through graphical programming.

Notifications You must be signed in to change notification settings

iaceene/So_long_42

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SoLong - Worm Game

Solong

SoLong is a 2D game developed as part of the 42 school. The game was built using the MLX 42 library, and it features both mandatory and bonus parts. The objective is to navigate a character through a map, collecting items and avoiding obstacles.

Project Overview

This repository contains:

  • Mandatory part: The core functionality of the game.
  • Bonus part: Extra features such as enemies, more complex game mechanics, and improved visuals.

Requirements

  • MLX 42 Library: The project uses the mlx42 library for graphical rendering. You will need to compile and install it before running the game.
  • C Compiler: gcc (or another C compiler) to compile the source code.

Setup Instructions

1. Compile the MLX 42 Library

Before compiling the game, you must compile the mlx42 library. Navigate to the mlx directory and run the following command:

cd mlx
make

This will build the mlx42 library. Once completed, return to the root of the repository:

cd ..

2. Compile the SoLong Project

You can compile either the mandatory or bonus version of the game.

  • To compile the mandatory version:
make
  • To compile the bonus version (with additional features such as enemies):
make bonus

3. Clean Up

To remove all object files and executables:

make clean

To remove all files (including executables and object files):

make fclean

4. Rebuild the Project

To remove all files and recompile everything from scratch:

make re

Usage

After compiling, you can run the game by executing the following command:

  • For the mandatory version:
./so_long maps/valid/map2.ber
  • For the bonus version:
./so_long_bonus maps/valid/bonus/map1.ber

Game Controls

The game can be controlled using the following keys:

  • Arrow Keys: Move the character.
  • WADS: Move the character.
  • Esc: Exit the game.

Project Structure

.
├── mlx/                    # MLX 42 library
├── mandatory/              # Mandatory part of the project
│   ├── src/                # Game logic source code
│   └── include/            # Header files
├── bonus/                  # Bonus part of the project
│   ├── src/                # Bonus features source code
│   └── include/            # Bonus header files
├── Makefile                # Makefile for compiling the project
└── README.md               # This file

Key Source Files

  • mandatory/src/main.c: Entry point of the game.
  • mandatory/src/graphic/render.c: Handles rendering of the game graphics.
  • bonus/src/graphic/enemy/ft_enemy_ia_bonus.c: Enemy AI for the bonus version.

Thanks

About

The So Long is a basic computer graphics application using the MiniLibX library. It focuses on improving skills in window management, event handling, colors, and textures. The project aims to enhance C programming abilities, algorithmic thinking, and problem-solving while encouraging hands-on learning through graphical programming.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published