space-game-proto/obj/gameManager.py

40 lines
1.0 KiB
Python

from .player import Player
import tools
PLAYER_INIT_LOCATION = "Luna"
class GameManager:
'Manage the game'
def __init__(self, userInput, planets):
self.gameIsRunning = True
self.player = Player(userInput, PLAYER_INIT_LOCATION)
self.planets = planets
def isGameRunning(self):
return self.gameIsRunning
def stopGame(self):
self.gameIsRunning = False
def printPlayerStats(self):
tools.clearScreen()
print("Name: ", self.player.getName())
print("Location: ", self.player.getLocation())
print()
def enterTradeHub(self):
tools.clearScreen()
while True:
userInput = input("(e)xit\n\n(l)ist items\n>> ").lower()
if userInput == 'e':
tools.clearScreen()
break;
elif userInput == 'l':
tools.clearScreen()
self.planets[self.player.getLocation()].getTradeHub().printItems()
else:
tools.clearScreen()