I believe that there is a problem with the level, seeing as everything is executed properly in my code, but nothing actually happens.
Here is my code:
# You can find friends through walls, but not enemies.
# Watch out for smooth, frictionless ice patches!
hero.moveXY(68, 16)
def killThemAll(friends):
for friend in friends:
enemy = friend.findNearestEnemy()
if enemy.type == "witch":
hero.command(friend, "attack", witch)
elif enemy:
hero.command(friend, "attack", enemy)
while True:
friends = hero.findFriends()
enemy1 = hero.findNearestEnemy()
enemyMissile = hero.findNearest(hero.findEnemyMissiles())
killThemAll(friends)
if enemyMissile and hero.distanceTo(enemyMissile) < 5:
if hero.isReady("shield"):
hero.shield()
else:
hero.moveXY(12, 12)
if enemy1 and enemy1.type == "catapult":
hero.attack(enemy1)
elif enemy1 > 20:
hero.attack(enemy1)
else:
hero.moveXY(77, 14)
Someone please help me.