Skip to content
/ cub3d Public
forked from ElPatatin/cub3d

A 3D engine using ray-casting technique, project by @LAG-jara & @ElPatatin

License

Notifications You must be signed in to change notification settings

LAG-jara/cub3d

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cub3d

By @LAG-jara & @ElPatatin

Description

cub3d is a simple 3D game engine project that uses the Raycasting technique. It is inspired by the classic game Wolfenstein 3D. The project is part of the 42 Network curriculum.

Features

  • Raycasting for rendering a 3D perspective
  • Textured walls and sprites
  • Basic movement controls (forward, backward, strafe left, strafe right)
  • Basic mouse camera rotation (must mantain the mouse button 1 pressed)
  • Collision detection with walls
  • Support for reading map configurations from a file
  • Basic error handling and reporting

Prerequisites

  • Requirements for MacOs

    • clang
    • make
    • This native version no longer uses X.org, XQuartez or X11 but uses Mac OSX's Cocoa (AppKit) and modern OpenGL features.
  • Requirements for Linux

    • MinilibX only support TrueColor visual type (8,15,16,24 or 32 bits depth)
    • gcc
    • make
    • X11 include files (package xorg)
    • XShm extension must be present (package libxext-dev)
    • Utility functions from BSD systems - development files (package libbsd-dev)
    • e.g. sudo apt-get install gcc make xorg libxext-dev libbsd-dev (Debian/Ubuntu)

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/cub3d.git
  2. Build the project:

    make

Usage

  1. Run the cub3d executable:
    ./cub3d path/to/map.cub

Replace path/to/map.cub with the path to your map configuration file.

  1. Enjoy playing around with the simple 3D engine!

Map Configuration

cub3d uses a simple map configuration file with specific parameters. Refer to the provided basic.cub file for an example.

Controls

  • W: Move forward
  • S: Move backward
  • A: Strafe left
  • D: Strafe right
  • ←: Look left
  • →: Look right
  • ESC: Exit the game
  • Mouse:
    • ←: Look left
    • →: Look right

Screenshots

Dungeon.cub basic1.cub basic2.cub

Known Issues

NONE 😇

License

This project is licensed under the MIT License.

About

A 3D engine using ray-casting technique, project by @LAG-jara & @ElPatatin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 83.8%
  • Objective-C 6.9%
  • Roff 5.0%
  • Makefile 4.1%
  • Perl 0.2%