{"id":24062395,"url":"https://github.com/42mates/cub3d","last_synced_at":"2026-06-13T19:32:37.059Z","repository":{"id":255178829,"uuid":"823163790","full_name":"42mates/cub3D","owner":"42mates","description":"Repo for the cub3D project from 42 school by @marinsucks and @ku-alexej. ","archived":false,"fork":false,"pushed_at":"2024-09-17T08:51:46.000Z","size":111640,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-26T16:19:20.898Z","etag":null,"topics":["c","game","game-development","raytracing","wolfenstein-3d"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/42mates.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-07-02T14:17:27.000Z","updated_at":"2025-01-26T14:42:37.000Z","dependencies_parsed_at":"2024-08-28T13:16:42.019Z","dependency_job_id":"986cef31-220b-4792-84c1-65203bb83b55","html_url":"https://github.com/42mates/cub3D","commit_stats":null,"previous_names":["42mates/cub3d"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/42mates/cub3D","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42mates%2Fcub3D","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42mates%2Fcub3D/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42mates%2Fcub3D/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42mates%2Fcub3D/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/42mates","download_url":"https://codeload.github.com/42mates/cub3D/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/42mates%2Fcub3D/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34298247,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["c","game","game-development","raytracing","wolfenstein-3d"],"created_at":"2025-01-09T08:40:14.597Z","updated_at":"2026-06-13T19:32:37.021Z","avatar_url":"https://github.com/42mates.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\n\"Cub3D\" is a 3D game developed in C using the MiniLibX graphics library, which emulates 3D textures using the raycasting technique.\n\n\u003cdiv align=\"center\"\u003e\n\t\u003cimg src=\".vids/cub3d_basement.gif\" alt=\"cub3d_trees.gif\"\u003e\n\u003c/div\u003e\n\n## Code Implementation\n\nThis project relies on [**raycasting**](https://en.wikipedia.org/wiki/Ray_casting), which is a rendering technique used to create a 3D perspective in a 2D environment. It works by **casting rays** from the player's position in the direction they are facing. Each ray is traced until it hits a wall, and the **distance to the wall** is used to determine the height of the wall slice to draw on the screen. This process is repeated for **each vertical slice** of the screen, creating a 3D illusion:\n\n\u003cdiv align=\"center\"\u003e\n\t\u003cimg src=\".vids/wiki_raycasting.gif\" alt=\"cub3d_trees.gif\"\u003e\n\u003c/div\u003e\n\nEvery time the user moves, a new image is created from the `ray_casting()` function based on the player's position in the map and their orientation. This new image is then instantly drawn on the screen.\n\n## User Experience\n\nThe game is controlled using the `←` and `→` keys or by using the mouse for direction and `W`, `A`, `S`, `D` for movement. The goal of the game is to navigate through a 3D map. The program exits by pressing `Esc` or by clicking the window's `❌` button.\n\n\n## Features\n\nBesides the basic map rendering, the program also includes the following features:\n- **Map parsing**: the program analyses the map sent as an argument and returns an error in case it doesn't meet the subject requirements.\n- **Wall collisions**: based on the map's layout and the player's position, the player cannot move further than the map's limitations.\n- **Minimap**: a minimap appears at the top left of the screen. It can be toggled using the `M` key, and it can be zoomed in or out using the `-`/`+` keys.\n\n## Try Me!\n\n### Requirements\nTo build the game, you must use a stable version of Linux with a graphical environment such as [GNOME](https://wiki.gnome.org/Projects/GnomeShell/Extensions/StepByStepTutorial#Installing_GNOME_Shell_Extensionsand) and have the [X11](https://www.x.org/wiki/) library installed on your system. You must also meet the [minilibx](https://github.com/42Paris/minilibx-linux)'s following requirements:\n\n\u003e  - MinilibX only support TrueColor visual type (8,15,16,24 or 32 bits depth) \n\u003e - gcc\n\u003e - make\n\u003e - X11 include files (package xorg)\n\u003e - XShm extension must be present (package libxext-dev)\n\u003e - Utility functions from BSD systems - development files (package libbsd-dev)  \n\nFor example:\n```bash\nsudo apt-get install gcc make xorg libxext-dev libbsd-dev (Debian/Ubuntu)\n```  \n### Installation\n\nFirst, download the source code, either by cloning the repository in your shell:\n```bash\ngit clone https://github.com/42mates/cub3d.git\n```\n\nCreate the program:\n```bash\nmake\n```\n\n### Running the game\n\nto run the game, simply run the program with the map as argument:\n```bash\n./cub3d example.cub\n```\nReplace `example.cub` with the path to the map file you want to play. You can find some in the [maps](./maps) repository.   \n\n\n### Enjoy the 3D experience!\n\u003cdiv align=\"center\"\u003e\n\t\u003cimg src=\".vids/cub3d_trees.gif\" alt=\"cub3d_trees.gif\"\u003e\n\u003c/div\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42mates%2Fcub3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F42mates%2Fcub3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F42mates%2Fcub3d/lists"}