I need help making my fight menu work. I’m trying to make it so if you use an item or use a weapon, you deal damage and get sent back to the fight screen, if that makes sense. I also want to be able to have a back option that sends you back to the screen where you select what you do. Also, when in battle mode, when i try to press back after dealing damage, it gives me an error.
import random
enemy = random.choice(enemy_options)
print("An enemy appears: {}".format(enemy))
battle_choice = input("What would you like to do?\n1. Fight\n2. Use Item\n3. Defend\n4. Run\n5. Hide\n ")
if battle_choice == "4":
print("You run away and escape.")
continue
if battle_choice == "1":
fight_choice = input("What attack item would you like to use?\n1. Wooden Stick\n2. Back\n")
if fight_choice == "2":
continue
if fight_choice == "1":
print("The stick did 10 damage!")
fight_choice = input("What attack item would you like to use?\n1. Wooden Stick\n2. Back\n")
if battle_choice == "2":
item_choice = input("What special item would you like to use?\n1. Potion\n")
if item_choice == "1":
print("You are already at full hp!")
battle_choice = input("What would you like to do?\n1. Fight\n2. Use Item\n3. Defend\n4. Run\n5. Hide\n ")