home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Puzzle / caray_skane.swf / scripts / frame_4 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  11.4 KB  |  343 lines

  1. function level10()
  2. {
  3.    MonSon = new Sound();
  4.    MonSon.attachSound("applause");
  5.    MonSon.start();
  6.    manges = 0;
  7.    ligne0 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  8.    ligne1 = [1,0,1,1,1,0,1,0,1,0,1,0,1,0,1,0,0,0,0,1];
  9.    ligne2 = [1,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1];
  10.    ligne3 = [1,0,1,2,1,2,2,2,2,2,2,2,2,2,2,1,2,1,0,1];
  11.    ligne4 = [1,0,1,2,1,2,1,2,2,2,2,2,2,1,2,1,2,1,0,1];
  12.    ligne5 = [1,0,1,2,1,2,1,2,2,2,2,2,2,1,2,1,2,1,0,1];
  13.    ligne6 = [1,0,1,2,1,2,1,2,2,2,2,2,2,1,2,1,2,1,0,1];
  14.    ligne7 = [1,0,1,2,1,2,1,4,3,3,3,2,2,1,2,1,2,1,0,1];
  15.    ligne8 = [1,0,1,2,1,2,1,2,2,2,2,2,2,1,2,1,2,1,0,1];
  16.    ligne9 = [1,0,1,2,1,2,1,2,2,2,2,2,2,1,2,1,2,1,0,1];
  17.    ligne10 = [1,0,1,2,1,2,2,2,2,2,2,2,2,2,2,1,2,1,0,1];
  18.    ligne11 = [1,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,1];
  19.    ligne12 = [1,0,0,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1];
  20.    ligne13 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  21.    calcultotal();
  22.    restart();
  23. }
  24. function level9()
  25. {
  26.    MonSon = new Sound();
  27.    MonSon.attachSound("applause");
  28.    MonSon.start();
  29.    manges = 0;
  30.    ligne0 = [1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1];
  31.    ligne1 = [1,0,2,2,2,0,1,0,0,0,0,1,2,2,2,2,2,2,2,1];
  32.    ligne2 = [1,2,1,1,1,2,1,0,0,0,0,1,2,1,1,1,1,1,2,1];
  33.    ligne3 = [1,2,1,0,1,2,1,1,1,1,1,1,2,1,0,0,0,1,2,1];
  34.    ligne4 = [1,2,1,0,1,2,1,0,0,0,0,0,2,1,0,0,0,1,2,1];
  35.    ligne5 = [1,2,1,1,1,2,1,0,0,0,0,1,2,1,1,1,1,1,2,1];
  36.    ligne6 = [1,2,2,2,2,2,0,0,0,0,0,1,0,2,2,2,2,2,2,1];
  37.    ligne7 = [1,2,2,2,2,0,1,4,3,3,3,1,0,0,2,2,2,2,2,1];
  38.    ligne8 = [1,2,1,1,1,2,1,0,0,0,0,0,2,1,1,1,1,1,2,1];
  39.    ligne9 = [1,2,1,0,1,2,1,1,1,1,1,1,2,1,0,0,0,1,2,1];
  40.    ligne10 = [1,2,1,0,1,2,1,0,0,0,0,1,2,1,0,0,0,1,2,1];
  41.    ligne11 = [1,2,1,1,1,2,1,0,0,0,0,1,2,1,1,1,1,1,2,1];
  42.    ligne12 = [1,0,2,2,2,0,1,0,0,0,0,1,2,2,2,2,2,2,2,1];
  43.    ligne13 = [1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1];
  44.    calcultotal();
  45.    restart();
  46. }
  47. function level8()
  48. {
  49.    MonSon = new Sound();
  50.    MonSon.attachSound("applause");
  51.    MonSon.start();
  52.    manges = 0;
  53.    ligne0 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  54.    ligne1 = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1];
  55.    ligne2 = [1,2,0,1,1,2,2,2,0,0,1,0,2,2,2,1,1,0,2,1];
  56.    ligne3 = [1,2,1,1,0,0,2,1,1,1,1,1,1,2,0,0,1,1,2,1];
  57.    ligne4 = [1,2,1,0,1,2,2,2,0,1,0,0,2,2,2,1,0,1,2,1];
  58.    ligne5 = [1,2,0,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0,2,1];
  59.    ligne6 = [1,2,2,0,0,0,1,1,0,0,0,2,1,1,0,0,0,0,2,1];
  60.    ligne7 = [1,2,0,2,0,1,1,4,3,3,3,0,0,1,1,0,0,0,2,1];
  61.    ligne8 = [1,2,1,1,2,0,0,0,0,2,1,1,1,1,2,0,0,0,2,1];
  62.    ligne9 = [1,2,0,1,1,2,0,0,2,1,1,2,2,1,1,2,0,0,2,1];
  63.    ligne10 = [1,2,0,0,1,1,2,2,1,1,2,0,0,2,1,1,2,0,2,1];
  64.    ligne11 = [1,2,0,0,0,1,1,1,1,2,0,0,0,0,2,1,1,2,2,1];
  65.    ligne12 = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1];
  66.    ligne13 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  67.    calcultotal();
  68.    restart();
  69. }
  70. function level7()
  71. {
  72.    MonSon = new Sound();
  73.    MonSon.attachSound("applause");
  74.    MonSon.start();
  75.    manges = 0;
  76.    ligne0 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  77.    ligne1 = [1,0,0,0,0,2,2,1,1,2,2,1,1,2,2,0,0,0,0,1];
  78.    ligne2 = [1,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,1];
  79.    ligne3 = [1,0,2,1,0,0,2,2,0,1,1,0,2,2,0,0,1,2,0,1];
  80.    ligne4 = [1,0,2,1,0,1,1,1,1,1,1,1,1,1,1,0,1,2,0,1];
  81.    ligne5 = [1,0,2,1,2,1,1,1,1,2,2,1,1,1,1,2,1,2,0,1];
  82.    ligne6 = [1,0,2,2,2,2,0,1,0,0,0,0,0,0,2,2,2,2,0,1];
  83.    ligne7 = [1,0,2,2,2,2,0,4,3,3,3,0,1,0,2,2,2,2,0,1];
  84.    ligne8 = [1,0,2,1,2,1,1,1,1,2,2,1,1,1,1,2,1,2,0,1];
  85.    ligne9 = [1,0,2,1,0,1,1,1,1,1,1,1,1,1,1,0,1,2,0,1];
  86.    ligne10 = [1,0,2,1,0,0,0,0,0,1,1,0,0,0,0,0,1,2,0,1];
  87.    ligne11 = [1,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,1];
  88.    ligne12 = [1,0,0,0,0,2,2,1,1,2,2,1,1,2,2,0,0,0,0,1];
  89.    ligne13 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  90.    calcultotal();
  91.    restart();
  92. }
  93. function level6()
  94. {
  95.    MonSon = new Sound();
  96.    MonSon.attachSound("applause");
  97.    MonSon.start();
  98.    manges = 0;
  99.    ligne0 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  100.    ligne1 = [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1];
  101.    ligne2 = [1,2,0,1,1,2,1,1,2,1,1,2,1,1,2,1,1,0,2,1];
  102.    ligne3 = [1,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,1];
  103.    ligne4 = [1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1];
  104.    ligne5 = [1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1];
  105.    ligne6 = [1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1];
  106.    ligne7 = [1,0,1,1,1,1,1,4,3,3,3,1,1,1,1,1,1,1,0,1];
  107.    ligne8 = [1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1];
  108.    ligne9 = [1,0,1,0,1,1,1,1,1,0,0,1,1,1,1,1,0,1,0,1];
  109.    ligne10 = [1,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,1];
  110.    ligne11 = [1,2,0,1,1,2,1,1,2,1,1,2,1,1,2,1,1,0,2,1];
  111.    ligne12 = [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1];
  112.    ligne13 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  113.    calcultotal();
  114.    restart();
  115. }
  116. function level5()
  117. {
  118.    MonSon = new Sound();
  119.    MonSon.attachSound("applause");
  120.    MonSon.start();
  121.    manges = 0;
  122.    ligne0 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  123.    ligne1 = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1];
  124.    ligne2 = [1,2,1,1,1,2,1,1,2,1,1,2,1,1,2,1,1,1,2,1];
  125.    ligne3 = [1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1];
  126.    ligne4 = [1,0,1,0,1,1,0,1,1,0,0,1,1,0,1,1,0,1,0,1];
  127.    ligne5 = [1,2,2,2,1,2,2,2,2,2,2,2,2,2,2,1,2,2,2,1];
  128.    ligne6 = [1,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,1,0,1];
  129.    ligne7 = [1,0,1,0,0,0,1,4,3,3,3,0,0,1,0,0,0,1,0,1];
  130.    ligne8 = [1,2,2,2,1,2,2,2,2,2,2,2,2,2,2,1,2,2,2,1];
  131.    ligne9 = [1,0,1,0,1,1,0,1,1,0,0,1,1,0,1,1,0,1,0,1];
  132.    ligne10 = [1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1];
  133.    ligne11 = [1,2,1,1,1,2,1,1,2,1,1,2,1,1,2,1,1,1,2,1];
  134.    ligne12 = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1];
  135.    ligne13 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  136.    calcultotal();
  137.    restart();
  138. }
  139. function level4()
  140. {
  141.    MonSon = new Sound();
  142.    MonSon.attachSound("applause");
  143.    MonSon.start();
  144.    manges = 0;
  145.    ligne0 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  146.    ligne1 = [1,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,2,1];
  147.    ligne2 = [1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,2,2,1];
  148.    ligne3 = [1,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,2,1];
  149.    ligne4 = [1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,2,2,1];
  150.    ligne5 = [1,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,2,1];
  151.    ligne6 = [1,2,1,0,1,0,1,0,1,0,1,0,1,0,1,2,1,2,2,1];
  152.    ligne7 = [1,2,0,2,0,2,0,4,3,3,3,2,0,2,0,2,0,2,2,1];
  153.    ligne8 = [1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,2,2,1];
  154.    ligne9 = [1,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,2,1];
  155.    ligne10 = [1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,2,1];
  156.    ligne11 = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1];
  157.    ligne12 = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1];
  158.    ligne13 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  159.    calcultotal();
  160.    restart();
  161. }
  162. function level1()
  163. {
  164.    MonSon = new Sound();
  165.    MonSon.attachSound("applause");
  166.    MonSon.start();
  167.    manges = 0;
  168.    ligne0 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  169.    ligne1 = [1,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,1];
  170.    ligne2 = [1,0,1,0,1,1,1,1,1,0,1,1,1,1,1,1,0,1,2,1];
  171.    ligne3 = [1,2,1,2,0,2,0,2,0,2,0,2,0,2,0,2,0,1,0,1];
  172.    ligne4 = [1,0,1,0,1,1,1,1,1,1,2,1,1,1,1,1,2,1,2,1];
  173.    ligne5 = [1,2,1,2,1,2,2,0,0,0,0,0,0,2,2,1,0,1,0,1];
  174.    ligne6 = [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,2,1];
  175.    ligne7 = [1,2,0,2,1,0,0,4,3,3,3,0,0,0,0,0,0,0,0,1];
  176.    ligne8 = [1,0,1,0,1,2,2,0,0,0,0,0,0,2,2,1,2,1,2,1];
  177.    ligne9 = [1,2,1,2,1,1,1,1,1,2,1,1,1,1,1,1,0,1,0,1];
  178.    ligne10 = [1,0,1,0,2,0,2,0,2,0,2,0,2,0,2,0,2,1,2,1];
  179.    ligne11 = [1,2,1,0,1,1,1,1,1,1,0,1,1,1,1,1,0,1,0,1];
  180.    ligne12 = [1,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,1];
  181.    ligne13 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  182.    calcultotal();
  183.    restart();
  184. }
  185. function level3()
  186. {
  187.    MonSon = new Sound();
  188.    MonSon.attachSound("applause");
  189.    MonSon.start();
  190.    manges = 0;
  191.    ligne0 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  192.    ligne1 = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,1];
  193.    ligne2 = [1,1,1,1,1,2,1,0,1,0,0,0,0,0,1,2,2,2,2,1];
  194.    ligne3 = [1,2,2,2,2,2,1,0,1,1,1,1,1,0,0,2,1,2,2,1];
  195.    ligne4 = [1,2,2,2,2,2,1,0,0,0,0,0,1,1,0,2,1,2,1,1];
  196.    ligne5 = [1,1,1,1,1,2,1,0,0,0,0,0,0,1,0,2,1,2,2,1];
  197.    ligne6 = [1,0,0,0,0,2,1,1,1,1,1,1,0,1,0,2,1,1,2,1];
  198.    ligne7 = [1,0,1,1,0,2,0,4,3,3,3,1,0,1,0,2,1,2,2,1];
  199.    ligne8 = [1,0,0,0,0,2,1,1,1,1,1,1,0,1,0,2,1,2,1,1];
  200.    ligne9 = [1,0,1,1,0,2,1,0,0,0,0,0,0,1,0,2,1,2,2,1];
  201.    ligne10 = [1,0,1,1,0,2,1,0,1,1,1,1,1,1,0,1,1,1,2,1];
  202.    ligne11 = [1,2,2,1,0,2,0,0,1,1,1,1,1,1,0,1,1,1,2,1];
  203.    ligne12 = [1,2,2,2,0,2,1,0,0,0,0,0,0,0,0,0,0,2,2,1];
  204.    ligne13 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  205.    calcultotal();
  206.    restart();
  207. }
  208. function level2()
  209. {
  210.    MonSon = new Sound();
  211.    MonSon.attachSound("applause");
  212.    MonSon.start();
  213.    manges = 0;
  214.    ligne0 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  215.    ligne1 = [1,2,2,2,1,1,2,2,2,2,2,2,2,2,0,0,2,2,2,1];
  216.    ligne2 = [1,2,1,2,1,1,0,1,1,1,1,1,1,0,1,1,2,1,2,1];
  217.    ligne3 = [1,2,1,2,0,1,0,0,0,1,0,0,0,0,1,1,2,1,2,1];
  218.    ligne4 = [1,2,2,2,0,1,1,1,0,1,0,1,1,0,1,1,2,2,2,1];
  219.    ligne5 = [1,1,1,2,0,0,1,1,0,1,0,1,1,0,0,0,2,1,1,1];
  220.    ligne6 = [1,1,2,2,0,0,1,1,0,1,0,1,1,0,0,0,2,2,1,1];
  221.    ligne7 = [1,1,2,2,2,2,0,4,3,3,3,1,1,0,2,2,2,2,1,1];
  222.    ligne8 = [1,1,1,2,1,0,0,0,0,1,0,0,0,0,0,1,2,1,1,1];
  223.    ligne9 = [1,2,2,2,1,0,1,0,0,1,0,0,0,0,0,1,2,2,2,1];
  224.    ligne10 = [1,2,1,2,1,0,1,1,1,1,1,1,1,1,1,1,2,1,2,1];
  225.    ligne11 = [1,2,1,2,1,0,0,1,1,0,0,0,0,0,0,1,2,1,2,1];
  226.    ligne12 = [1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1];
  227.    ligne13 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  228.    calcultotal();
  229.    restart();
  230. }
  231. function affiche_level()
  232. {
  233.    var _loc1_ = _root;
  234.    i = 1;
  235.    while(i <= long)
  236.    {
  237.       corps.duplicateMovieClip("" + i,i);
  238.       _loc1_["" + i]._x = boax[i];
  239.       _loc1_["" + i]._x = boay[i];
  240.       i++;
  241.    }
  242.    i = 0;
  243.    while(i <= 13)
  244.    {
  245.       j = 0;
  246.       while(j <= 19)
  247.       {
  248.          switch(_loc1_["ligne" + i][j])
  249.          {
  250.             case 1:
  251.                duplicate(mur,i,j);
  252.                break;
  253.             case 2:
  254.                duplicate(fruit,i,j);
  255.          }
  256.          j++;
  257.       }
  258.       i++;
  259.    }
  260. }
  261. function duplicate(clip, i, j)
  262. {
  263.    var _loc1_ = j;
  264.    var _loc2_ = i;
  265.    var _loc3_ = clip;
  266.    _loc3_.duplicateMovieClip(_loc3_._name + (5000 - (20 * _loc2_ + _loc1_)),5000 - (20 * _loc2_ + _loc1_));
  267.    setProperty(_loc3_._name + (5000 - (20 * _loc2_ + _loc1_)), _X, 30 * _loc1_ + 15);
  268.    setProperty(_loc3_._name + (5000 - (20 * _loc2_ + _loc1_)), _Y, 30 * _loc2_ + 15);
  269. }
  270. function removeall()
  271. {
  272.    i = 4;
  273.    while(i <= long)
  274.    {
  275.       removeMovieClip("" + i);
  276.       i++;
  277.    }
  278. }
  279. function resetlevel()
  280. {
  281.    var _loc1_ = _root;
  282.    i = 5000;
  283.    while(i >= 4500)
  284.    {
  285.       _loc1_["fruit" + i].removeMovieClip();
  286.       _loc1_["mur" + i].removeMovieClip();
  287.       i--;
  288.    }
  289. }
  290. function restart()
  291. {
  292.    var _loc1_ = _root;
  293.    resetlevel();
  294.    removeall();
  295.    long = 4;
  296.    manges = 0;
  297.    corpsok = true;
  298.    _loc1_.ligne = _loc1_.colonne = 7;
  299.    boax = [225,255,285,315];
  300.    boay = [225,225,225,225];
  301.    tete._x = _loc1_.boax[0];
  302.    tete._y = _loc1_.boay[0];
  303.    tete._rotation = -90;
  304.    _loc1_.affiche_level();
  305. }
  306. function calcultotal()
  307. {
  308.    var _loc1_ = _root;
  309.    total = 0;
  310.    i = 0;
  311.    while(i <= 13)
  312.    {
  313.       j = 0;
  314.       while(j <= 19)
  315.       {
  316.          if(_loc1_["ligne" + i][j] == 2)
  317.          {
  318.             total++;
  319.          }
  320.          j++;
  321.       }
  322.       i++;
  323.    }
  324. }
  325. stop();
  326. sound1 = new Sound();
  327. sound2 = new Sound();
  328. sound3 = new Sound();
  329. sound3.attachSound("yeah");
  330. sound1.attachSound("mange");
  331. sound2.attachSound("mort");
  332. serveur = true;
  333. long = 4;
  334. level = 1;
  335. vie = 3;
  336. score = 0;
  337. total = manges = 0;
  338. boax = [225,255,285,315];
  339. boay = [225,225,225,225];
  340. ligne = colonne = 7;
  341. corpsok = true;
  342. _root["level" + level]();
  343.