home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Acao / Titans / robin.swf / scripts / frame_10 / DoAction.as
Encoding:
Text File  |  2006-01-05  |  3.8 KB  |  144 lines

  1. onenterframe = function()
  2. {
  3.    d--;
  4.    if(!d)
  5.    {
  6.       d = r.itemdelay;
  7.       if(enemyarray.length > 0)
  8.       {
  9.          var tipe = enemyarray.pop();
  10.          var lane = findlane();
  11.          if(tipe == 1 or tipe == 18)
  12.          {
  13.             r.attachmovie("car","c" + r.ed,r.ed);
  14.             r["c" + r.ed].dep = r.ed;
  15.             r["c" + r.ed]._y = lane;
  16.             r["c" + r.ed]._x = 600;
  17.             r["c" + r.ed].tipe = tipe;
  18.             r.cars.push("c" + r.ed);
  19.             r.ed = r.ed + 1;
  20.          }
  21.          else if(tipe == 2)
  22.          {
  23.             r.attachmovie("bot2","b" + r.ed,r.ed);
  24.             r["b" + r.ed].dep = r.ed;
  25.             r["b" + r.ed]._y = 330;
  26.             r["b" + r.ed]._x = 675;
  27.             r.enemy.push("b" + r.ed);
  28.             r.ed = r.ed + 1;
  29.          }
  30.          else if(tipe == 3)
  31.          {
  32.             r.attachmovie("bot3","b" + r.ed,r.ed);
  33.             r["b" + r.ed].dep = r.ed;
  34.             r["b" + r.ed]._y = lane;
  35.             r["b" + r.ed]._x = 650;
  36.             r.enemy.push("b" + r.ed);
  37.             r.ed = r.ed + 1;
  38.          }
  39.          else if(tipe == 4)
  40.          {
  41.             r.attachmovie("bot4","b" + r.ed,r.ed);
  42.             r["b" + r.ed].dep = r.ed;
  43.             r["b" + r.ed]._y = lane;
  44.             r["b" + r.ed]._x = 670;
  45.             r.enemy.push("b" + r.ed);
  46.             r.ed = r.ed + 1;
  47.          }
  48.          else if(tipe == 5)
  49.          {
  50.             r.attachmovie("hc","b" + r.ed,r.ed);
  51.             r["b" + r.ed].dep = r.ed;
  52.             r.enemy.push("b" + r.ed);
  53.             r.ed = r.ed + 1;
  54.          }
  55.          else if(tipe == 6)
  56.          {
  57.             r.attachmovie("UFO","b" + r.ed,r.ed);
  58.             r["b" + r.ed].dep = r.ed;
  59.             r.enemy.push("b" + r.ed);
  60.             r.ed = r.ed + 1;
  61.          }
  62.          else if(tipe == 7)
  63.          {
  64.             var bypos = [280,305,330,355,380];
  65.             bypos.reverse();
  66.             var bxpos = [550,520,550,520,550];
  67.             bxpos.reverse();
  68.             var i = 0;
  69.             while(i < 5)
  70.             {
  71.                r.attachmovie("botx","rx" + i,r.ed);
  72.                r["rx" + i].dep = r.ed;
  73.                r["rx" + i]._y = bypos.pop();
  74.                r["rx" + i]._x = 670 + random(100);
  75.                r["rx" + i].pos = bxpos.pop();
  76.                r.enemy.push("rx" + i);
  77.                r.ed = r.ed + 1;
  78.                i++;
  79.             }
  80.             r.attachmovie("xcontroller","b" + r.ed,r.ed);
  81.             r["b" + r.ed]._y = 10000;
  82.             r.enemy.push("b" + r.ed);
  83.             r.ed = r.ed + 1;
  84.             r.gunrecover1 *= 10;
  85.             r.gunrecover2 *= 1.84;
  86.             r.zloop.stop();
  87.             r.zboss.start(0,99999);
  88.          }
  89.          else if(tipe == 8)
  90.          {
  91.             r.attachmovie("bonus","b" + r.ed,r.ed);
  92.             r["b" + r.ed].dep = r.ed;
  93.             r["b" + r.ed]._y = lane - random(30);
  94.             r["b" + r.ed]._x = 620;
  95.             r.enemy.push("b" + r.ed);
  96.             r.ed = r.ed + 1;
  97.          }
  98.       }
  99.    }
  100.    if(r.noshot == 0 and r.gunh > r.gunless)
  101.    {
  102.       r.shootingani = 1;
  103.       r.gunh -= r.gunless;
  104.       r.zshoot.start();
  105.       r.attachmovie("blast","blast" + r.b,r.b);
  106.       r["blast" + r.b]._x = s._x + 25;
  107.       r["blast" + r.b]._y = s._y - 25;
  108.       if(!r.jump)
  109.       {
  110.          r["blast" + r.b].ypos = s._y;
  111.       }
  112.       r.bul.push("blast" + r.b);
  113.       r.b = r.b + 1;
  114.    }
  115.    if(r.noshot < 1)
  116.    {
  117.       r.noshot--;
  118.    }
  119.    if(r.autofire)
  120.    {
  121.       if(r.noshot < -3)
  122.       {
  123.          r.noshot = 0;
  124.       }
  125.    }
  126.    if(r.inv > 0)
  127.    {
  128.       r.inv--;
  129.    }
  130.    if(r.gunh < r.gunless)
  131.    {
  132.       r.gunh += r.gunrecover1;
  133.    }
  134.    else
  135.    {
  136.       r.gunh += r.gunrecover2;
  137.    }
  138.    if(r.gunh > 100)
  139.    {
  140.       r.gunh = 100;
  141.    }
  142. };
  143. stop();
  144.