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
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)!
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.
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).