Recall in the last section we had the boar herd moving forward all at once. Now let's try to make it look more realistic. We will start by having them not move all at once. Herds don't move perfectly in sync.
To do this we need to change our for all together tile to a for all in order tile. Drag that for all together tile to the trash and drag a for all in order tile into the method:
And inside the Do Nothing part of the for all in order tile drag a call to item_from_herd's move method:
Click play. Does it now move each of the boars in the herd forward one at a time?
[Q11.3.1]: Making them move one at a time is still not very natural. Can you think of a way to make them move more naturally?
We can use what we learned in section 10.6, randomness. Herds typically move all together, but randomly, not perfectly like in section 11.2:
[Q11.3.2]: How would you incorporate randomness into the moving herds?
Each boar should move a random amount between 1 and 5 meters, but they should all move together:
Click play. Do the boars move more naturally now?
We can change one last thing to make them move even more naturally. Instead of having them only move once, we can have them move a random amount between 0.2 and 1 meter and have them do that repeatedly, this will give us a very natural looking herd movement:
Change the randomness to have a min of 0.2 and a max of 1 meter and then embed the for all together tile in a counted loop that loops forever: