Skip to content

xhazm/cub3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cub3D - 42 Heilbronn (May 2022)

RayCasting with miniLibX.

This project is inspired by the world-famous Wolfenstein 3D game.
It will enable you to explore ray-casting.
Your goal will be to make a dynamic view inside a maze, in which you’ll have to find your way.

This project was done as a group project with Esra Lenz
result

Contents

Short description of the project

This project’s objectives are similar to all this first year’s objectives: Rigor, use of C, use of basic algorithms, information research etc.

As a graphic design project, cub3D will enable you to improve your skills in these areas: windows, colors, events, fill shapes, etc.

To conclude cub3D is a remarkable playground to explore the playful practical applications of mathematics without having to understand the specifics.

With the help of the numerous documents available on the internet, you will use mathematics as a tool to create elegant and efficient algorithms.

Here you can see the result:

Animated GIF

Our cub3D

Requirements to run the game

only tested on macOS
For all other OS it is not guaranteed to work.
OpenGL and AppKit is required to run it.
If you want to run it on Linux here is a tutorial that might help and here is the required version of miniLibX, this is not tested with our cub3D.

How to cub3D

  1. run make in the root of the directory
  2. run ./cub3D maps/map in the root of the directory
  3. move the character with WASD
  4. interact with the environment with f or g

Things to enjoy

  • wall collition
  • moving hands while walking
  • fully customizable

back to Our cub3D
back to Contents

Map requirements

  • decide which texture is displayed on which side
  • 0 define walkable spaces
  • 1 define walls
  • T 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)
    • R defines where the rabbit is
  • 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
  • you have to set all the textures that should be used as wall texture i.e.
    • WE images/1.xpm
    • EA images/2.xpm
    • SO images/3.xpm
    • NO images/4.xpm
  • 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

back to Our cub3D
back to Contents

Texture requirements

The wall textures as well as the door texture is interchangeable, as long as:

  • the texture is 64 by 64 pixels
  • the texture is a .xpm file

If you want to change the windowsize, this can be done in the cub3d_define.h file.

back to Our cub3D
back to Contents

About

Raycasting game with minilibx

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published