Hello and welcome to codecombat discourse! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review this topic, which shows all essentials of this board! Thanks!
# Use your new skill to choose what to do: hero.time
while True:
# If it's the first 10 seconds, attack.
if hero.time < 10:
enemy= hero.findNearestEnemy()
hero.attack(enemy)
pass
# Else, if it's the first 35 seconds, collect coins.
elif hero.time < 35:
items = hero.findItems()
if items:
hero.moveXY(items.pos.x, items.pos.y)
# After 35 seconds, attack again!
elif hero.time>35:
hero.attack(enemy)
else:
hero.moveXY(item.pos.x, item.pos.y)
pass