level 1
# Get to the oasis,
# fencing off paths with yaks on them as you go.
loop:
yak = self.findNearestEnemy()
if yak:
ypos = yak.pos
fx = ypos.x
fy = ypos.y
# If the yak is above you, build a fence 10m below it.
#distance = self.distanceTo(yak)
if fy > self.pos.y :
self.buildXY("fence",fx, fy - 10)
# If the yak is below you, build a fence 10m above it.
#else:
#elif yak.pos.y < self.pos.y :
#pass
if fy < self.pos.y:
self.buildXY("fence", fx, fy + 10)
pass
else:
# Move right 10m towards the oasis.
self.moveXY(self.pos.x+10 , self.pos.y)
# pass
2015年02月13日 03点02分



