Listing 7. Source code for the act1Scene1Action method.

Penguins02's Code

Created by: Dick Baldwin

world

Methods

  public void act1Scene2Action ( ) {
    
       // Papa walks to edge of hole
  papa.walking ( ( ( ( papa .distanceTo( hole ) ) - ( ( ( subject = hole .getWidth() ) / 2 ) ) ) ) );
  doTogether {
       // Camera flies one rev around hole in 15 seconds
  camera .turn( LEFT , 1 revolution ); asSeenBy = hole duration = 15 seconds
  // Papa starts to show off
  // Papa raises his wings together
  doTogether {
       papa.leftWing .roll( RIGHT , 0.25 revolutions );
  papa.rightWing .roll( LEFT , 0.25 revolutions );
  }
  // Papa turns his head both ways, and asks for quiet
  doInOrder {
       papa.head .turn( LEFT , 0.25 revolutions );
  papa .say( Quiet please );
  papa.head .turn( RIGHT , .5 revolutions );
  papa .say( Quiet please );
  papa.head .turn( LEFT , 0.25 revolutions );
  // Papa looks down at the water, looks back up,
  // and flaps his wings
  papa.head .turn( FORWARD , 0.1 revolutions );
  papa.head .turn( BACKWARD , 0.1 revolutions );
  papa.wing_flap ( times = 2 );
  doTogether {
       // Papa raises both wings above his head
  // preparing for the dive
  papa.rightWing .roll( LEFT , 0.25 revolutions );
  papa.leftWing .roll( RIGHT , 0.25 revolutions );
  }
  // Papa dives head first into the hole in slow motion
  doTogether {
       papa .move( UP , 2 meters ); style = BEGIN_AND_END_ABRUPTLY duration = 4 seconds
  papa .turn( FORWARD , 0.5 revolutions ); asSeenBy = papa.head duration = 4 seconds style = BEGIN_AND_END_ABRUPTLY
  }
  // Because papa is upside down, he must move
  // up to fall down
  papa .move( UP , 5 meters ); style = BEGIN_AND_END_ABRUPTLY duration = 4 seconds
  papa .playSound( world.splash (0:00.734) );
  // end doInOrder block
  }
  // End doTogether block for fly around
  }
  }