Skip to content
/ Cub3D Public

A raycasting game engine reprogrammed from scratch using C language, inspired by the world's first 3D game.

License

Notifications You must be signed in to change notification settings

Ysoroko/Cub3D

Repository files navigation

Cub3D

A raycasting game engine programmed in C from scratch, inspired by the world's first 3D game

The project implements:

  • The parsing of a map file
  • The use of a basic graphic library
  • A functionality which allows us to save a screen shot of the image on screen in a "bmp" format
  • The raycasting physics engine allowing us to see 2D calculations as a 3D world around us
  • A HUD containing a minimap
  • Healthbar and traps
  • Enemies and an animated weapon
  • Distance related shadow effect
  • Secret corridors
  • The skybox and a floor texture
  • Collisions with walls and some objects
  • Background music and sounds
  • A game over level

Amazing links that helped me to create this project:

Try it:

❗ This project was optimized for a local use and may not work properly in other environments.

If you wish to try it, here are the Makefile commands you need to use in the terminal while in project's repo directory:

  • make will compile the basic project (without the enemies / shadows etc.) and create the "cub3D" executable

  • make bonus will do the same but will include the bonus part

  • With "cub3D" executable created, you can launch the game with any of the .cub map files in "maps" folder.

    Example: ./cub3D maps/map9.cub

  • make fclean is used to clean up all of the files created using the compilation

  • make run will launch the project without any bonuses

  • make brun will launch the project with the bonuses

  • make save will launch the project and save the first image on screen in a "bmp" format, then it will close the project window

  • WASD or Up/Down arrow keys to move, QE or Left/Right arrow keys to look left/right, SPACEBAR to attack using the weapon

  • Escape key to quit the game

Licensing Notes:

  • All music and sounds were free ressourses downloaded from zapsplat.com
  • The hand with the knife is a modified image from the Wolfenstein 3D, all rights belong to id Software
  • The rest of the used sprites and textures were drawn by myself using Pixaki on iPadOS

About

A raycasting game engine reprogrammed from scratch using C language, inspired by the world's first 3D game.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published