https://github.com/akamlah/42-cub3d
Simple raycasting engine
https://github.com/akamlah/42-cub3d
optimization-methods raycasting
Last synced: 11 months ago
JSON representation
Simple raycasting engine
- Host: GitHub
- URL: https://github.com/akamlah/42-cub3d
- Owner: akamlah
- Created: 2022-01-24T08:55:11.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-13T14:21:44.000Z (almost 3 years ago)
- Last Synced: 2025-01-25T19:08:32.693Z (over 1 year ago)
- Topics: optimization-methods, raycasting
- Language: C
- Homepage:
- Size: 22.5 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 42-Cub3d
Simple raycasting engine written entirely in C, with configurable map and wall textures.
## Building
At the root of the repository:
```
make bonus
./cub3d example.cub
```
This compiles and runs the game using an example configuration file.
You can now move through the maze rendered by our raycasing engine and enjoy the animated portal doors, using WASD keys or your mouse.
Press TAB to get a minimap with your current location.
## Config file
The file has to be a textfile with extesion ```.cub```
The first four lines are the wall textures, one for every orientation:
* SO the textures for the south exposed walls
* WE for the ones exposed to west
* EA the eastern ones
* NO the north facing walls
Example:
```SO <\n> ```
Lines preceded by ```F``` are parsed as RGB values for the floor color, lines preceeded by ```C``` are decoded as ceiling color.
The map follows. It has to be free of newlines, ```0``` encodes walkable space, ```1``` a wall, Space a void in the map. All walkable sapces have to be enclosed by walls.
A capital letter, ```N```, ```E```, ```S``` or ```W```, placed in a walkable area, encodes the spawnpoint of the player and its initial geographical facing direction.
Have fun building the most itricated maze!