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

  1. function shieldChargeClass()
  2. {
  3. }
  4. shieldChargeClass.prototype = new MovieClip();
  5. shieldChargeClass.prototype.onLoad = function()
  6. {
  7.    this.x = this._x;
  8.    this.y = this._y;
  9.    this.state = "normal";
  10. };
  11. shieldChargeClass.prototype.onEnterFrame = function()
  12. {
  13.    if(_root.state == "paused")
  14.    {
  15.    }
  16.    if(_root.state == "playing")
  17.    {
  18.       if(this.state == "normal")
  19.       {
  20.          if(this.hitTest(_root.player) == true)
  21.          {
  22.             shieldChargeCollected();
  23.             this.state = "start collected";
  24.          }
  25.       }
  26.       if(this.state == "start collected")
  27.       {
  28.          this.counter = 15;
  29.          this.state = "collected wait";
  30.          this.gotoAndPlay(2);
  31.       }
  32.       if(this.state == "collected wait")
  33.       {
  34.          this.counter--;
  35.          if(this.counter < 1)
  36.          {
  37.             removeMovieClip(this);
  38.          }
  39.       }
  40.    }
  41. };
  42. Object.registerClass("shieldCharge",shieldChargeClass);
  43.