# instantiate objects from imported Person class player = Person("Knight", 150, 50, 50, magic_list) enemy = Person("Vampire", 100, 100, 20, magic_list) # clear terminal and game begins os.system("cls") # game title print(""" ############################### ## Welcome to Castle Crawler ## ############################### """) # print stats before battle begins player.stats() enemy.stats() # loop starts running = True while running: print("================") print(f"\t {player.name.upper()}") print("Choose your action: ") player.choose_action() choice_input = input("Choose a number >>> ") index = int(choice_input) - 1 print(f"You chose {player.action[index]}") # physical attack if index == 0:
from magoc import Magic print("This is the instruction.....") #Magic fire = Magic ("Fire", 10,30,"dark") wind = Magic ("Wind", 15, 50, "dark") ice = Magic ("Ice", 20,70, "dark") magic_list = [fire,wind,ice] player = Person("Daniel", 500, 100, 50, magic_list) enemy = Person("Vampire", 1000, 100, 20, magic_list) player.stats() enemy.stats() print("-----------------------------") running = True while running: #Player's turn print(player.name) print("Choose your action: ") player.choose_action() try: choice = int(input(">>>: ")) except ValueError: print("Choose a number") continue action_index = choice - 1 if action_index == 0: