Giter Site home page Giter Site logo

cub3d's Introduction


CUB3D

A network 42 project inspired by the world-famous game Wolfenstein3D. With as goal of the project a exploring raycasting and working with a very basic graphics library.


How to compile and run the program

  1. Clone this git repository
    git clone https://github.com/salbregh/CUB3D.git

  2. Go into the root of the directory
    cd CUB3D

  3. Run the make command, which will compile the source code
    make

  4. To execute the program you need type in the executable name followed by a .cub file, this file consists a map.
    ./cub3D map.cub

The program

The program will open in a new window. Here you will be able to walk around in the map.

Use the left and right arrow to rotate the view of the player.



Use the WASD keys to move the player forwards, back, left and right.

Map Parsing

A big part of this program is to validate the map before parsing. The following rules must be applied:
  • the map must be composed of only 7 possible characters: 0 for empty space, 1 for a wall, 2 for sprits (objects) and N S E or W for the player's start position
  • the map must be surrounded by walls * except for the map content, each type of element can be seperated by one or more empty lines
  • except for the map content which always has to be last, each type of element can be set in any order in the file
  • Except for the map, each type of information from an element can be separatedby one or more space
  • Each element (except the map) firsts information is the type identifier, followed by all specific informations for each object in a strict order such as : NO ./path_to_north_texture
If a misconfiguration is encountered in the map, the program must return an error message.

Future goals for this project

As the project is now a very simplistic version of the game, I would like to add in more features to make it more like the actual wolfenstein3D. Think of adding a shooter, enemies and opening doors to different rooms.

Possible errors

You might get the following error
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

If this occurs, install the following:
xcode-select --install

cub3d's People

Contributors

salbregh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.