Im stuck on Thunderhooves and cant figure out why its wrong! here’s my code:
while True:
yak = hero.findNearestEnemy()
posy = hero.pos.y
yaky = yak.pos.y - 10
yaky2 = yak.pos.y + 10
if yak:
#A yak is above you if yak.pos.y is greater than your pos.y
if hero.pos.y < yak.pos.y:
# If the yak is above you, build a fence 10m below it.
hero.buildXY("fence", posy, yaky)
# If the yak is below you, build a fence 10m above it.
hero.buildXY("fence", posy, yaky2)
pass
else:
# Move right 10m towards the oasis.
posy = posy + 10
pass