Skip to content

afonsopc/cub3d

Repository files navigation

cub3d

This branch contains the game version available at omelhorsite.pt.

Developed by Afonso Coutinho and Paulo Cordeiro.

Wolfenstein 3D Gameplay

About the Game

Cub3D is a project inspired by the classic Wolfenstein 3D, developed as part of the 42 curriculum.

The project explores mathematical concepts of raycasting to simulate a three-dimensional environment on a 2D screen, handling textures, collisions, audio, controller integration (Xbox, PlayStation, etc.), simple AI algorithms for enemies, and more.

The project features two main maps:

  • 🏫 42 Lisboa: A 3D version of the 42 Lisboa campus that you can explore.
  • 🕹️ Wolfenstein 3D: A complete first-person shooter with enemies, weapons, collectibles, elevators, the first two floors from the original game, and a secret bonus floor.

Web Version

The game also runs on the web using SDL and Emscripten, making it easy to play in the browser.

You can play it here: https://omelhorsite.pt/en/games/cub3d

42 Lisboa Campus

How to Compile

Desktop Version (Linux/macOS)

To compile the native version of the game run:

make

To run the game, you can provide a map as an argument or not and it will open hub.cub:

./cub3d [path/to/map.cub]

Web Version (Emscripten)

To compile the web version (WASM), you need to have the Emscripten environment configured. Run:

make -f emcc.Makefile

This will generate the cub3d.html, cub3d.js, and cub3d.wasm files to run the game in the browser.

About

A Wolfenstein 3D clone made in C

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •