This project is inspired by the world famous game Wolfenstein 3D, which was the first ever FPS game. With the use of Ray-Casting we created a dynamic view inside a maze in which you'll have to find your way.
cub3D_vid.mov
- Installed C compiler like gcc, clang or Cmake
- installed or compiled minilibx
install brew:
rm -rf $HOME/.brew && git clone --depth=1 https://github.com/Homebrew/brew $HOME/.brew && echo 'export PATH=$HOME/.brew/bin:$PATH' >> $HOME/.zshrc && source $HOME/.zshrc && brew update
install glfw:
brew update
brew install glfw
compile and run:
make
make run
control
- W: move forwards
- S: move backwards
- A: move left
- D: move right
- Arrow Key Left: rotate left
- Arrow Key Right: rotate right
- Mouse: rotation control (left-right)
- M: show mouse pointer
- H: hide mouse pointer
- ESC/Q: quit the game
map customization
- Navigate to directory /maps
- Set textures (directory /textures)
- Set RGB floor and ceiling colors
- Set player position on the map
-
Optimize FPS controller
-
Add more features:
- Moving enemies 👾
- Animated sprites 🌱
- Implement doors and portals 🟠🏃♀️🔵
- Implement weapons and life-management ⚔️
- Add menu and sound
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
Useful tutorial to understand ray casting: