Code Monkey home page Code Monkey logo

cub3d's Introduction

cub3d

Small 3D game using raycastig. It only allows you to move around the map you created. So there are no enemies or an objective. During this project we learned about raycasting, rendering images, floodfill and working together with git branches.

Original Wolfenstein 3D:

image

Copyright Notice

The image(s) used in this project/website are derived from the Wolfenstein game, which is the copyrighted property of "id Software" and others. The use of these images is solely for educational purposes and is not intended for commercial gain. All rights to the original content, including images, logos, and trademarks, are owned by the respective copyright holders. The inclusion of these images in this project/website does not imply endorsement or affiliation with the original creators. If you are the copyright owner and have concerns about the use of any material, please contact us, and we will promptly address the issue.

Our project:

Screenshot from 2023-12-15 13-06-19

You have the flexibility to choose any color for the floor and ceiling by adjusting the RGB values in the map file. Additionally, you can customize wall textures by editing the map file and providing an XPM file for the desired texture.

Instructions

Make sure you a have:
- c-compiler cc
- X11 library
- minilibx_linux from 42 (https://github.com/42Paris/minilibx-linux)

  1. Clone the repository
  2. Run the make command to compile
  3. Execute the programm: "./cubed your_map_file"
  4. Have fun and good luck

Run the default map:

git clone [email protected]:SuQuoc/Philosophers.git
cd cub3d
make run

Usage

./cub3d [map_file.cub]

In addition to the map layout you can change following attributes by editing the map file:

  • color of the floor
  • color of the ceiling
  • texture of the walls in all cardinal directions

Example:

NO map_textures/north_texture  
WE map_textures/west_texture  
SO map_textures/south_texture  
EA map_textures/east_texture  
C 0,0,255  
F 255,0,0

1111111111111111111111111
1000000000110000000000001
1011000001110000000000001
1001000000000000000N00001
1111111111111111111111111

Controls

  • W, A, S, D
  • left and right arrow key to rotate view
  • ESC and "X-button" on top right window corner to end the game

cub3d's People

Contributors

suquoc avatar annafiona avatar

Watchers

 avatar

cub3d's Issues

check if the map is valid

INFORMATION:

  • map content is always last
  • any other info:

-- can be separated by any amount of newlines

-- can be separated by any amount of spaces

-- Spaces are a valid part of the map and are up to you to handle. You must be able to parse any kind of map, as long as it respects the rules of the map.

CHECKER:

  • check the file ending
  • check correct paths for textures
  • check rgb range for C and F
  • check that map
  • checking that the map is encircled by walls (convert to 2d char array)

Useful to check if all parameters are present before checking anything further?

FUNCTIONS:

  • is_whitespace() from libft
  • skip_whitespaces
  • compare file-ending .cub (is map.cub.cub allowed?)

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.