{"id":23289669,"url":"https://github.com/mathyscogne/42_so_long","last_synced_at":"2025-10-27T22:30:49.630Z","repository":{"id":260949518,"uuid":"878680317","full_name":"MathysCogne/42_so_long","owner":"MathysCogne","description":"First graphic project at 42, aimed at creating a mini 2D game and familiarizing with the school's graphic library.","archived":false,"fork":false,"pushed_at":"2024-11-26T13:28:55.000Z","size":20626,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-20T04:17:33.234Z","etag":null,"topics":["2d-game","42","c","solong"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MathysCogne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-25T21:05:55.000Z","updated_at":"2024-12-06T12:46:00.000Z","dependencies_parsed_at":"2024-11-03T20:37:16.202Z","dependency_job_id":null,"html_url":"https://github.com/MathysCogne/42_so_long","commit_stats":null,"previous_names":["mathyscogne/42_so_long"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathysCogne%2F42_so_long","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathysCogne%2F42_so_long/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathysCogne%2F42_so_long/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MathysCogne%2F42_so_long/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MathysCogne","download_url":"https://codeload.github.com/MathysCogne/42_so_long/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238563732,"owners_count":19492975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2d-game","42","c","solong"],"created_at":"2024-12-20T04:17:36.742Z","updated_at":"2025-10-27T22:30:48.413Z","avatar_url":"https://github.com/MathysCogne.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003e42 - SO_LONG\u003c/h1\u003e\n\u003cimg src=\"textures/screenshots/main.gif\" alt=\"Main GIF\" width=\"650\" /\u003e\n\n\u003c/br\u003e\n\u003c/br\u003e\n\n\u003cstrong\u003eWelcome to So_Long, a 2D game created using MiniLibX for a project at 42 School  ! 🌟\u003c/strong\u003e\n\n\u003cp\u003eYour mission ? Collect all items before finding the exit... but beware of lurking monsters\u003cp\u003e\n\n\u003c/br\u003e\n\n\u003cp\u003e\u003cstrong\u003eAnd Thanks for All the Fish !\u003c/strong\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003ca href=\"https://github.com/MathysCogne/42_so_long/blob/main/subject/so_long.pdf\"\u003e\u003cstrong\u003eSubject\u003c/strong\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003c/div\u003e\n\n## Features\n\n\u003c/br\u003e\n\u003cdiv alignitems=\"center\"\u003e\n\n \n### Game Objectives (Mandatory part):\n\n- **2D View**\n- **Objective:** The player must collect all items on the map and escape via the shortest path.\n- **Player Movement:** The player can move in four directions (up, down, left, right) and never through walls.\n- **Movement Counter in shell** \n\n### Bonus Features:\n\n- **Random Floor Pattern:** Ground textures are randomized, and external walls differ from the labyrinth walls inside the map.\n- **Character and Monster Animation:** Both the player and monsters are animated during movement.\n- **Monsters:** Monsters are programmed to pursue the player at all costs. If they encounter a wall blocking their path, they will attempt to find an alternative route to reach the player.\n- **Health Management:** The player has three lives before dying.\n- **Turn-Based Mechanics:** The player has as many moves per turn as remaining lives + 1, while monsters always have two moves.\n- **User Interface (UI):** Displays move counter, item counter, lives remaining, and a turn banner indicating if it’s the player’s or monsters' turn.\n\n\u003c/div\u003e\n\n\u003c/br\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://github.com/ayogun/42-project-badges/blob/main/badges/so_longm.png\" alt=\"Badge So_Long\" /\u003e\n\u003c/div\u003e \n\n### Key Hooks\n\n| Key     | Description       |\n|:--------|:-------------------\n| ESC        | Quit the game  |\n| W or ⬆️     | Move up        |\n| S or ⬇️     | Move down      |\n| A or ⬅️     | Move left      |\n| D or ➡️     | Move right     |\n\n\u003c/br\u003e\n\n### Map Structure `(.ber formar)`\n\nEach map in .ber format should adhere to specific structural rules:\n   - The map is rectangular and closed by walls on all edges.\n   - Contains one 'P' (Start) and one 'E' (Exit).\n   - Items ('C') must be collectible, with a path allowing the player to reach all items before accessing the Exit.\n   - Only the characters shown in the table below are allowed:\n\n| Character | Description   |\n|:--------|:-----------------\n| P       | Start point     |\n| E       | Exit point      |\n| C       | Item            |\n| 0       | Void / Flat     |\n| 1       | Wall            |\n| M       | Monsters        |\n\n\n\u003c/br\u003e\n\n## Project Structure\n\n- **include/**\n  -  Contains header files\n\n- **src/**\n   - [`main.c`](./src/main.c) - Entry point of the program\n   - [`so_long.c`](./src/so_long.c) - Manages core game functions\n      - [`game/`](./src/game/) - Contains gameplay logic, including player movement, item collection tracking,monster behavior, and win/loss conditions.\n      - [`map/`](./src/map/) - Handles map-related functions, such as loading and validating .ber map files and checking paths for game elements like the exit and items.\n      - [`mlx/`](./src/mlx/) - Manages the interface with the MiniLibX library, including creating windows, rendering textures, and updating the display.\n      - [`utils/`](./src/utils/) - Utility functions\n\n- **textures/**\n   - Contains the game's textures, stored in .xpm format\n\n- **map/**\n   - Directory for .ber maps, including both valid and invalid configurations for testing.\n\n- **librairies**\n   -  [`MinilibX`](https://harm-smits.github.io/42docs/libs/minilibx) The graphical library provided by 42\n   -  [`Libft`](https://github.com/MathysCogne/MyLibft_GNL_Printf) A custom implementation of the Libft library with essential functions\n\n\n\n\u003c/br\u003e\n\n## Compilation and usage\n\u003c/br\u003e\n\n**Dependencies**\n\n- Libft: This project depends on my Libft. Automatically downloaded and installed when you run the make command.\n\n- MiniLibX: The MiniLibX library will be automatically downloaded and installed when you run the make command. Ensure you have the necessary [`prerequisites`](https://harm-smits.github.io/42docs/libs/minilibx/getting_started.html) on your machine.\n\u003c/br\u003e\n\n**1.** To compile, simply run the `make` command:\n\n*This Makefile was generated by my generator available here: [`MakeMyFile`](https://github.com/MathysCogne/Make_My_File-42)*\n```bash\nmake\n```\n``make bonus``\n``make clean``\n``make fclean``\n``make re``\n\n\u003c/br\u003e\n\n**2.** After compiling, run the game with the following command:\n\n```bash\n./so_long [path/to/map.ber]\n```\n\n\u003c/br\u003e\n\n\n## Disclaimer\n\u003e At 42 School, most projects must comply with the [Norm](https://github.com/42School/norminette/blob/master/pdf/en.norm.pdf).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathyscogne%2F42_so_long","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathyscogne%2F42_so_long","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathyscogne%2F42_so_long/lists"}