home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / Kung_Fu.swf / scripts / frame_76 / 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.       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 = 270;
  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 = 200;
  85.       point5.y = 10;
  86.       _root.bg.globalToLocal(point5);
  87.       _root.bg.attachMovie("baddie8","baddie8" + enemycount,enemycount);
  88.       _root.bg["baddie8" + enemycount]._x = point5.x;
  89.       _root.bg["baddie8" + enemycount]._y = 22;
  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 = -20;
  104.       point6.y = 10;
  105.       _root.bg.globalToLocal(point6);
  106.       _root.bg.attachMovie("baddie24","baddie24" + enemycount,enemycount);
  107.       _root.bg["baddie24" + enemycount]._x = point6.x;
  108.       _root.bg["baddie24" + 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("baddie24","baddie24" + enemycount,enemycount);
  125.       _root.bg["baddie24" + enemycount]._x = point7.x;
  126.       _root.bg["baddie24" + 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("baddie78","baddie78" + enemycount,enemycount);
  143.       _root.bg["baddie78" + enemycount]._x = point8.x;
  144.       _root.bg["baddie78" + enemycount]._y = -25;
  145.    }
  146. }
  147. max_enem = 10;
  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 intervalID5;
  157. intervalID5 = setInterval(spawnEnemy5,_root.bosslevelone);
  158. var intervalID6;
  159. intervalID6 = setInterval(spawnEnemy4,_root.enemysix);
  160. var intervalID7;
  161. intervalID7 = setInterval(spawnEnemy5,_root.enemyseven);
  162. var intervalID8;
  163. intervalID8 = setInterval(spawnEnemy8,_root.enemyeight);
  164. stop();
  165.