Hi, I have been trying to pass this level and can’t pass it. Can you help me?
Here’s my code:
# Fight enemies for 15 seconds. # Keep count whenever an enemy is defeated. defeated = 0 while True: enemy = hero.findNearestEnemy() if enemy: hero.attack(enemy) if enemy.health <= 0: defeated += 1 if hero.time > 15: break # Tell Naria how many enemies you defeated. hero.moveXY(59, 33) hero.say(defeated) # Collect coins until the clock reaches 30 seconds. item = hero.findNearestItem() # Tell Naria how much gold you collected. while True: hero.moveXY(58, 33) hero.gold hero.say("collected") # Fight enemies until the clock reaches 45 seconds. # Remember to reset the count of defeated enemies! while True: enemy = hero.findNearestEnemy() if enemy: hero.attack(enemy) # Tell Naria how many enemies you defeated. while True: pet.moveXY(59, 33) hero.say("defeated")