Chase Them Level Help

PLS send me the link to this game so I can try it.Can we all be friends

Here is the link: https://codecombat.com/play/level/chase-them
And if you want to try any more level you write this https://codecombat.com/play/level/
And then put the name of the level is lower case and with - instead of each space. Do you understand, @Cool_J_girl?

Andrei

1 Like

Continuing the discussion from Chase Them Level Help:

// Defeat the ogres and cure the hero.

// The pet is your only hope.
auto onSpawn(auto e) {
while(true) {
auto enemy = pet.findNearestByType(“munchkin”);
if (enemy && pet.isReady(“chase”)) {
pet.chase(enemy);
}
// Find and fetch a “potion”:
auto nearest = pet.findNearestByType(“potion”);
pet.fetch(nearest);
pet.moveXY(56, 50);
}

}
int main() {

// Assign "onSpawn" handler on the "spawn" event:
pet.on("spawn", onSpawn);

return 0;
}

Hi Leng_Dane,

Welcome to the forum!

If you need help with your code, please could you format it (there’s instructions here), and tell us a little bit about what the problem is.

Thanks,

Jenny

Hello and welcome to codecombat discourse! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review this topic, which shows all essentials of this board! Thanks!
and please format your code properly