The Gorilla Robot Wants to Play (ALICE) Solution
Page 208, #16
The Gorilla Robot Wants to Play
Create a simple game where the gorillaRobot (Animals) wants to play with the other animals. If the player clicks on an animal, the gorillaRobot turns to face that animal and begins to move towards it. However, the gorillaRobot is only allowed to move a random distance that is in the range of 0.5 meters and half the distance to the animal. If the gorillaRobot gets close enough (within 2 meters) to the animal, then the animal disappears slowly. Once the gorillaRobot has made all of the animals disappear, it turns towards the camera and asks, “Where did everybody go?” To create this world, use the sand template and the add the desert sky (Environments - Skies). Add the penguin (Animals), triceratops (Animals - Dinosaurs), and a dragon (Fantasy). Create a method for the gorillaRobot named goToAnimal with an object parameter named who. Also, create a World-level method named checkIfAllAreGone.