gjupy / cub3d

My first RayCaster with the MLX42 lib.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cub3d

My first RayCaster.
This project is inspired by the world-famous Wolfenstein 3D game, which was the first FPS ever. The goal was to make a dynamic view inside a maze.

Usage

Requirements to run the game

only tested on macOS Catalina (Version 10.15.7)
For all other OS it is not guaranteed to work.
OpenGL and AppKit is required to run it.
Click here for more information about the installation.

Map requirements

  • decide which texture is displayed on which side
  • 0 define walkable spaces
  • 1 define walls
  • 2 define doors
  • the players position is displayed by:
    • N player is facing north (top of the 2D map)
    • E player is facing east (right side of the 2D map)
    • S player is facing south (bottom of the 2D map)
    • W player us facing west (left side of the 2D map)
  • the map has to be enclosed by walls on all sides
  • doors have to have walls on two opposite sides
  • any other characters other than the ones above are forbidden
  • if there is a (space) inside the map it has to be enclosed by walls, as you can see here
  • only one player position is allowed
  • you have to set all the textures that should be used as wall texture i.e.
    • NO ./textures/path_to_the_north_texture/wall_text.png
    • SO ./textures/path_to_the_south_texture/wall_text.png
    • WE ./textures/path_to_the_west_texture/wall_text.png
    • EA ./textures/path_to_the_east_texture/wall_text.png
  • you have to set the ceiling color, i.e.:
    • C 0, 183, 183
  • you have to set the floor color, i.e.:
    • F 141, 1, 126

How to run the game

  1. run make in the root of the directory
  2. run ./cub3D game.cub in the root of the directory
  3. move the character with WASD
  4. turn the FOV left and right by pressing arrow_left and arrow_right or by moving the mouse right or left

All the visualization is done with the help of the MLX42 library.

About

My first RayCaster with the MLX42 lib.


Languages

Language:C 89.8%Language:C++ 6.5%Language:Objective-C 1.3%Language:Python 1.2%Language:Makefile 0.7%Language:Batchfile 0.2%Language:Shell 0.2%Language:GLSL 0.1%