Code Monkey home page Code Monkey logo

cub3d's Introduction

cub3D

Summary

This project involves creating a small 3D game, using a graphics library called miniLibX. The game is a maze where the player moves around and can look in different directions, with walls and textures displayed in a 3D perspective.

Instructions

This project has been developed under certain constraints and requirements, which include:

  1. Using miniLibX Graphics Library.
  2. Setting the floor and ceiling colors to two different ones.
  3. Displaying different wall textures that vary depending on which side the wall is facing (North, South, East, West).
  4. Allowing smooth management of the window: changing to another window, minimizing, etc.
  5. Allowing the user to use the keyboard to look left and right in the maze and to move the point of view through the maze.
  6. Allowing the user to close the window and quit the program cleanly using either the ESC key or by clicking on the red cross on the window's frame.
  7. Parsing a scene description file with the .cub extension, which includes a map composed of only six possible characters: 0 for an empty space, 1 for a wall, and N, S, E, or W for the player's start position and spawning orientation.

Usage

To run the program, use the following command:

./cub3D <path/to/map.cub> 

Replace <path/to/map.cub> with the path to your scene description file with the .cub extension.

Scene description file

The scene description file must follow specific rules and formats, including:

  • A map composed of only six possible characters: 0 for an empty space, 1 for a wall, and N, S, E, or W for the player's start position and spawning orientation.
  • The map must be closed/surrounded by walls, or the program must return an error.
  • Each element in the file (except the map) must have a type identifier, followed by specific information for each object in a strict order.
  • Each element (except the map) can be separated by one or more empty line(s).
  • Each type of element can be set in any order in the file, except for the map which always has to be the last.
  • Each type of information from an element can be separated by one or more space(s).

Example of a valid scene:

NO ./path_to_the_north_texture

SO ./path_to_the_south_texture

WE ./path_to_the_west_texture

EA ./path_to_the_east_texture

F 220,100,0
C 225,30,0


1111111111111111111111111
1000000000110000000000001
1011000001110000000000001
10010000000000000000000011111111
111111111011000001110000000000001
100000000011000001110111111111111
11110111111111011100000010001
11110111111111011101010010001
11000000110101011100000010001
10000000000000001100000010001
10000000000000001101010010001
11000001110101011111011110N0111
11110111 1110101 101111010001
11111111111111111111111111111

Authors

CUB3D was created by UGOI and jide_O as part of the 42 school curriculum.

cub3d's People

Contributors

ugoi avatar jideogunlana avatar

Stargazers

 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.