예제 #1
0
파일: game.py 프로젝트: NoYzE1/cRPG
 def main():
     action = input("\nChoose an action: (status, move, save, rest, exit) ")
     if action == "status":
         Playerinfo.status()
         Game.main()
     elif action == "move" or action == "m":
         Actions.move()
         if Player.isAlive:
             Game.main()
         else:
             IO.death()
             Game.start()
     elif action == "rest" or action == "r":
         Actions.rest()
         Game.main()
     elif action == "save":
         IO.save()
         print("Game saved!")
         Game.main()
     elif action == "exit" or action == "q" or action == "quit":
         answer = input("Are you sure you want to quit? (y/n) ")
         if answer == "y":
             IO.save()
             IO.quit()
         else:
             Game.main()
     else:
         print("\nTry again!")
         Game.main()
예제 #2
0
파일: game.py 프로젝트: NoYzE1/cRPG
 def start():
     mode = input('\nCreate "new" or "load" existing character or "exit" Game? ')
     if mode == "new":
         Newgame.newCharacter()
         IO.save()
         print("\nDone.")
         Game.main()
     elif mode == "load":
         IO.load()
         if Player.isAlive == True:
             print("\nCharacter "+Player.name+" loaded")
             Game.main()
         else:
             print("The character is dead!")
             Game.start()
     elif mode == "exit" or mode == "q" or mode == "quit":
         IO.quit()
     else:
         print("Try again!")
         Game.start()