def start(self): '''The entry method of the game''' Util.clear() Util.asciiArt() Util.printMessage('DO YOU NEED INSTRUCTIONS (YES/NO)') answer = Util.prompt() if answer != None and (lower(answer) == 'y' or lower(answer) == 'yes'): Help.displayHelp() else: Util.clear() Util.displayOrders(self.TotalKlingons, self.CurrentStarDate + self.RemainingStarDays, self.RemainingStarDays, self.TotalStarBases) answer = Util.prompt() self.isRestart(answer) self.displayAllRangeScan("") self.displayCondition() Util.displayCommands() while(True): self.command()
def command(self): '''Wait commands from the user ''' answer = Util.prompt() self.isRestart(answer) message = '' if lower(answer) == 'nav': message = self.Commands.navigationCommand(self) elif lower(answer) == 'pha': self.Commands.pahserCommand() elif lower(answer) == 'tor': self.Commands.torpedoCommand() elif lower(answer) == 'she': self.Commands.shieldCommand(self) elif lower(answer) == 'com': self.Commands.computerCommand(self) Util.clear() self.displayAllRangeScan(message) self.displayCondition() Util.displayCommands()