vasekva / WTF-hmmm-is-this-a-minecraft

3D игра на языке Си по технологии RAYCASTING

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cub3D

Cub_bmp Cub_bmp

Summary

This project is inspired by the world-famous 90’s game Wolfenstein 3D, which was the first FPS ever. It uses the technique of ray-casting. The goal of this project is to make a dynamic view inside a maze, using colors, textures and sprites.

Compilation

Use the make command to compile using the Makefile.

Execution

play the game: ./cub3D [map_path]

./cub3D maps/standart.cub

save the first rendered image in a bmp format: ./cub3D [map_path] --save

./cub3D maps/standart.cub --save

Recommendations

The map file must be in *.cub format.

The textures must be in *.xpm format.

The colors must be in R,G,B format (each byte from 0 to 255).

All the following information must be present in the *.cub file:

  • R resolutionX resolutionY : window resolution
  • NO/SO/EA/WE R,G,B : color on either North, South, East or West wall
  • NO/SO/EA/WE texture_path : texture on either North, South, East or West wall
  • S texture_path : sprite texture
  • C/F R,G,B : color on ceiling and floor
  • C/F texture_path : texture on ceiling and floor (note that if the ceiling texture is named sky#.xpm, a skybox effect will replace the ceiling effect).
  • The map must be present and last in the file

The map must be in the following format:

  • 1s are walls
  • 0s are paths
  • 2s are sprites
  • N/S/W/E is the player start position and direction; must be present one and only once on the map
  • The map must be surrounded by 1s

Usage

  • W/A/S/D to move
  • Left/right arrows to turn
  • Shift to sprint
  • ESC to quit

About

3D игра на языке Си по технологии RAYCASTING


Languages

Language:C 73.2%Language:Objective-C 21.1%Language:C++ 3.6%Language:Makefile 2.2%