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!
please format your code by using this and pasting your code inside
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!
Welcome to the forum @codeneedhelp! please read the topic through the link that @milton.jinich and @Falcons118 gave you. And like @Falcons118 said, before we can help you, you need to format your code correctly. when copying it down to the discourse, use this button, and it will look like the code on codecombat!
Refresh all your code. Then define the onSpawn() function. Within the function, you need to command your pet to move to two points, but the pet has to move forever, so you have to make your pet move to the two points within a while true loop.
def onSpawn():
# while true loop:
# command your pet to move to the two points
// Your pet should run back and forth on the X marks.
// The hero should cheer the whole time!
auto onSpawn(auto event){
while(true) {
pet.moveXY(48, 8);
pet.moveXY(12, 8);
}
}
int main() {
// 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:
pet.on("spawn", onSpawn);
// Cheer up your pet. Don't remove this:
while (true) {
hero.say("Run!!!");
hero.say("Faster!");
onSpawn();
}
return 0;
}
I can not seem to see what is wrong. i am working with C++. any help would be awesome thanks