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

  1. onEnterFrame = function()
  2. {
  3.    if(!setAll)
  4.    {
  5.       _X = -50;
  6.       _Y = -50;
  7.       health = 8;
  8.       vSpeed = 0;
  9.       setAll = true;
  10.    }
  11.    if(health > 0 && this.area.hitTest(_root.player.area))
  12.    {
  13.       health = 0;
  14.       _root.player.health = 0;
  15.    }
  16.    _X = _X - _root.player.hSpeed;
  17.    if(health <= 0)
  18.    {
  19.       vSpeed++;
  20.       if(!exploded)
  21.       {
  22.          _root.explode(2,_X,_Y);
  23.          exploded = true;
  24.       }
  25.    }
  26.    _Y = _Y + vSpeed;
  27.    _X = _X + 2;
  28.    if(_Y >= 110 && health <= 0 && !dead)
  29.    {
  30.       _root.makeSplash(_X,200);
  31.       dead = true;
  32.       _root.score += 35;
  33.    }
  34.    if(_Y > 200 || _X > 1000 || _X <= -100)
  35.    {
  36.       _root.leftSideShip = false;
  37.       this.removeMovieClip();
  38.    }
  39. };
  40.