home *** CD-ROM | disk | FTP | other *** search
/ One Click 21 (Special) / OC021.iso / Juegos / 05-11-10-1.swf / scripts / __Packages / Van.as < prev    next >
Encoding:
Text File  |  2005-11-18  |  2.4 KB  |  97 lines

  1. class Van extends Vehicule
  2. {
  3.    var SPEED_MAX = 1;
  4.    var STEERING = 14;
  5.    var SKFC = 3;
  6.    var FR_EXPLODING = 48;
  7.    var targetRotation = new Number();
  8.    var halo = new Boolean();
  9.    function Van(l_mc)
  10.    {
  11.       super(l_mc);
  12.       this.mcRef.Halo.gotoAndStop("PasLa");
  13.       this.halo = false;
  14.    }
  15.    function Exploding()
  16.    {
  17.       if(this.mcRef.Etat._currentframe >= this.FR_EXPLODING)
  18.       {
  19.          this.stateLocked = false;
  20.          this.SetState("PasLa");
  21.          this.halo = false;
  22.       }
  23.       else
  24.       {
  25.          this.MoveIdle();
  26.       }
  27.    }
  28.    function GetOrientationRefStageCoord()
  29.    {
  30.       var _loc2_ = new Object();
  31.       _loc2_.x = this.mcRef.OrientationRef._x;
  32.       _loc2_.y = this.mcRef.OrientationRef._y;
  33.       this.mcRef.localToGlobal(_loc2_);
  34.       return _loc2_;
  35.    }
  36.    function GetTargetRotation()
  37.    {
  38.       return this.targetRotation;
  39.    }
  40.    function GotPackage()
  41.    {
  42.       if(!this.halo)
  43.       {
  44.          this.mcRef.Halo.gotoAndPlay("Appear");
  45.          this.halo = true;
  46.       }
  47.       _global.C.sounds.inflate.StartSnd(1);
  48.    }
  49.    function LoosePackage()
  50.    {
  51.       if(this.halo)
  52.       {
  53.          this.mcRef.Halo.gotoAndPlay("Disappear");
  54.       }
  55.       this.halo = false;
  56.       _global.C.sounds.explosion.StartSnd(1);
  57.       this.SetState("Exploding");
  58.       _global.C[_global.C.G_vanAi].SetState("WaitingVanReborn");
  59.       this.SetStateLocked();
  60.    }
  61.    function PasLa()
  62.    {
  63.    }
  64.    function MoveVeh()
  65.    {
  66.       var _loc2_ = undefined;
  67.       if(this.changeDir == "Left")
  68.       {
  69.          _loc2_ = this.targetRotation - this.GetPropRotation();
  70.          if(_loc2_ > 180)
  71.          {
  72.             _loc2_ -= 360;
  73.          }
  74.          this.RotateVeh(_loc2_);
  75.       }
  76.       else if(this.changeDir == "Right")
  77.       {
  78.          _loc2_ = - (this.GetPropRotation() - this.targetRotation);
  79.          this.RotateVeh(_loc2_);
  80.       }
  81.       var _loc4_ = Math.sin(this.GetRotation() * 0.017453292519943295) * this.GetSpeed();
  82.       var _loc3_ = Math.cos(this.GetRotation() * 0.017453292519943295) * this.GetSpeed() * -1;
  83.       this.mcRef._x += _loc4_;
  84.       this.mcRef._y += _loc3_;
  85.    }
  86.    function SetTargetRotation(l_targetRotation)
  87.    {
  88.       this.targetRotation = l_targetRotation;
  89.    }
  90.    function TeleportTo(l_coord)
  91.    {
  92.       this.mcRef._parent.globalToLocal(l_coord);
  93.       this.mcRef._x = l_coord.x;
  94.       this.mcRef._y = l_coord.y;
  95.    }
  96. }
  97.