topical media & game development
lib-flex-animation-code-02-VehicleTest.ax
lib-flex-animation-code-02-VehicleTest.ax
(swf
)
[ flash
]
flex
package
{
import com.foed.Vector2D;
import com.foed.Vehicle;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
public class @ax-lib-flex-animation-code-02-VehicleTest extends Sprite
{
private var _vehicle:Vehicle;
public function @ax-lib-flex-animation-code-02-VehicleTest()
{
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
_vehicle = new Vehicle();
addChild(_vehicle);
_vehicle.position = new Vector2D(100, 100);
_vehicle.velocity.length = 5;
_vehicle.velocity.angle = Math.PI / 4;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(event:Event):void
{
_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.