The problem is my hero moves to late after the water is thrown and the ogre gets it and kills me there are other times where poison is thrown and the ogre drinks it but then water is thrown and poison a few seconds later and my hero drinks the water with the poison and then dies
# Race munchkins to the water distilled by Omarn Brewstone!
# The continue statement is powerful for managing complicated logic.
# When the program uses the continue statement, the rest of the loop is skipped.
# However, unlike with "break", the loop repeats instead of stopping.
# Use "continue" to verify the conditions of the ambush.
myX = self.pos.x
myY = self.pos.y
# If there is no enemy, continue out of the loop.
enemy = self.findNearest(self.findEnemies())
item = self.findNearest(self.findItems())
if not enemy:
self.say("I see an enemy!")
# If there is an enemy, but no item, ask for a potion and continue out of the loop.
if not item:
self.say("Give me a drink!")
# Use an if-statement to check the item's type. If the type is "poison", continue out of the loop.
if item.type is "poison":
# If it is not, the potion must be a bottle of water, so walk to it and return to the starting position!