Skip to content

This is a pseudo 3d game written in C programming language, and running on the command line.

License

Notifications You must be signed in to change notification settings

Nikita-bunikido/3D-FPS-game-command-line

Repository files navigation

3D-FPS-game-command-line

languages count lines of code license stars count forks count yt subs count

Introduction

This is a pseudo 3d game written in C programming language, and running on the windows command line. Engine of this game uses RayCasting technology to draw lines on screen. It creates an illusion of a 3 dimensional game, but really it is only a 2d map.

Alt text


Installation (Windows 10)

It works stably on the Windows 10 command line. In earlier OS versions, updating the command line may be slow.

  • Step 1 - clone repository

First of all you need to clone repository. The following command to do it:

git clone https://github.com/Nikita-bunikido/3D-FPS-game-command-line.git
  • Step 2 - compile it for yourself

You can do it like that:

cd 3D-FPS-game-command-line
mingw32-make

After that you have a solved .exe file:

./NSHOOT.exe
  • Step 3 - setting up multiplayer

If you want to play online with your friend, you need to setup a multiplayer. Your computer and a friend's computer must necessarily be connected to the same local network to play online. Then on your computer in menu of the game you need to choose 's' - Server. And your friend need to choose 'c' - Client. Your friend need to know your IPv4 adress. If you don't know it, open the command line (Win + R), write cmd and paste the command:

ipconfig

Then write this adress on client and enjoy!

If you want to play offline write 'o' - Offline in the menu.

Management

Basic management:

W A S D SPACE
go ahead go left go back go right shoot

Mouse for camera rotation.

Features

  • All walls textures now in folder 3D-FPS-game-command-line\RES\ You can change it, and after that it will change in the game. It can be avaiable by .txt files parser, integrated in this repository.

  • Now you can generate a brightness chars in textures.

=======
=     =
=  ~  =
= ~1~ =
=  ~  =
=  ;  =
=======

This is a texture. It will be the same in game.

4444444
4     4
4  ~  4
4 ~1~ 4
4  ~  4
4  ;  4
4444444

And this is a texture, but 4 and 1 will be visible like chars with brightness 4 and 1.

You can use these characters to make a brigthess chars: 1234


Version 1.0

Added:

  • Basic Ray-Casting algorithm
  • Color depth
  • Management
  • Sky with stars
  • Basic floor

Here is some demonstration of how does it work:

Ray-Casting algorithm:

Alt text

Working depth of color:

Alt text

Randomly generated stars:

Alt text


Version 2.0

Added:

  • Textured walls
  • Volumetric 3D floor
  • Weapon layout
  • More than one texture on map
  • Bugs fixed

Here is some demonstration of how does it work:

5x5 textured walls:

Alt text

Weapon overlay:

Alt text

Working 3D floor:

Alt text


Version 3.0

Now you can play with your friends. In version 3.0 added a local network multiplayer.

Added:

  • Local network multplayer
  • More textures on walls
  • Menu
  • Reworked weapon
  • Fixed bugs

Here is some demonstration of how does it work:

7x7 textures:

Alt text

ASCII weapon. (Probel to shoot):

Alt text

Multiplayer test:

Alt text

Version 3.1.0

Added:

  • Ray-casting small optimization
  • Kills count
  • Fish-eye effect fixed
  • Collision detection (beta)
  • Fixed bugs

Here is some demonstration of how does it work:

Fixed fish eye effect (now walls are flat):

Alt text

Also added a kills count (works with multiplayer):

Alt text

Collision detection also working, but not perfect for now. We will rework it later.

Enjoy!

About

This is a pseudo 3d game written in C programming language, and running on the command line.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published