home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / peaceplane.swf / scripts / DefineSprite_85_baddy5 / frame_1 / DoAction.as
Encoding:
Text File  |  2006-09-05  |  661 b   |  34 lines

  1. onEnterFrame = function()
  2. {
  3.    if(health > 0 && this.area.hitTest(_root.player._x,_root.player._y + 5,true))
  4.    {
  5.       health = 0;
  6.       _root.player.health = 0;
  7.    }
  8.    if(health <= 0)
  9.    {
  10.       gotoAndPlay(38);
  11.       onEnterFrame = function()
  12.       {
  13.          _X = _X - 3;
  14.          _X = _X - _root.player.hSpeed;
  15.       };
  16.    }
  17.    _X = _X - _root.player.hSpeed;
  18.    if(health <= 0)
  19.    {
  20.       vSpeed++;
  21.       if(!exploded)
  22.       {
  23.          _root.explode(2,_X,_Y);
  24.          exploded = true;
  25.       }
  26.    }
  27.    if(_X <= -400 || _X > 800)
  28.    {
  29.       _root.leftSideShip = false;
  30.       this.removeMovieClip();
  31.    }
  32.    _X = _X + 3;
  33. };
  34.