I have been stuck on Stranded in the Dunes for at least two weeks. I can’t get to the skeleton king without my health being above half way. Can someone give me tips on how to beat this level. Heres my code.
while True:
enemy = hero.findNearestEnemy()
flag = hero.findFlag("black")
if flag:
hero.moveXY(flag.pos.x, flag.pos.y)
hero.pickUpFlag(flag)
elif enemy and enemy.type != "sand-yak":
enemy = hero.findNearestEnemy()
hero.attack(enemy)
You might not be powerful enough yet. Maybe you need some gear upgrades?
You can beat this level 100% without flags. But you still need to be strong enough to get through the whole thing.
If you can make it to the boss fight, the raven will throw you potions at points throughout the fight. So make sure you have some code to loot items like so.
item = this.findNearest(this.findItems());
if (item) {
this.moveXY(item.pos.x, item.pos.y);
}
another tip. if you need to figure out if you have gotten to the boss screen or not. you can find that with something like this. (for a non flag play through this comes in handy)
let bossX = this.findNearest(this.findByType("x-red"));
if (bossX) {
this.moveXY(60, 15);
}