Example #1
0
def printRoomStateOrDescription(player):
    # get and print room description or state
    roomState = db.getRoomState(player.roomID)
    if roomState is not None:
        print("--\n{}".format(roomState))
    else:
        roomDescription = db.getRoomDescription(player.roomID)
        print("--\n{}".format(roomDescription))
Example #2
0
import functions.commands as command
import functions.database as db

if db.testConnection():
    player = db.getPlayer()

f = open('ASCII/StartScreen_UTF-8.asc', 'r')
print(f.read())
f.close()

roomState = db.getRoomState(player.roomID)
if roomState is not None:
    print("--\n{}".format(roomState))
else:
    roomDescription = db.getRoomDescription(player.roomID)
    print("--\n{}".format(roomDescription))

while True:
    '''
    You can end loop by selecting 5 in main context or write
    "quit" in game context.
    '''

    context = command.doMenu()

    while context == "main":
        # validate to player that we are in correct context
        prompt = "(main) >>> "
        try:
            # in main menu context we catch only integers as commands