{"id":30580604,"url":"https://github.com/mdbentaleb/cub3d_42","last_synced_at":"2025-10-10T10:39:24.682Z","repository":{"id":312071952,"uuid":"1046183462","full_name":"mdbentaleb/Cub3D_42","owner":"mdbentaleb","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-28T16:58:12.000Z","size":1570,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-28T17:32:52.830Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mdbentaleb.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,"zenodo":null}},"created_at":"2025-08-28T10:07:13.000Z","updated_at":"2025-08-28T16:58:16.000Z","dependencies_parsed_at":"2025-08-28T17:34:58.141Z","dependency_job_id":"23ffee12-f967-4512-8e62-6571ec068314","html_url":"https://github.com/mdbentaleb/Cub3D_42","commit_stats":null,"previous_names":["mdbentaleb/cub3d_42"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/mdbentaleb/Cub3D_42","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdbentaleb%2FCub3D_42","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdbentaleb%2FCub3D_42/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdbentaleb%2FCub3D_42/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdbentaleb%2FCub3D_42/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdbentaleb","download_url":"https://codeload.github.com/mdbentaleb/Cub3D_42/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdbentaleb%2FCub3D_42/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272636287,"owners_count":24967983,"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","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"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":[],"created_at":"2025-08-29T05:38:12.050Z","updated_at":"2025-10-10T10:39:24.670Z","avatar_url":"https://github.com/mdbentaleb.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🕹️ CUB3D\n\n\u003cimg width=\"1000\" height=\"700\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/6b3ddece-ff4d-4ad6-84a1-3b14d9073117\" /\u003e\n\n## 📌 Overview\n\n**CUB3D** is a core project in the 42 curriculum that aims to build a simple 3D graphics engine using **C** and **MLX**. The project focuses on learning the basics of **raycasting**, window management, image handling, and converting 2D maps into a 3D first-person perspective similar to games like Wolfenstein 3D.\n\n## ✨ Features\n\n* 🧠 3D rendering engine using **raycasting**\n* 🌍 Load and display 2D maps (`.cub` files)\n* 🪄 Render walls, floor, and ceiling with colors and textures\n* 🔄 Smooth player movement and rotation\n* 📜 File parsing and map validation\n* 🧱 Image management using **MLX**\n* ⚡ Wall collision detection to prevent walking through walls\n* 🖼️ Texture loading and rendering\n* 🧪 Proper memory management to avoid leaks\n* 🎨 Basic graphics with dynamic coloring\n* ⏱️ Real-time updates of player movement\n\n## 🧭 What CUB3D Supports\n\n### 🧵 Execution Engine\n\n* Parse `.cub` map files to generate the environment\n* Use **raycasting** to calculate distances and render walls\n* Draw walls and floors in real time\n\n### 🧹 Parsing \u0026 Map Loading\n\n* Read map files and validate their structure\n* Check player position and other map elements\n* Support fully enclosed maps to avoid errors\n\n### ⚖️ Movement \u0026 Physics\n\n* Move forward, backward, left, and right\n* Rotate smoothly left/right\n* Wall collision detection to prevent walking through walls\n\n### 📂 Graphics\n\n* Render walls column by column (raycasting)\n* Apply textures to walls and floors\n* Render elements dynamically on the screen\n* Continuously update the screen with player movement\n\n### 💬 Input \u0026 Interaction\n\n* Keyboard input for movement and rotation\n* Safe exit by closing the window or pressing ESC\n* Smooth screen updates for a better experience\n\n### ⚠️ Error Handling\n\n* Validate files and inputs\n* Handle loading and rendering errors\n* Avoid memory leaks and ensure proper file handling\n\n## 🛠️ Technical Constraints\n\n* ❌ No external graphics libraries except **MLX**\n\n* ✅ Must comply with **Norminette** rules:\n\n  * Max 25 lines per function\n  * Max 4 variables per function\n  * Max 4 arguments per function\n\n* 📁 Proper memory management to prevent leaks\n\n* 🔀 Smooth frame updates without freezing\n\n## ▶️ How to Use\n\n### 🛠️ First-Time Setup\n\nBefore using the project for the first time, you need to run the `setup.sh` script to install all required dependencies (like MLX and any required libraries).\n\nIf your system requires administrative privileges to install libraries, run the script with sudo:\n\n\n```bash\ncd Cub3D_42/\n```\n\n```bash\n./setup.sh\n```\n\nThis will check your system, install any missing libraries, and prepare the environment for CUB3D.\n\n### 🚀 Running CUB3D\n\nRun the game with:\n\n```bash\n./cub3d path/to/map.cub\n```\n\nA window will open displaying the 3D world where you can navigate using the keyboard.\n\n### 💡 Tips\n\n* Use **W/A/S/D** to move\n* Use **Arrow keys** to rotate\n* Close the window or press **ESC** to exit\n* Make sure your map files are valid before running\n\n### 🧪 Example Usage\n\n```shell\n./cub3d maps/map1.cub\n```\n\n* You can move within the map\n* Walls and floors are rendered in 3D\n* Wall collision prevents walking through walls\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdbentaleb%2Fcub3d_42","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdbentaleb%2Fcub3d_42","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdbentaleb%2Fcub3d_42/lists"}