In this lab you will learn how to create simple event driven programs. The lab consists of two example from the book:
a. Complete exercise 14. Penguin Slide, from chapter 5. The file Lake with hole.a2w has the world set up for you.
Place three penguins on the hill. When a penguin is clicked it should lie on its belly and slide down the hill, spinning on its belly at the same time. then it should hit the water and disappear into the water with a splash.
Hint, define appropriate method(s) for one penguin, then save and import to get three penguins. ude the mouse clicked event to determine which penguin does the action.
b. Complete project 2, Skydiving Guidance System from chapter 5.
Alice Liddell has taken up a new hobby: skydiving. She is on a helicopter (vehicle), wearing a parachute (objects). She is to jump to the carrier (vehicle), which is a little way in front of her. Add a half-cylinder (shapes) inverted and connected to the helicopter to use as a jump platform. A torus (shapes) can be used as a jump harness for Alice Liddell.
The idea of the animation is to provide a skydiving guidance system to allow the user to guide the movement of alice as she jumps from the platform and glides to the carrier. When Alice hits the top of the carrier, the user can press the Enter key to have Alice drop her chute and stop falling.
jump -- jump from the helicopter platform
glideForward, glideBack, glideRight, glideLeft - move in the appropriate direction while falling
swingLegs - legs swing while jumping or gliding
dropChute - get rid of prarchute (make it rotate and disappear)
space bar - jump off platform
up/down/right/left arrow keys - glide forward/back/right/left
enter key - parachute drops and Alice stops (if on carrier)
Remember that Alcie should first jump before gliding and should not drop her chute until on the carrier. If she misses the carrier, then she should go into the water.
In both problems you should use both world methods and class methods as appropriate, so that the event specifications simply call the appropriate method, with the needed parameters.