penguins's Code

Created by: Barbara Lerner

world

Methods

  public void my_first_method ( ) {
    
       penguin.fallInHole ( whichHole = hole2 );
  }


penguin

Methods

  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 );
  }
  }
  }