Skip to content

xThirteenIII/cpp-console-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpp-console-game

Table of Contents

Text adventure console game to train with OOP

Download and run game file

Download game file and run ./game in the terminal to start it.

Works on unix systems only (MacOS and Linux).

Will implement Windows support later in the future.

Compile and run

If you want to compile the game by yourself, in case the 'game' file doesn't work:

1) Install ncurses library first

---MacOS--- 🍎

Install with brew:

brew install ncurses

---Linux--- 🐧 (Ubuntu/Debian)

run this on terminal:

sudo apt-get install libncurses5-dev libncursesw5-dev

2) Install g++ compiler

check if g++ is already installed first with:

g++ --version

if it's not installed yet get developer tools:

sudo apt update

sudo apt install build-essential

the above meta-package installs the number of packages including g++ automatically, gcc, and make.

3) Compile file from the cpp-console-game directory

g++ -Wall -std=c++20 -o game -I./states -I./renderer -I./characters -I./ui -I./combat *.cpp ./states/*.cpp ./renderer/*.cpp ./ui/*.cpp ./characters/*/*.cpp ./combat/*.cpp -lncurses

4) Run from terminal

./game

Commands:

  • Use Arrow Up,Arrow Down,Arrow Left and Arrow Right to navigate menus
  • Use Enter to select
  • Use w, a, s, and d to move through the map
  • Shift + q to close the game or quit from Main Menu
  • Use p to pause game when playing
  • Ctrl + + to resize terminal window (Cmd + + on Mac) if the game map is too small

About

Simple text adventure game to train with OOP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published