Hey, I am trying to get through the level " Sarven Savior". I have the problem that my hero is calling his friends to slowly: The first two will be able to get “home” the other two are already overrun by enemies when they are called. How can I get my hero to talk faster?
Thanks in advance for all answers, here is my code:
// An ARRAY is a list of items.
// This array is a list of your friends' names.
var friendNames = ['Joan', 'Ronan', 'Nikita', 'Augustus'];
// Array indices start at 0, not 1!
var friendIndex = 0;
// Loop over each name in the array.
// The .length property gets the length of the array.
while (friendIndex < friendNames.length) {
// Use square brackets to get a name from the array.
var friendName = friendNames[friendIndex];
friendIndex= friendIndex+1;
// Tell your friend to go home.
// Use + to connect two strings.
this.say(friendName + ', go home!');
// Increment the index to get the next name from the array.
this.say(friendName+', go home!');
this.say(friendName+', go home!');
this.say(friendName+', go home!');
}
// Go back and build a fence to keep the ogres out.
this.moveXY(30,30);
this.buildXY("fence", 30, 30);