topical media & game development

talk show tell print

lib-flex-animation-code-02-WanderTest.ax

lib-flex-animation-code-02-WanderTest.ax (swf ) [ flash ] flex


  package
  {
          import com.foed.SteeredVehicle;
          import com.foed.Vector2D;
          
          import flash.display.Sprite;
          import flash.display.StageAlign;
          import flash.display.StageScaleMode;
          import flash.events.Event;
  
          public class @ax-lib-flex-animation-code-02-WanderTest extends Sprite
          {
                  private var _vehicle:SteeredVehicle;
                  
                  public function @ax-lib-flex-animation-code-02-WanderTest()
                  {
                          stage.align = StageAlign.TOP_LEFT;
                          stage.scaleMode = StageScaleMode.NO_SCALE;
                          
                          _vehicle = new SteeredVehicle();
                          _vehicle.position = new Vector2D(200, 200);
                          addChild(_vehicle);
                          
                          addEventListener(Event.ENTER_FRAME, onEnterFrame);
                  }
                  
                  private function onEnterFrame(event:Event):void
                  {
                          _vehicle.wander();
                          _vehicle.update();
                  }
          }
  }


(C) Æliens 18/6/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.