Giter VIP home page Giter VIP logo

so_long's Introduction

My 2D Game Project with MLX42

Welcome to the GitHub repository for my 2D game project using the mlx42 library! My name is Olivier Boucher, and I am a student passionate about game development. This repository contains all the files and resources needed to understand and contribute to my game.

Main Game Image

Camera System GIF

Game Description

In this game, you play as a character who must navigate through various levels, avoiding enemies and reaching the exit door. The objective is to collect all the collectables (trees) to unlock the exit door. The game is developed in C and uses the mlx42 library for graphical rendering.

Features

  • 2D Graphics: Utilizes the mlx42 library for 2D graphics rendering.
  • Dynamic Camera System: Loads and renders only the elements visible on the screen, improving performance.
  • Auto-Tiling System: Automatically adjusts tiles to fit the surrounding environment seamlessly.
  • Build System: Allows for easy changes to tiles (blocks).
  • Varied Levels: Different levels with obstacles and enemie to overcome.

Camera System

The camera system is designed to load and render only the parts of the level that are visible on the screen. This reduces the load on the CPU and improves overall game performance. Here is an overview of how it works:

  • Position Detection: The camera follows the player's position and determines which parts of the level need to be rendered.
  • Dynamic Loading: Elements outside the screen are not loaded, reducing resource usage.

Build System

The build system allows for easy changes to the game's tiles, which is particularly useful for testing different appearances and visual styles. Each tile (block) has a linking texture that automatically updates when a new tile is placed, making it perfect with the build tool.

Build Image 1

Build Image 2

Build Image 3

Enemy and Exit Door

How to Play

  1. Clone the repository: git clone https://github.com/axhar005/so_long
  2. Navigate to the project directory: cd so_long
  3. Install the dependencies for mlx42 as specified in the MLX42 repository, including glfw.
  4. Compile the project: make
  5. Launch the game: ./so_long "map path" (example: ./so_long map/"choose a map")

Additional Controls

  • Press b for build mode
  • Press o or p to change tiles, and press the right mouse button to place tiles

Creating Maps

To create a map for the game, simply create a .ber file with the following tile designations:

Map Example

  • 1 for walls
  • 0 for floors
  • E for the exit
  • C for collectables (trees)
  • P for the player

Ensure the player (P) is placed in a safe area surrounded by walls (1), and that all collectables (C) and the exit (E) are accessible.

Save your .ber file in the appropriate directory, and you can load it using the game's launch command.

Contact

If you have any questions or would like to discuss the project, feel free to reach out:


Thank you for visiting my 2D game project repository! I am excited to continue developing and sharing my work with you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.