Listing 12. Code for the program named Alice0125b.

Alice0125b's Code

Created by: Dick Baldwin

world

Events

When the world starts
Do:
world.main ( );


Methods

  public void main ( ) {
    
       // Program Alice0125b, Copyright 2007, R.G.Baldwin
  world.setTheStage ( );
  world.playTheShow ( );
  }


  public void setTheStage ( ) {
    
       doInOrder {
       // Align objects to the world
  ground .setPointOfView( world );
  parkingMeter .setPointOfView( world );
  iceSkater .setPointOfView( world );
  // Set the camera to a known viewpoint
  camera .setPointOfView( ground );
  camera .turn( RIGHT , 135/360 revolutions );
  camera .moveAwayFrom( target = parkingMeter , amount = 10 meters );
  camera .move( UP , 1.5 meters );
  // Set skater to her starting viewpoint
  iceSkater .turn( RIGHT , 0.25 revolutions );
  iceSkater .moveAwayFrom( target = parkingMeter , amount = 2 meters );
  }
  }


  public void playTheShow ( ) {
    
       doInOrder {
       // Animate the skater's leg and foot
  iceSkater.leftLeg.lowerLeg .turn( FORWARD , 0.25 revolutions );
  iceSkater.leftLeg.lowerLeg.foot .turn( FORWARD , 0.12 revolutions );
  }
  }