Here’s my code:
# Find the nearest item.
# Collect it (if it exists) only if its type isn’t “gem”.
item = hero.findNearestItem()
if item.type != “gem”:
# Find the nearest enemy.
# Attack it if it exists and its type isn’t “burl”.
enemy = hero.findNearestEnemy()
if enemy.type != “burl”:
The level starts out fine but then a thrower goes behind the burl and my hero does nothing.
Now my hero will go to the burl when an enemy appears and won’t do anything.