Code Monkey home page Code Monkey logo

simon-zerisenay / 42_so_long Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 308 KB

42 Solong is a 2D game project where players navigate through a maze, collecting items and avoiding obstacles. It involves tasks like parsing map files, handling player movement, and implementing basic game mechanics using the MinilibX graphics library.

Makefile 3.46% C 71.84% Berry 0.07% Objective-C 24.63%
2dgame 42abudhabi 42school 42solong c ecole42 minilibx solong

42_so_long's Introduction

42 So_Long

42 Badge

Score

110

Introduction

GitHub code size in bytes Number of lines of code Code language count GitHub top language GitHub last commit

Welcome to the 42 So_Long project! This project is part of the curriculum at 42 and focuses on creating a 2D game using the MinilibX, a simple graphic library provided by 42. So_Long is a game where the player navigates through a map, collects items, and avoids obstacles to reach the goal.

Objective

The objective of the So_Long project is to develop a fully functional game that incorporates various game elements, such as map rendering, player movement, collision detection, item collection, and win/lose conditions. By completing this project, you will enhance your understanding of game development concepts and gain practical experience in using the MinilibX library.

Features

Map Rendering So_Long allows you to load and render game maps stored in a specific format, typically a file with a .ber extension. The map consists of different tiles representing walls, paths, collectible items, the player's starting position, and the exit. The MinilibX library provides functions to render graphical elements on the screen, enabling you to display the map with the appropriate textures and colors.

Player Movement

The player can move in four directions: up, down, left, and right, within the bounds of the map. By handling keyboard inputs, you can update the player's position on the screen accordingly. The MinilibX library provides functions to capture key events and perform actions based on the pressed keys.

Collision Detection

To ensure the player doesn't move through walls or outside the boundaries of the map, collision detection is implemented. The game checks if the player's desired movement will result in a collision with a wall or if the player has reached the exit. If a collision is detected, the player's movement is restricted.

Item Collection

Throughout the map, there may be collectible items that the player can interact with. When the player reaches a tile containing an item, it is collected, and the player's score is incremented. This feature adds an additional layer of gameplay and encourages exploration.

Win/Lose Conditions

The win condition is achieved when the player successfully reaches the exit tile. In contrast, the lose condition can be triggered by specific events, such as colliding with enemies or running out of lives. Implementing win and lose conditions adds a sense of challenge and completion to the game.

Installation

To install and run the So_Long project, follow these steps:

Clone the project repository:

		git clone https://github.com/your_username/42-so_long.git

Navigate to the project directory:

				cd 42-so_long

Compile the project using the provided Makefile:

				make

Run the game executable:

			./so_long maps/map3.ber

Make sure you have the MinilibX library installed on your system. If it's not already installed, you can find the library and installation instructions in the project repository.

Testing

To test the game and validate its functionality, follow these steps:

Game


Launch the game using the installation steps mentioned above. Navigate through the map using the arrow keys or WASD keys. Ensure the player can move freely within the map and is restricted by walls and boundaries. Collect items on the map and verify that the score is updated accordingly. Reach the exit tile and confirm that the game ends with a win condition. Trigger any lose conditions (if implemented) and verify that the game ends accordingly. Test various edge cases, such as reaching invalid tiles or unexpected input, to ensure the game handles them gracefully. During testing, monitor the game's performance, responsiveness, and adherence to the specified game rules. Make adjustments and improvements as necessary to enhance the gameplay experience.

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.