Closed rfpotrero closed 2 years ago
There was a break statement missing to break the loop if the player was dead.
Fixed code below:
while tower_floor <= 5:
print("After climbing the stairs you arrive to the first floor")
encounter(player_character)
if player_character.hp == 0:
print("You are DEAD game Over")
break
after_combat()
print(f"Floor number: {tower_floor}")
tower_floor = tower_floor + 1
Code before the fix. while tower_floor <= 5: print("After climbing the stairs you arrive to the first floor") encounter(player_character) if player_character.hp == 0: print("You are DEAD game Over") after_combat() print(f"Floor number: {tower_floor}") tower_floor = tower_floor + 1