home *** CD-ROM | disk | FTP | other *** search
/ Champak 48 / cdrom_image.iso / Games / bossbash.swf / scripts / DefineSprite_576_bombub / frame_1 / DoAction.as
Encoding:
Text File  |  2007-09-28  |  1.3 KB  |  42 lines

  1. this.cacheAsBitmap = true;
  2. this.onEnterFrame = function()
  3. {
  4.    this._x += this.Xvel;
  5.    this._y += this.Yvel;
  6.    this.Xvel *= 0.95;
  7.    this.Yvel += 0.7;
  8.    v = 0;
  9.    while(v < this._parent._parent.allarray.length)
  10.    {
  11.       var veb = this._parent._parent.allarray[v];
  12.       var veg = eval("this._parent._parent.bubs." + veb);
  13.       if(this.hitTest(veg) && veg.grabbed != true)
  14.       {
  15.          p = this._parent.attachMovie("bomtoons_poof","poof",this.getNextHighestDepth());
  16.          p._x = this._x;
  17.          p._y = this._y;
  18.          p._xscale = 80;
  19.          p._yscale = p._xscale;
  20.          veg.removeMovieClip();
  21.          this._parent._parent.allarray[veg.id] = undefined;
  22.          this.removeMovieClip();
  23.          delete this.onEnterFrame;
  24.       }
  25.       v++;
  26.    }
  27.    if(Stage.height < this._y + this._parent._y)
  28.    {
  29.       this.removeMovieClip();
  30.    }
  31.    if(this._parent._parent.dude.hitTest(this._x + this._parent._x,this._y + this._parent._y,true) && this._parent._parent.dude.blink != true)
  32.    {
  33.       if(this._parent._parent.hp > 0 && this._parent._parent.dude.inv != true)
  34.       {
  35.          this._parent._parent.hp -= 1;
  36.          this._parent._parent.dude.blink = true;
  37.          this._parent._parent.dude.blinkcount = 0;
  38.       }
  39.       this.removeMovieClip();
  40.    }
  41. };
  42.