Hello everyone.
I’m currently am stuck in Cursed Valley and I think I have 2 problems. The first one is that the skeletons seem buggy. Sometimes my hero attacks them and sometimes she doesn’t. Other times, once she does kill them, they’ll like, come back to life and die again.
The second problem is that my hero always dies before the 2nd potion appears. Here’s my code:
while (true) {
var enemy = hero.findNearestEnemy();
// Attack if enemy exists AND enemy.team is "ogres"
// AND enemy.type is "skeleton"
if (enemy && enemy.team === "ogres" && enemy.type === "skeleton") {
hero.attack(enemy);
}
var item = hero.findNearestItem();
// Collect if item exists AND item.type is "potion"
// AND hero.health is less than hero.maxHealth / 4
if (item && item.type === "potion" && hero.maxHealth / 4){
hero.moveXY(item.pos.x, item.pos.y);}
}
I don’t know if it’s a code problem or a gear problem.
Here’s my gear.
Thanks to everyone who helps me!