Fun level, btw. Not sure if this is interesting, but I was shocked to find that some really simple code worked way better than what I would have thought was better and more sophisticated code. I’ll play around with this tomorrow and try to figure it out but thought I’d do a quick post in case this is interesting to others.
This is Sacred Statue 2 and this code is at the end of the level (staying near the statue) I use it for both the ogre invasion and cyclops. I’m using Tharin and start out with 782 in health.
# this stupidly simple code works great
loop:
self.moveXY(61,66)
enemy = self.findNearest(self.findEnemies())
if enemy:
self.attack(enemy)
# i thought i would spruce it up a little, but now it works much worse!
loop:
enemy = self.findNearest(self.findEnemies())
if enemy and self.distanceTo(enemy) < 3:
while enemy.health > 0:
if self.isReady("bash"):
self.bash(enemy)
elif self.isReady("power-up"):
self.powerUp()
self.attack(enemy)
else:
self.moveXY(61,66)