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

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