Skip to content

Second graphical project at 42 School. We must build a raycasting graphical engine, and use it to remake a Wolfenstein 3D like game!

Notifications You must be signed in to change notification settings

ajealcat/42-cub3D

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42-cub3D

Goal

The second graphical project from 42. We have to create a game using a ray-casting algorithm, inspired by the infamous Wolfenstein 3D (1992), one of the first 3d fps game ever.

Mandatory Instructions

  • Your project must be written in C.
  • Your project must be written in accordance with the Norm. If you have bonus files/functions, they are included in the norm check and you will receive a 0 if there is a norm error inside.
  • Your functions should not quit unexpectedly (segmentation fault, bus error, double free, etc) apart from undefined behaviors. If this happens, your project will be considered non functional and will receive a 0 during the evaluation.
  • All heap allocated memory space must be properly freed when necessary. No leaks will be tolerated.
  • If the subject requires it, you must submit a Makefile which will compile your source files to the required output with the flags -Wall, -Wextra and -Werror, use cc, and your Makefile must not relink.
  • Your Makefile must at least contain the rules $(NAME), all, clean, fclean and re.
  • To turn in bonuses to your project, you must include a rule bonus to your Makefile, which will add all the various headers, librairies or functions that are forbidden on the main part of the project. Bonuses must be in a different file _bonus.{c/h}. Mandatory and bonus part evaluation is done separately.
  • If your project allows you to use your libft, you must copy its sources and its associated Makefile in a libft folder with its associated Makefile. Your project’s Makefile must compile the library by using its Makefile, then compile the project.
  • We encourage you to create test programs for your project even though this work won’t have to be submitted and won’t be graded. It will give you a chance to easily test your work and your peers’ work. You will find those tests especially useful during your defence. Indeed, during defence, you are free to use your tests and/or the tests of the peer you are evaluating.
  • Submit your work to your assigned git repository. Only the work in the git repository will be graded. If Deepthought is assigned to grade your work, it will be done after your peer-evaluations. If an error happens in any section of your work during Deepthought’s grading, the evaluation will stop.

How to Use

Clone the repository in the location of your choice, go inside it, then compile using make bonus command:

cd 42-cub3D
make bonus

You can then launch the program using ./cub3D_bonus, and the path of the map (.cub file) you want to play on:

./cub3D_bonus <*.cub>

If you want to modify the map, you just have to edit the .cub map located in the following path: /assets/maps/maps_bonus/. Here are the two main maps made to be played:

./cub3D_bonus assets/maps/maps_bonus/sasageyo.cub 

and

./cub3D_bonus assets/maps/maps_bonus/alien.cub  

Gameplay of alien map

In this map you will spawn in a spaceship.

start_alien

To win the game you will have to explore and find the cockpit.

alien_door

alien_babyroom

Be carefull there may be some aliens... As you can't fight them, you will have to run to dodge them !!!

alien_alien

If an alien touches you, you loose :C

alien_loose

Have fun and keep trying until you win ! :D

alien_win

Enjoy!

About

Second graphical project at 42 School. We must build a raycasting graphical engine, and use it to remake a Wolfenstein 3D like game!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 87.3%
  • Roff 8.6%
  • Makefile 3.1%
  • Other 1.0%