示例#1
0
    def startNewGame(self):

        print("Starting a new game...")
        print("Creating player...")
        self.player = player.Player()
        self.player.equip(generateNextWeapon(self.player.weapon))
        file_manager.saveGame(self.player)
        #self.setDifficulty()
        self.player.intro()
        #self.player.difficulty = self.difficulty
        self.findKitten()
        self.running = True
示例#2
0
    def startNewGame(self):

        print("Starting a new game...")
        print("Creating player...")
        self.player = player.Player()
        self.player.equip(generateNextWeapon(self.player.weapon))
        file_manager.saveGame(self.player)
        # self.setDifficulty()
        self.player.intro()
        # self.player.difficulty = self.difficulty
        self.findKitten()
        self.running = True
示例#3
0
    def run(self):

        print(self.version)
        print("Press Ctrl + C to quit.")
        self.tryLoadExistingSave()

        while self.running:
            print()
            self.beginningOfTurnPrompt()
            choice = input("\n:")
            if choice.isdigit() and (int(choice) - 1 in range(len(self._turn_choices))):
                index = int(choice) - 1
                key_list = sorted(self._turn_choices.keys())
                chosen_key = key_list[index]
                method = self._turn_choices.get(chosen_key)
                method()
            if self.running:
                file_manager.saveGame(self.player)
示例#4
0
    def run(self):

        print(self.version)
        print("Press Ctrl + C to quit.")
        self.tryLoadExistingSave()

        while self.running:
            print()
            self.beginningOfTurnPrompt()
            choice = input("\n:")
            if choice.isdigit() and (int(choice) - 1 in range(
                    len(self._turn_choices))):
                index = int(choice) - 1
                key_list = sorted(self._turn_choices.keys())
                chosen_key = key_list[index]
                method = self._turn_choices.get(chosen_key)
                method()
            if self.running:
                file_manager.saveGame(self.player)
示例#5
0
            print()
            self.beginningOfTurnPrompt()
            choice = input("\n:")
            if choice.isdigit() and (int(choice) - 1 in range(
                    len(self._turn_choices))):
                index = int(choice) - 1
                key_list = sorted(self._turn_choices.keys())
                chosen_key = key_list[index]
                method = self._turn_choices.get(chosen_key)
                method()
            if self.running:
                file_manager.saveGame(self.player)


if __name__ == "__main__":
    if (sys.version_info) < (3, 4):
        print("Incorrect version. Python 3.4 or later needed.")
    else:
        try:
            game = Game()
            game.run()
        except KeyboardInterrupt:
            if game.running:
                file_manager.saveGame(game.player)
            print(game.version)
            print("\n\tBye!\n\n")
        except:
            print(game.version)
            logging.exception("Something happened ...")
    input("Press ENTER to quit")
示例#6
0
        while self.running:
            print()
            self.beginningOfTurnPrompt()
            choice = input("\n:")
            if choice.isdigit() and (int(choice) - 1 in range(len(self._turn_choices))):
                index = int(choice) - 1
                key_list = sorted(self._turn_choices.keys())
                chosen_key = key_list[index]
                method = self._turn_choices.get(chosen_key)
                method()
            if self.running:
                file_manager.saveGame(self.player)


if __name__ == "__main__":
    if (sys.version_info) < (3, 4):
        print("Incorrect version. Python 3.4 or later needed.")
    else:
        try:
            game = Game()
            game.run()
        except KeyboardInterrupt:
            if game.running:
                file_manager.saveGame(game.player)
            print(game.version)
            print("\n\tBye!\n\n")
        except:
            print(game.version)
            logging.exception("Something happened ...")
    input("Press ENTER to quit")