home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Acao / Titans / star.swf / scripts / DefineSprite_157_mumbo / frame_1 / DoAction.as
Encoding:
Text File  |  2006-01-05  |  1.4 KB  |  72 lines

  1. xs = 0.5 * r.espeed;
  2. y = _Y;
  3. energy = 46;
  4. shoot = 0;
  5. hit = 0;
  6. name = "mumbo";
  7. m.gotoAndStop("shoot");
  8. if(_parent._name == "enemymap")
  9. {
  10.    initme();
  11.    r.villainpos = _X;
  12. }
  13. else
  14. {
  15.    r.zloop.stop();
  16.    r.zboss.start(0,99999);
  17.    onenterframe = function()
  18.    {
  19.       _X = _X + xs;
  20.       if(_X < 600)
  21.       {
  22.          xs *= 0.85;
  23.       }
  24.       _Y = y + math.sin(a++ * 0.1) * 80;
  25.       if(shoot)
  26.       {
  27.          shoot = 0;
  28.          r.attachmovie("mbul","e" + r.ed,r.ed);
  29.          r["e" + r.ed]._x = _X - 45;
  30.          r["e" + r.ed]._y = _Y - 25;
  31.          r.ed = r.ed + 1;
  32.       }
  33.       var i = 0;
  34.       while(i < r.bul.length)
  35.       {
  36.          var b = r[r.bul[i]];
  37.          if(b._x < 590)
  38.          {
  39.             if(z.hittest(b))
  40.             {
  41.                if(!b.tipe)
  42.                {
  43.                   hit = 1;
  44.                }
  45.                else
  46.                {
  47.                   hit = 3;
  48.                }
  49.                r.bul.removevalue(r.bul[i]);
  50.                b.removeMovieClip();
  51.                break;
  52.             }
  53.          }
  54.          i++;
  55.       }
  56.       if(hit)
  57.       {
  58.          energy -= hit;
  59.          hit = 0;
  60.          m.attachmovie("blink2","blink2",100);
  61.          hit = 0;
  62.          if(energy <= 0)
  63.          {
  64.             m.gotoAndStop("fall");
  65.             delete onenterframe;
  66.             gotoAndPlay(7);
  67.          }
  68.       }
  69.    };
  70. }
  71. stop();
  72.