home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / Kung_Fu.swf / scripts / frame_67 / DoAction_3.as < prev    next >
Encoding:
Text File  |  2007-09-27  |  4.3 KB  |  165 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.       _root.bg.attachMovie("baddie2","baddie2" + enemycount,enemycount);
  33.       _root.bg["baddie2" + enemycount]._x = point2.x;
  34.       _root.bg["baddie2" + enemycount]._y = 15;
  35.    }
  36. }
  37. function spawnEnemy3()
  38. {
  39.    if(_root.spawncontrol == "on")
  40.    {
  41.       enemycount += 1;
  42.       if(enemycount > max_enem)
  43.       {
  44.          enemycount = 0;
  45.       }
  46.       point3 = new object();
  47.       point3.x = 260;
  48.       point3.y = 10;
  49.       _root.bg.globalToLocal(point3);
  50.       _root.bg.attachMovie("baddie","baddie3" + enemycount,enemycount);
  51.       _root.bg["baddie3" + enemycount]._x = point3.x;
  52.       _root.bg["baddie3" + enemycount]._y = 15;
  53.    }
  54. }
  55. function spawnEnemy4()
  56. {
  57.    if(_root.spawncontrol == "on")
  58.    {
  59.       enemycount += 1;
  60.       if(enemycount > max_enem)
  61.       {
  62.          enemycount = 0;
  63.       }
  64.       point4 = new object();
  65.       point4.x = -20;
  66.       point4.y = 10;
  67.       _root.bg.globalToLocal(point4);
  68.       _root.bg.attachMovie("baddie2","baddie4" + enemycount,enemycount);
  69.       _root.bg["baddie4" + enemycount]._x = point4.x;
  70.       _root.bg["baddie4" + enemycount]._y = 15;
  71.    }
  72. }
  73. function spawnEnemy6()
  74. {
  75.    if(_root.spawncontrol == "on")
  76.    {
  77.       enemycount += 1;
  78.       if(enemycount > max_enem)
  79.       {
  80.          enemycount = 0;
  81.       }
  82.       point6 = new object();
  83.       point6.x = 260;
  84.       point6.y = 10;
  85.       _root.bg.globalToLocal(point6);
  86.       _root.bg.attachMovie("baddie3","baddie6" + enemycount,enemycount);
  87.       _root.bg["baddie6" + enemycount]._x = point6.x;
  88.       _root.bg["baddie6" + enemycount]._y = 15;
  89.    }
  90. }
  91. function spawnEnemy7()
  92. {
  93.    if(_root.spawncontrol == "on")
  94.    {
  95.       enemycount += 1;
  96.       if(enemycount > max_enem)
  97.       {
  98.          enemycount = 0;
  99.       }
  100.       point7 = new object();
  101.       point7.x = -20;
  102.       point7.y = 10;
  103.       _root.bg.globalToLocal(point7);
  104.       _root.bg.attachMovie("baddie3","baddie7" + enemycount,enemycount);
  105.       _root.bg["baddie7" + enemycount]._x = point7.x;
  106.       _root.bg["baddie7" + enemycount]._y = 15;
  107.    }
  108. }
  109. function spawnEnemy10()
  110. {
  111.    if(_root.spawncontrol == "on")
  112.    {
  113.       enemycount += 1;
  114.       if(enemycount > max_enem)
  115.       {
  116.          enemycount = 0;
  117.       }
  118.       trace("yeah.. this one");
  119.       point10 = new object();
  120.       point10.x = 260;
  121.       point10.y = 10;
  122.       _root.bg.globalToLocal(point10);
  123.       _root.bg.attachMovie("baddie78","baddie78" + enemycount,enemycount);
  124.       _root.bg["baddie78" + enemycount]._x = point10.x;
  125.       _root.bg["baddie78" + enemycount]._y = -25;
  126.    }
  127. }
  128. function spawnEnemy5()
  129. {
  130.    if(_root.bossspawn == "on")
  131.    {
  132.       enemycount += 1;
  133.       if(enemycount > max_enem)
  134.       {
  135.          enemycount = 0;
  136.       }
  137.       point5 = new object();
  138.       point5.x = 55;
  139.       point5.y = 10;
  140.       _root.bg.globalToLocal(point5);
  141.       _root.bg.attachMovie("baddie5","baddie5" + enemycount,enemycount);
  142.       _root.bg["baddie5" + enemycount]._x = point5.x;
  143.       _root.bg["baddie5" + enemycount]._y = 15;
  144.       _root.bossspawn = "off";
  145.    }
  146. }
  147. max_enem = 20;
  148. var intervalID;
  149. intervalID = setInterval(spawnEnemy,_root.enemyone);
  150. var intervalID2;
  151. intervalID2 = setInterval(spawnEnemy2,_root.enemytwo);
  152. var intervalID3;
  153. intervalID3 = setInterval(spawnEnemy3,_root.enemythree);
  154. var intervalID4;
  155. intervalID4 = setInterval(spawnEnemy4,_root.enemyfour);
  156. var intervalID6;
  157. intervalID6 = setInterval(spawnEnemy6,_root.enemysix);
  158. var intervalID7;
  159. intervalID7 = setInterval(spawnEnemy7,_root.enemyseven);
  160. var intervalID10;
  161. intervalID10 = setInterval(spawnEnemy10,_root.enemyten);
  162. var intervalID5;
  163. intervalID5 = setInterval(spawnEnemy5,_root.bosslevelone);
  164. stop();
  165.