home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / Kung_Fu.swf / scripts / frame_73 / DoAction_3.as < prev    next >
Encoding:
Text File  |  2007-09-27  |  5.4 KB  |  205 lines

  1. function spawnEnemy()
  2. {
  3.    if(_root.spawncontrol == "on")
  4.    {
  5.       enemycount += 1;
  6.       if(enemycount > max_enem)
  7.       {
  8.          enemycount = 0;
  9.       }
  10.       point = new object();
  11.       point.x = -20;
  12.       point.y = 10;
  13.       _root.bg.globalToLocal(point);
  14.       _root.bg.attachMovie("baddie","baddie" + enemycount,enemycount);
  15.       _root.bg["baddie" + enemycount]._x = point.x;
  16.       _root.bg["baddie" + enemycount]._y = 15;
  17.    }
  18. }
  19. function spawnEnemy2()
  20. {
  21.    if(_root.spawncontrol == "on")
  22.    {
  23.       enemycount += 1;
  24.       if(enemycount > max_enem)
  25.       {
  26.          enemycount = 0;
  27.       }
  28.       point2 = new object();
  29.       point2.x = 260;
  30.       point2.y = 10;
  31.       _root.bg.globalToLocal(point2);
  32.       stop();
  33.       _root.bg.attachMovie("baddie2","baddie2" + enemycount,enemycount);
  34.       _root.bg["baddie2" + enemycount]._x = point2.x;
  35.       _root.bg["baddie2" + enemycount]._y = 15;
  36.    }
  37. }
  38. function spawnEnemy3()
  39. {
  40.    if(_root.spawncontrol == "on")
  41.    {
  42.       enemycount += 1;
  43.       if(enemycount > max_enem)
  44.       {
  45.          enemycount = 0;
  46.       }
  47.       point3 = new object();
  48.       point3.x = 260;
  49.       point3.y = 10;
  50.       _root.bg.globalToLocal(point3);
  51.       _root.bg.attachMovie("baddie","baddie3" + enemycount,enemycount);
  52.       _root.bg["baddie3" + enemycount]._x = point3.x;
  53.       _root.bg["baddie3" + enemycount]._y = 15;
  54.    }
  55. }
  56. function spawnEnemy4()
  57. {
  58.    if(_root.spawncontrol == "on")
  59.    {
  60.       enemycount += 1;
  61.       if(enemycount > max_enem)
  62.       {
  63.          enemycount = 0;
  64.       }
  65.       point4 = new object();
  66.       point4.x = -20;
  67.       point4.y = 10;
  68.       _root.bg.globalToLocal(point4);
  69.       _root.bg.attachMovie("baddie2","baddie4" + enemycount,enemycount);
  70.       _root.bg["baddie4" + enemycount]._x = point4.x;
  71.       _root.bg["baddie4" + enemycount]._y = 15;
  72.    }
  73. }
  74. function spawnEnemy5()
  75. {
  76.    if(_root.bossspawn == "on")
  77.    {
  78.       enemycount += 1;
  79.       if(enemycount > max_enem)
  80.       {
  81.          enemycount = 0;
  82.       }
  83.       point5 = new object();
  84.       point5.x = 55;
  85.       point5.y = 10;
  86.       _root.bg.globalToLocal(point5);
  87.       _root.bg.attachMovie("baddie7","baddie7" + enemycount,enemycount);
  88.       _root.bg["baddie7" + enemycount]._x = point5.x;
  89.       _root.bg["baddie7" + enemycount]._y = 15;
  90.       _root.bossspawn = "off";
  91.    }
  92. }
  93. function spawnEnemy6()
  94. {
  95.    if(_root.spawncontrol == "on")
  96.    {
  97.       enemycount += 1;
  98.       if(enemycount > max_enem)
  99.       {
  100.          enemycount = 0;
  101.       }
  102.       point6 = new object();
  103.       point6.x = 260;
  104.       point6.y = 10;
  105.       _root.bg.globalToLocal(point6);
  106.       _root.bg.attachMovie("baddie11","baddie11" + enemycount,enemycount);
  107.       _root.bg["baddie11" + enemycount]._x = point6.x;
  108.       _root.bg["baddie11" + enemycount]._y = 15;
  109.    }
  110. }
  111. function spawnEnemy7()
  112. {
  113.    if(_root.spawncontrol == "on")
  114.    {
  115.       enemycount += 1;
  116.       if(enemycount > max_enem)
  117.       {
  118.          enemycount = 0;
  119.       }
  120.       point7 = new object();
  121.       point7.x = 260;
  122.       point7.y = 10;
  123.       _root.bg.globalToLocal(point7);
  124.       _root.bg.attachMovie("baddie11","baddie12" + enemycount,enemycount);
  125.       _root.bg["baddie12" + enemycount]._x = point7.x;
  126.       _root.bg["baddie12" + enemycount]._y = 15;
  127.    }
  128. }
  129. function spawnEnemy8()
  130. {
  131.    if(_root.spawncontrol == "on")
  132.    {
  133.       enemycount += 1;
  134.       if(enemycount > max_enem)
  135.       {
  136.          enemycount = 0;
  137.       }
  138.       point8 = new object();
  139.       point8.x = 260;
  140.       point8.y = 10;
  141.       _root.bg.globalToLocal(point8);
  142.       _root.bg.attachMovie("baddie10","baddie17" + enemycount,enemycount);
  143.       _root.bg["baddie17" + enemycount]._x = point8.x;
  144.       _root.bg["baddie17" + enemycount]._y = 15;
  145.    }
  146. }
  147. function spawnEnemy9()
  148. {
  149.    if(_root.spawncontrol == "on")
  150.    {
  151.       enemycount += 1;
  152.       if(enemycount > max_enem)
  153.       {
  154.          enemycount = 0;
  155.       }
  156.       point9 = new object();
  157.       point9.x = -20;
  158.       point9.y = 10;
  159.       _root.bg.globalToLocal(point9);
  160.       _root.bg.attachMovie("baddie10","baddie15" + enemycount,enemycount);
  161.       _root.bg["baddie15" + enemycount]._x = point9.x;
  162.       _root.bg["baddie15" + enemycount]._y = 15;
  163.    }
  164. }
  165. function spawnEnemy11()
  166. {
  167.    if(_root.spawncontrol == "on")
  168.    {
  169.       enemycount += 1;
  170.       if(enemycount > max_enem)
  171.       {
  172.          enemycount = 0;
  173.       }
  174.       point11 = new object();
  175.       point11.x = 260;
  176.       point11.y = 10;
  177.       _root.bg.globalToLocal(point11);
  178.       _root.bg.attachMovie("baddie78","baddie78" + enemycount,enemycount);
  179.       _root.bg["baddie78" + enemycount]._x = point11.x;
  180.       _root.bg["baddie78" + enemycount]._y = -25;
  181.    }
  182. }
  183. max_enem = 10;
  184. var intervalID;
  185. intervalID = setInterval(spawnEnemy,_root.enemyone);
  186. var intervalID2;
  187. intervalID2 = setInterval(spawnEnemy2,_root.enemytwo);
  188. var intervalID3;
  189. intervalID3 = setInterval(spawnEnemy3,_root.enemythree);
  190. var intervalID4;
  191. intervalID4 = setInterval(spawnEnemy4,_root.enemyfour);
  192. var intervalID5;
  193. intervalID5 = setInterval(spawnEnemy5,_root.bosslevelone);
  194. var intervalID6;
  195. intervalID6 = setInterval(spawnEnemy6,_root.enemysix);
  196. var intervalID7;
  197. intervalID7 = setInterval(spawnEnemy7,_root.enemyseven);
  198. var intervalID8;
  199. intervalID8 = setInterval(spawnEnemy6,_root.enemyeight);
  200. var intervalID9;
  201. intervalID9 = setInterval(spawnEnemy7,_root.enemynine);
  202. var intervalID11;
  203. intervalID11 = setInterval(spawnEnemy11,_root.enemyeleven);
  204. stop();
  205.