Forest Cannon Dancing JS Help


#1

The information at the beginning of the level states that we need to write the function runBetween from scratch. But, once you enter the level, the comments say:
// Write the event function onSpawn for the pet.
// This function should make the wolf run back and forth:
// First, run to the right mark, then the left one:

I have tried to solve it both ways, with runBetween and onSpawn, does anyone have a suggestion or idea of what I doing wrong?
Thank you in advance.

pet.on(“spawn”, runBetween);

function runBetween(event) {
while (true) {
pet.moveXY(48,8);
pet.moveXY(11,8);
}
while (true) {
hero.say(“Run!!!”);
hero.say(“Faster!”);
}
}


#2

What map is it on? take a screenshot pls.


#3

function runBetween(event) This doesnt need the argument event in that parameters.

Can you also format you code so its easier to read. Use 3 backticks before and after the code or highlight your code and press the button at the top of the text editior that looks like </>.

You are also missing a bracket right before the 2nd while loop you need another ending bracket to enclose the runBetween function. The 2nd while does not belong in the runBetween method.


#4

pet.moveXY(12,8);