home *** CD-ROM | disk | FTP | other *** search
/ Champak 108 / jogo-disk-108.iso / Games / rush_hour.swf / scripts / __Packages / Vehicle.as < prev   
Text File  |  2010-05-15  |  2KB  |  56 lines

  1. class Vehicle extends MovieClip
  2. {
  3.    function Vehicle()
  4.    {
  5.       super();
  6.    }
  7.    function onRelease()
  8.    {
  9.       delete this.onEnterFrame;
  10.       this._x = this.spacing * (this.xpos + this.ypos);
  11.       this._y = this.spacing / 2 * (this.xpos - this.ypos);
  12.       _root.adjustDepth(this);
  13.       this._parent.updateBoard();
  14.    }
  15.    function onReleaseOutside()
  16.    {
  17.       this.onRelease();
  18.    }
  19.    function onLoad()
  20.    {
  21.       var _loc10_ = undefined;
  22.       var _loc5_ = undefined;
  23.       var _loc4_ = undefined;
  24.       if(this.size[0] > this.size[1])
  25.       {
  26.          _loc10_ = this.size[0];
  27.       }
  28.       else
  29.       {
  30.          _loc10_ = this.size[1];
  31.       }
  32.       var _loc2_ = 1;
  33.       while(_loc2_ <= _loc10_)
  34.       {
  35.          if(this.size[0] > this.size[1])
  36.          {
  37.             _loc5_ = this.spacing * (this.xpos + _loc2_ + this.ypos);
  38.             _loc4_ = this.spacing / 2 * (this.xpos + _loc2_ - this.ypos);
  39.          }
  40.          else
  41.          {
  42.             _loc5_ = this.spacing * (this.xpos + this.ypos + _loc2_);
  43.             _loc4_ = this.spacing / 2 * (this.xpos - this.ypos - _loc2_);
  44.          }
  45.          var _loc3_ = this.getDepth().toString() + _loc2_.toString();
  46.          var _loc6_ = this.cartype + _loc2_;
  47.          this["child" + _loc2_] = this._parent.attachMovie(_loc6_,"car" + _loc3_,parseInt(_loc3_),{_x:_loc5_,_y:_loc4_,theparent:this});
  48.          _loc2_ = _loc2_ + 1;
  49.       }
  50.    }
  51.    function getPossibleX(a)
  52.    {
  53.       return this.spacing * (a[0] + a[1]);
  54.    }
  55. }
  56.