home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Acao / Titans / cyborg.swf / scripts / frame_12 / DoAction.as
Encoding:
Text File  |  2006-01-05  |  4.3 KB  |  207 lines

  1. call("pro");
  2. fadescreen();
  3. stopAllSounds();
  4. _global.r = this;
  5. _global.p = this.pl;
  6. attachmovie("cy","cy",800001);
  7. attachmovie("progressbar","progressbar",800020);
  8. progressbar._x = 16;
  9. progressbar._y = 385;
  10. _global.c = this.cy;
  11. c._y = 375;
  12. c._x = 300;
  13. cbx = c._x - 50;
  14. inv = 0;
  15. hit = 0;
  16. invhitdelay = 50;
  17. energymax = 100;
  18. energy = energymax;
  19. energyless = 10;
  20. score = 0;
  21. point = 50;
  22. aimrange = 150;
  23. autofire = 0;
  24. noshot = 0;
  25. shootingani = 0;
  26. r.cheat1 = 0;
  27. bombrange = 175;
  28. r.ed = 500000;
  29. r.wd = 1000000;
  30. walldelay = 10;
  31. w = walldelay;
  32. r.cd = 900000;
  33. ceidelay = 10;
  34. cdelay = ceidelay;
  35. b = 800000;
  36. b2 = 400000;
  37. distance = 100;
  38. bul = [];
  39. hitrange = 40;
  40. p.attachmovie("cei","cei" + r.cd,r.cd);
  41. p["cei" + r.cd]._x = 300;
  42. p["cei" + r.cd]._y = 0;
  43. p["cei" + r.cd].gotoAndPlay(12);
  44. r.cd--;
  45. p.attachmovie("cei","cei" + r.cd,r.cd);
  46. p["cei" + r.cd]._x = 300;
  47. p["cei" + r.cd]._y = 0;
  48. p["cei" + r.cd].gotoAndPlay(1);
  49. r.cd--;
  50. p.attachmovie("wall1","wall1" + r.wd,r.wd);
  51. p["wall1" + r.wd]._x = 100;
  52. p["wall1" + r.wd]._y = 380;
  53. r.wd--;
  54. p.attachmovie("wall1","wall1" + r.wd,r.wd);
  55. p["wall1" + r.wd]._x = 500;
  56. p["wall1" + r.wd]._y = 380;
  57. p["wall1" + r.wd]._xscale = -100;
  58. r.wd--;
  59. enemyname = ["","bomb","bomb2","bomb3","bomb4","shu","s2","atlas","bonus"];
  60. enemyarray = [];
  61. var i = 0;
  62. while(i < 8)
  63. {
  64.    enemyarray.push(1,0);
  65.    i++;
  66. }
  67. enemyarray.push(1,1,1,1,1,1,1,1,1,1);
  68. var i = 0;
  69. while(i < 12)
  70. {
  71.    enemyarray.push(2,0);
  72.    i++;
  73. }
  74. enemyarray.push(0,0);
  75. enemyarray.push(5,5,5,5,5,5,5,5,5,5,5,5,5);
  76. var i = 0;
  77. while(i < 12)
  78. {
  79.    enemyarray.push(4,0,0);
  80.    i++;
  81. }
  82. enemyarray.push(0,0);
  83. enemyarray.push(8,0);
  84. enemyarray.push(1,1,1,1,1,1,1,1);
  85. var i = 0;
  86. while(i < 15)
  87. {
  88.    enemyarray.push(1,3,0);
  89.    i++;
  90. }
  91. enemyarray.push(5,5,5,5,5,5,5,5,5,5,5,5,5);
  92. enemyarray.push(2,2,2,2,2,2,2,2);
  93. enemyarray.push(0,0);
  94. enemyarray.push(8);
  95. var i = 0;
  96. while(i < 12)
  97. {
  98.    enemyarray.push(6,6,0);
  99.    i++;
  100. }
  101. enemyarray.push(0,0,0);
  102. enemyarray.push(7);
  103. enemyarray.reverse();
  104. enemies = [];
  105. totalenemy = enemyarray.length;
  106. edelay = 18;
  107. d = edelay;
  108. r.createEmptyMovieClip("sfx",501000);
  109. allsfx = ["zshot","zbonus","zfall","zpunch","zhit","zboom","zboom3"];
  110. var i = 0;
  111. while(i < allsfx.length)
  112. {
  113.    r[allsfx[i]] = new sound(sfx);
  114.    r[allsfx[i]].attachsound(allsfx[i]);
  115.    i++;
  116. }
  117. r.createEmptyMovieClip("sfx2",501001);
  118. r.zloop = new sound(sfx2);
  119. r.zloop.attachsound("zloop");
  120. r.zloop.attachsound("zloop");
  121. r.createEmptyMovieClip("sfx3",501003);
  122. r.zboss = new sound(sfx3);
  123. r.zboss.attachsound("zboss");
  124. r.createEmptyMovieClip("sfx4",501004);
  125. r.zlose = new sound(sfx4);
  126. r.zlose.attachsound("zlose");
  127. r.createEmptyMovieClip("sfx5",501005);
  128. r.zwin = new sound(sfx5);
  129. r.zwin.attachsound("zwin");
  130. zloop.start(0,999999);
  131. onenterframe = function()
  132. {
  133.    r.noshot--;
  134.    if(r.noshot == 0)
  135.    {
  136.       r.shootingani = 1;
  137.       r.zshot.start();
  138.       var bx = c._x;
  139.       var by = c._y - 50 - r.aim * 2;
  140.       r.attachmovie("blast","blast" + r.b,r.b);
  141.       r["blast" + r.b]._x = bx;
  142.       r["blast" + r.b]._y = by;
  143.       r["blast" + r.b].dep = r.b;
  144.       r["blast" + r.b].ys = -3 - 0.6 * r.aim;
  145.       r["blast" + r.b].b._yscale = 70 + r.aim;
  146.       var ym = r._ymouse;
  147.       if(ym < 120)
  148.       {
  149.          ym = 120;
  150.       }
  151.       else if(ym > 275)
  152.       {
  153.          ym = 275;
  154.       }
  155.       r["blast" + r.b].ypoint = ym;
  156.       r.bul.push("blast" + r.b);
  157.       r.b--;
  158.    }
  159.    if(r.autofire)
  160.    {
  161.       if(r.noshot < 0)
  162.       {
  163.          r.noshot = 4;
  164.       }
  165.    }
  166.    d--;
  167.    if(d < 0)
  168.    {
  169.       d = r.edelay;
  170.       if(enemyarray.length)
  171.       {
  172.          var etipe = r.enemyname[r.enemyarray.pop()];
  173.          r.attachmovie(etipe,"e" + r.ed,r.ed);
  174.          r.enemies.push("e" + r.ed);
  175.          r.ed--;
  176.       }
  177.    }
  178.    w--;
  179.    if(!w)
  180.    {
  181.       w = walldelay;
  182.       p.attachmovie("wall1","wall1" + r.wd,r.wd);
  183.       p["wall1" + r.wd]._x = 100;
  184.       p["wall1" + r.wd]._y = 380;
  185.       r.wd--;
  186.       p.attachmovie("wall1","wall1" + r.wd,r.wd);
  187.       p["wall1" + r.wd]._x = 500;
  188.       p["wall1" + r.wd]._y = 380;
  189.       p["wall1" + r.wd]._xscale = -100;
  190.       r.wd--;
  191.    }
  192.    cdelay--;
  193.    if(!cdelay)
  194.    {
  195.       cdelay = ceidelay;
  196.       p.attachmovie("cei","cei" + r.cd,r.cd);
  197.       p["cei" + r.cd]._x = 300;
  198.       p["cei" + r.cd]._y = 0;
  199.       r.cd--;
  200.    }
  201.    if(r.inv > 0)
  202.    {
  203.       r.inv--;
  204.    }
  205. };
  206. stop();
  207.