diff --git a/main.py b/main.py index c6bc856..631845c 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,5 @@ import os -PLAYER_NAME = "jack" PLAYER_INIT_LOCATION = "1" class Player: @@ -11,15 +10,18 @@ class Player: def getName(self): return self.name + def setName(self, name): + self.name = name + def getLocation(self): return self.location class GameManager: 'Manage the game' - def __init__(self): + def __init__(self, userInput): self.gameIsRunning = True - self.player = Player(PLAYER_NAME, PLAYER_INIT_LOCATION) + self.player = Player(userInput, PLAYER_INIT_LOCATION) def isGameRunning(self): return self.gameIsRunning @@ -32,13 +34,14 @@ class GameManager: print("Location: ", self.player.getLocation()) print() - def clearScreen(self): - os.system('clear') +def clearScreen(): + os.system('clear') -def mainMenu(): +def titleScreen(): while(True): - os.system('clear') + clearScreen() + print("Space Game Title To Be Disclosed!!!") userInput = input("(n)ew game (q)uit:\n>> ").lower() if userInput == "q": @@ -46,14 +49,18 @@ def mainMenu(): if userInput == "n": mainGame() - def mainGame(): - Game = GameManager() userInput = "" + + userInput = input("What is your name... peasant?") + + if userInput == "": + userInput = "(none)" + + Game = GameManager(userInput) - - Game.clearScreen() + clearScreen() while Game.isGameRunning(): userInput = input("(q)uit (p)layer stats (c)lear screen:\n>> ").lower() @@ -65,12 +72,9 @@ def mainGame(): Game.printPlayerStats() if userInput == "c": - Game.clearScreen() + clearScreen() def main(): - mainMenu() + titleScreen() main() -# Main menu should be start game or quit -# game running should be false until start -# ending the game shoudl return to the main menu