home *** CD-ROM | disk | FTP | other *** search
- class Van extends Vehicule
- {
- var SPEED_MAX = 1;
- var STEERING = 14;
- var SKFC = 3;
- var FR_EXPLODING = 48;
- var targetRotation = new Number();
- var halo = new Boolean();
- function Van(l_mc)
- {
- super(l_mc);
- this.mcRef.Halo.gotoAndStop("PasLa");
- this.halo = false;
- }
- function Exploding()
- {
- if(this.mcRef.Etat._currentframe >= this.FR_EXPLODING)
- {
- this.stateLocked = false;
- this.SetState("PasLa");
- this.halo = false;
- }
- else
- {
- this.MoveIdle();
- }
- }
- function GetOrientationRefStageCoord()
- {
- var _loc2_ = new Object();
- _loc2_.x = this.mcRef.OrientationRef._x;
- _loc2_.y = this.mcRef.OrientationRef._y;
- this.mcRef.localToGlobal(_loc2_);
- return _loc2_;
- }
- function GetTargetRotation()
- {
- return this.targetRotation;
- }
- function GotPackage()
- {
- if(!this.halo)
- {
- this.mcRef.Halo.gotoAndPlay("Appear");
- this.halo = true;
- }
- _global.C.sounds.inflate.StartSnd(1);
- }
- function LoosePackage()
- {
- if(this.halo)
- {
- this.mcRef.Halo.gotoAndPlay("Disappear");
- }
- this.halo = false;
- _global.C.sounds.explosion.StartSnd(1);
- this.SetState("Exploding");
- _global.C[_global.C.G_vanAi].SetState("WaitingVanReborn");
- this.SetStateLocked();
- }
- function PasLa()
- {
- }
- function MoveVeh()
- {
- var _loc2_ = undefined;
- if(this.changeDir == "Left")
- {
- _loc2_ = this.targetRotation - this.GetPropRotation();
- if(_loc2_ > 180)
- {
- _loc2_ -= 360;
- }
- this.RotateVeh(_loc2_);
- }
- else if(this.changeDir == "Right")
- {
- _loc2_ = - (this.GetPropRotation() - this.targetRotation);
- this.RotateVeh(_loc2_);
- }
- var _loc4_ = Math.sin(this.GetRotation() * 0.017453292519943295) * this.GetSpeed();
- var _loc3_ = Math.cos(this.GetRotation() * 0.017453292519943295) * this.GetSpeed() * -1;
- this.mcRef._x += _loc4_;
- this.mcRef._y += _loc3_;
- }
- function SetTargetRotation(l_targetRotation)
- {
- this.targetRotation = l_targetRotation;
- }
- function TeleportTo(l_coord)
- {
- this.mcRef._parent.globalToLocal(l_coord);
- this.mcRef._x = l_coord.x;
- this.mcRef._y = l_coord.y;
- }
- }
-