GithubHelp home page GithubHelp logo

loisduplain / cub3d Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 18.91 MB

Cub3D is a game engine written in C. It is inspired by one of the first FPS Wolfenstein3D.

Makefile 3.23% C 90.23% Objective-C 6.54%
cub3d 3d-rendering 2d-map-parsing game 42 c fov pixel-divider texture parsing

cub3d's Introduction

🧱 cub3D 🎥

platform: osx 10.14.x language: c framework: opengl framework: appkit library: minilibx library: best-libft 42 login: lduplain

Cub3D is a game engine written in C. It is inspired by one of the first FPS Wolfenstein3D.
Created by Loïs Duplain. (42login: lduplain, 42mail: [email protected])

🖼️ Gallery

Gource (click on image):

Screenshot - Map: ./maps/debug.cub

Screenshot - Map: ./maps/minecraft.cub

Screenshot - Map: ./maps/white-chamber.cub

🏗️ Compile

To basically compile program:

make

To recompile entire program:

make re

To clean all *.o in project:

make oclean

To clean all *.o in project and libraries:

make clean

To clean all *.o and compiled things in project and libraries:

make fclean

▶️ Run

To basically run:

./cub3D <map_path_1> <map_path_2> <map_path_...>                (default maps in ./maps folder)

Automatically save first frame:

./cub3D <map_path_1> <map_path_2> <map_path_...> --save         (default maps in ./maps folder)

🎮 Controls (QWERTY)

Player movement:

W A S D

Camera rotation:

▲ ▼ ► ◄

Screenshot:

F2

Previous/next level:

< / >

Decrease/increase render distance:

K / L

Decrease/increase pixel divider:

Page Down / Page Up

Decrease/increase FOV:

NumPad Sub / NumPad Add

📝 Parsing

Resolution:

R <width> <height>

Example:
R 1920 1080

Walls:

NO --> North Wall
SO --> South Wall
WE --> West Wall
EA --> East Wall

You can put texture or color on wall:

XX  <r,g,b>
XX  <path>.xpm

Example:
XX  31,219,81                    --> Green
XX  ./textures/debug/north.xpm   --> Path to texture (default textures in ./textures folder)

Floor/ceiling:

F --> Floor
C --> Ceiling

You can put texture or color on floor/ceiling:

F  <r,g,b>
C  <path>.xpm

Example:
F 255,0,0                        --> Red
C ./textures/debug/ceiling.xpm   --> Path to texture (default textures in ./textures folder)

Map description:

2     --> Sprite
1     --> Wall
0     --> Walkable
Space --> Void
N/S/W/E (North / South / West / East) --> Player spawn point and direction

Example:
1111111111111
1000000000001
1200000000021
1001010101001
120000S000021
1001010101001
1200000000021
1000000000001
1111111111111

✨ Bonuses

  • Look up and down
  • Texture on ground and ceiling
  • Collide with walls
  • Collide with sprites
  • Fog
  • Multi level
  • Changing FOV in-game
  • Crosshair
  • Minimap
  • Move camera with mouse
  • Multi threading
  • Replace texture by color in parsing
  • Changing render distance in-game
  • Changing pixel divider in-game
  • Max frames per second and ticks per second
  • Take a screenshot

🖥️ 42

Subject

Mark: 42-project-mark

⚖️ Copyright

Loïs Duplain (lduplain) © 2020

cub3d's People

Contributors

loisduplain avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.