Listing 13. Code for the program named Alice0125c.

Alice0125c's Code

Created by: Dick Baldwin

world

Events

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


Methods

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


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


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