home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / planetx.swf / scripts / frame_17 / DoAction_9.as < prev    next >
Encoding:
Text File  |  2006-06-13  |  1007 b   |  45 lines

  1. function exitPadClass()
  2. {
  3. }
  4. exitPadClass.prototype = new MovieClip();
  5. exitPadClass.prototype.onLoad = function()
  6. {
  7.    this.x = this._x;
  8.    this.y = this._y;
  9.    this.startx = this.x;
  10.    this.starty = this.y;
  11. };
  12. exitPadClass.prototype.onEnterFrame = function()
  13. {
  14.    if(_root.state == "paused")
  15.    {
  16.    }
  17.    if(_root.state == "playing")
  18.    {
  19.       this.ty = Math.abs(py - (this.y - 15));
  20.       if(this.ty < 15)
  21.       {
  22.          this.tx = Math.abs(px - this.x);
  23.          if(this.tx < 20)
  24.          {
  25.             px = this.x;
  26.             leftThrust = 0;
  27.             rightThrust = 0;
  28.             playerFuel += 0.15;
  29.             thrusting = 0;
  30.             addThrust = 0;
  31.             if(playerYspeed > 0)
  32.             {
  33.                playerYspeed = 0;
  34.             }
  35.             playerState = "refueling";
  36.             if(playerFuel > 100)
  37.             {
  38.                playerFuel = 100;
  39.             }
  40.          }
  41.       }
  42.    }
  43. };
  44. Object.registerClass("exitPad",exitPadClass);
  45.