krustowski / textovka-tui

python3.7 npyscreen TUI concept

Home Page:https://text.n0p.cz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

textovka TUI

python3.7 TUI client for PHP REST API text-based game v1

API endpoint:
https://text.n0p.cz/

API documentation:
https://github.com/krustowski/textovka-api

Running the TUI

Docker

Just install docker engine, clone this repo and run the project:

make run

If you want to end, just hit CTRL-C to exit the game.

If your game ended somehow (you died, or you won), just remove tmp/apikey file in the cloned repository and start again (but with different nickname this time)!

Other (legacy)

Make sure your python3 environment is all set up first:

./setup.py
python3 setup.py

Then just run the main.py script, choose a nickname and start the game!

./main.py
python3 main.py

By performing a registration (script is prompting for a nickname) a new file called apikey is created in the actual working directory. The file will contain the unique API key used for sending game actions and retrieving the actual player data.

TUI preview

When successfully registred, the initial room properties are loaded and shown on screen (no ping info at this moment):

_

In every room, all four default actions (directions) are available even though they do not have to be implemented in the map ("There is no such way in this room."). Actions can be map-defined, here climb-up action is loaded from the map:

_

It is also possible to define trap rooms like well room in the figure below. One is stuck in there, drowning and dying -> hp fall:

_

After death (hp = 0), one is not able to continue and has to quit the game (Control-C is a possible way to exit the TUI).

_

About

python3.7 npyscreen TUI concept

https://text.n0p.cz

License:MIT License


Languages

Language:Python 90.7%Language:Dockerfile 4.8%Language:Makefile 3.1%Language:Shell 1.3%