https://github.com/nicolasgasco/42_cub3d
Group project done by @nicolasgasco and @isolinis. A small Wolfenstein-inspired video game done with raycasting and MiniLibX.
https://github.com/nicolasgasco/42_cub3d
3d c game minilibx raycasting
Last synced: 7 months ago
JSON representation
Group project done by @nicolasgasco and @isolinis. A small Wolfenstein-inspired video game done with raycasting and MiniLibX.
- Host: GitHub
- URL: https://github.com/nicolasgasco/42_cub3d
- Owner: nicolasgasco
- Created: 2022-05-07T18:33:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-17T10:42:09.000Z (about 3 years ago)
- Last Synced: 2025-01-15T01:44:31.031Z (9 months ago)
- Topics: 3d, c, game, minilibx, raycasting
- Language: C
- Homepage:
- Size: 2.18 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cube3D
42 group project done by [@nicolasgasco](https://github.com/nicolasgasco) and [@isolinis](https://github.com/isolinis). Small 3D video game inspired by _Wolfenstein 3D_ that leverages [raycasting](https://en.wikipedia.org/wiki/Ray_casting) to create a sense of tridimensionality. Written in C using 42's own graphical API [miniLibX](https://harm-smits.github.io/42docs/libs/minilibx/getting_started.html).
## Project breakdown
The project roughly involved:
- Parsing and validating the scene description file passed as argument to the program, as shown in this example:
```
// Textures according to orientation
NO ./path_to_the_north_texture
SO ./path_to_the_south_texture
WE ./path_to_the_west_texture
EA ./path_to_the_east_texture
// Floor and ceiling colors
F 220,100,0
C 225,30,0
// Map
111111
100001
111111
```
- Transforming the data in a way that can be easily fed to the graphical API
- Doing the raycasting calculation to render the scene
- Adding player movement## Features
- Customizable textures (XPM) that vary according to orientation (North, South, West, East)
- Customizable ceiling and floor colors
- Player movement (vertical with `W` and `S`, horizontal with `A` and `D`)
- View rotation with left and right arrow keys in mandatory (`src` folder) and by moving the mouse horizontally in bonus (`bonus` folder).## Run the program (macOs only)
```
git clone https://github.com/nicolasgasco/42_cub3d.git
cd 42_cub3d# For mandatory (player rotation with arrow keys)
make
./cub3D /maps/scene.cub# For bonus (player rotation with mouse)
make bonus
./cub3D_bonus /maps/scene.cub
```