public void fallInHole ( Object whichHole) {
Number distanceToHole = 1 ; Number holeRadius = 1 ; |
| |
// Watch the animation from the penguin's perspective. |
| camera .set( vehicle , penguin ); |
| camera .setPointOfView( penguin.head ); duration = 0 seconds |
| // Walk to the edge of the hole. |
| penguin .turnToFace( whichHole ); |
| holeRadius .set( value , ( ( ( subject = whichHole .getWidth() ) / 2 ) ) ); |
| distanceToHole .set( value , ( ( ( penguin .distanceTo( whichHole ) ) - holeRadius ) ) ); |
| penguin.walking ( x = distanceToHole ); |
| // Dive in the hole. |
| doTogether { |
| |
penguin.jump ( times = 1 ); |
| penguin .turn( FORWARD , 0.5 revolutions ); |
| doInOrder { |
| |
wait( 0.5 seconds ); |
| penguin .moveTo( whichHole ); |
| } |
| } |
| } |