# Use your new skill to choose what to do: hero.time
while True:
if hero.time < 10:
if enemy:
enemy = hero.findNearestEnemy
hero.attack(enemy)
pass
elif hero.time < 35:
if coin:
coin = hero.findNearestItem()
hero.moveXY(coin.pos.x, coin.pos.y)
pass
else:
enemy = hero.findNearestEnemy()
hero.attack(enemy)
pass
hero.summon("archer")
# Use your new skill to choose what to do: hero.time
while True:
hero.findNearestEnemy()
if hero.time < 10:
enemy = hero.findNearestEnemy()
if enemy:
hero.attack(enemy)
pass
elif hero.time < 35:
hero.attack(enemy)
hero.attack(enemy)
hero.attack(enemy)
pass
I won’t give you a direct answer, but we can work through this together. You need all three parts to this because your hero isn’t probably strong enough to fight off all the enemies even with your friend archer Naria who just fights with you. You collect the coins to call more friends to fight with you (the level calls the friends for you if you have enough coins).
Because this is based on time, the first section won’t run after 10 seconds so you need to declare a new variable with each time frame.
Each section needs the same three steps:
declare the variable and assign a value
check “if” the variable exists
command your hero
You may need to get better armor for more health if your code works but your hero keeps dying.