home *** CD-ROM | disk | FTP | other *** search
/ GKGM 014 / GKGM014.iso / trash / gorillazgroove.swf / scripts / frame_9 / DoAction.as
Text File  |  2007-01-09  |  26KB  |  618 lines

  1. _root.mySound.song.start();
  2. lightPlayer._visible = false;
  3. lightComp._visible = false;
  4. offset = 2000;
  5. scale = 20;
  6. time = 150;
  7. rightTotal = 0;
  8. leftTotal = 0;
  9. rhythmMarkTotal = 0;
  10. grooveMarkTotal = 0;
  11. right = new Array(6806,7671,8544,9400,10273,11138,12002,12869,13734,14600,15474,16335,17199,18070,18934,19795,20658,21535,22393,23263,24132,24994,25860,26733,27613,28461,29333,30197,33661,34526,35400,36273,37126,37998,38864,39729,40589,41459,42327,43197,44927,45795,46658,47513,48386,49258,50133,50984,51856,52713,53580,55313,56184,57041,57913,58779,59655,60513,61383,62250,63113,79570,80442,81313,82175,83026,83913,84765,85636,86513,87374,88231,89113,89964,90835,91713,92568,93435,96034,96913,97762,98634,99513,100367,101233,102113,102951,103853,104713,105571,106422,108165,109913,110765,111623,112513,113350,114216,115083,115954,116826,117686,118558,119429,120313,121163,122024,122886,123757,124619,125480,126357,127213,128089,128936,129827,130674,131543,132427,133296,134143,135000,135873,136750,137611,166200,167077,167938,168807,169669,170538,171400,172269,173133,174000,174867,175725,176592,177500,177500,179184,180060,180927,181803,182661,183537,184392,185254,186109,187000,187855,190455,191332,192179,193056,193926,194780,195657,196514,197396,198258,199112,200000,204321,205176,206045,206907,207799,208653,209506,210385,211261,212123,213000,213855);
  12. rhythmMark = new Array(6806,7671,8544,9400,10273,11138,12002,12869,13734,14600,15474,16335,17199,18070,18934,19795,20658,21535,22393,23263,24132,24994,25860,26733,27613,28461,29333,30197,31063,31929,32795,33661,34526,35400,36273,37126,37998,38864,39729,40589,41459,42327,43197,44062,44927,45795,46658,47513,48386,49258,50133,50984,51856,52713,53580,54446,55313,56184,57041,57913,58779,59655,60513,61383,62250,63113,63979,64845,65711,66577,67443,68309,69175,70041,70907,71773,72639,73505,74371,75237,76103,76969,77835,78701,79570,80442,81313,82175,83026,83913,84765,85636,86513,87374,88231,89113,89964,90835,91713,92568,93435,94301,95167,96034,96913,97762,98634,99513,100367,101233,102113,102951,103853,104713,105571,106422,107288,108165,109031,109913,110765,111623,112513,113350,114216,115083,115954,116826,117686,118558,119429,120313,121163,122024,122886,123757,124619,125480,126357,127213,128089,128936,129827,130674,131543,132427,133296,134143,135000,135873,136750,137611,138477,139343,140209,141075,141941,142807,143673,144539,145405,146271,147137,148003,148869,149735,150601,151467,152333,153199,154065,154931,155797,156663,157529,158395,159261,160127,160993,161859,162725,163591,164457,165323,166200,167077,167938,168807,169669,170538,171400,172269,173133,174000,174867,175725,176592,177500,178366,179184,180060,180927,181803,182661,183537,184392,185254,186109,187000,187855,188721,189587,190455,191332,192179,193056,193926,194780,195657,196514,197396,198258,199112,200000,200866,201732,202598,203464,204321,205176,206045,206907,207799,208653,209506,210385,211261,212123,213000,213855);
  13. left = new Array(6374,7455,8113,9190,9841,10913,11574,12656,13313,14386,15034,16127,16769,17854,18500,19371,20240,21313,21966,23049,23694,24784,25436,26294,26513,27164,28247,28898,29983,33446,34097,35200,35832,36913,37565,38647,39295,40377,41030,42113,42761,45580,46226,47313,47966,49039,49689,50774,51427,52513,53151,54880,56010,56618,57713,58346,59426,60079,61164,61817,62913,63550,79142,80233,80875,81966,82618,83713,84341,85208,86074,87155,87807,88888,89540,90621,91273,92369,93001,95815,96472,97553,98201,99286,99939,101014,101677,102752,103405,104480,105113,106208,106866,107946,108594,109679,110352,111417,112060,113145,113798,114874,115513,116617,117258,118349,118991,120007,120713,121810,122452,123543,124190,125276,125913,127004,127662,128737,129378,130460,131116,132191,132847,133944,134585,135682,136308,137383,165781,166856,167500,168594,169220,170325,171000,171834,172704,173777,174429,175500,176154,177245,177888,178344,178764,179086,179407,179640,180703,181365,182446,183090,184171,184819,185917,186551,187663,190029,191126,191759,192850,193500,194566,195230,196320,196961,198037,198692,199775,203879,204955,205618,206701,207364,208440,209095,210178,210819,211910,212558,213634);
  14. grooveMark = new Array(6374,6806,7455,7671,8113,8544,9190,9400,9841,10273,10913,11138,11574,12002,12656,12869,13313,13734,14386,14600,15034,15474,16127,16335,16769,17199,17854,18070,18500,18934,19371,19795,20240,20658,21313,21535,21966,22393,23049,23263,23694,24132,24784,24994,25436,25860,26513,26733,27164,27613,28247,28461,28898,29333,29983,30197,30629,31063,31714,31929,32361,32795,33446,33661,34097,34526,35200,35400,35832,36273,36913,37126,37565,37998,38647,38864,39295,39729,40377,40589,41030,41459,42113,42327,42761,43197,43847,44062,44493,44927,45580,45795,46226,46658,47313,47513,47966,48386,49039,49258,49689,50133,50774,50984,51427,51856,52513,52713,53151,53580,54231,54446,54880,55313,56010,56184,56618,57041,57713,57913,58346,58779,59426,59655,60079,60513,61164,61383,79142,79570,80233,80442,80875,81313,81966,82175,82618,83026,83713,83913,84341,84765,85208,85636,86074,86513,87155,87374,87807,88231,88888,89113,89540,89964,90621,90835,91273,91713,92369,92568,93001,93435,94086,94301,94733,95167,95815,96034,96472,96913,97553,97762,98201,98634,99286,99513,99939,100367,101014,101233,101677,102113,102752,102951,103405,103853,104480,104713,105113,105571,106208,106422,106866,107288,107946,108165,108594,109031,109679,109913,110352,110765,111417,111623,112060,112513,113145,113350,113798,114216,114874,115083,115513,115954,116617,116826,117258,117686,118349,118558,118991,119429,120007,120313,120713,121163,121810,122024,122452,122886,123543,123757,124190,124619,125276,125480,125913,126357,127004,127213,127662,128089,128737,128936,129378,129827,130460,130674,131116,131543,132191,132427,132847,133296,133944,134143,134585,135000,135682,135873,136308,136750,137383,137611,165781,166200,166856,167077,167500,167938,168594,168807,169220,169669,170325,170538,171000,171400,171834,172269,172704,173133,173777,174000,174429,174867,175500,175725,176154,176592,177245,177500,177888,178366,178764,179184,179640,180060,180703,180927,181365,181803,182446,182661,183090,183537,184171,184392,184819,185254,185917,186109,186551,187000,187663,187855,188287,188721,189372,189587,190029,190455,191126,191332,191759,192179,192850,193056,193500,193926,194566,194780,195230,195657,196320,196514,196961,197396,198037,198258,198692,199112,199775,200000,200432,200866,201517,201732,202164,202598,203149,203464,203879,204321,204955,205176,205618,206045,206701,206907,207364,207799,208440,208653,209095,209506,210178,210385,210819,211261,211910,212123,212558,213000,213634,213855);
  15. grooveMove = new Array(0,0,0,0);
  16. russelLeftDestination = 0;
  17. russelRightDestination = 0;
  18. russelHeadDestination = 0;
  19. gorillaHeadDestination = 0;
  20. gorillaArmDestination = 60;
  21. gorillaHandRightDestination = 7;
  22. gorillaHandLeftDestination = -7;
  23. gorillaTorsoDestination = 15;
  24. gorillaLegLeftDestination = 0;
  25. gorillaLegLeftUpperDestination = 0;
  26. twoDHeadDestination = 68;
  27. twoDTorsoDestination = 74;
  28. twoDArmRightDestination = 0;
  29. twoDArmRightLowerDestination = 0;
  30. twoDArmLeftDestination = 0;
  31. twoDArmLeftLowerDestination = 0;
  32. twoDLegLeftDestination = 0;
  33. twoDLegLeftUpperDestination = 0;
  34. twoDLegRightDestination = 0;
  35. twoDLegRightUpperDestination = 0;
  36. i = 0;
  37. nextI = 4;
  38. turn = "comp";
  39. hitFirst = true;
  40. hitSecond = true;
  41. hitThird = true;
  42. perfect = 0;
  43. late = 0;
  44. early = 0;
  45. penalty = 0;
  46. roundOnePerfect = 0;
  47. roundOneLate = 0;
  48. roundOneEarly = 0;
  49. roundOne = true;
  50. roundTwo = true;
  51. roundThree = true;
  52. roundOneEnd = true;
  53. roundTwoEnd = true;
  54. roundThreeEnd = true;
  55. roundResultsDestination = 400;
  56. compLeft.yellow._alpha = 0;
  57. compLeft.green._alpha = 0;
  58. compLeft.red._alpha = 0;
  59. compLeft.orange._alpha = 0;
  60. compRight.yellow._alpha = 0;
  61. compRight.green._alpha = 0;
  62. compRight.red._alpha = 0;
  63. compRight.orange._alpha = 0;
  64. compDown.yellow._alpha = 0;
  65. compDown.green._alpha = 0;
  66. compDown.red._alpha = 0;
  67. compDown.orange._alpha = 0;
  68. playerLeft.yellow._alpha = 0;
  69. playerLeft.green._alpha = 0;
  70. playerLeft.red._alpha = 0;
  71. playerLeft.orange._alpha = 0;
  72. playerRight.yellow._alpha = 0;
  73. playerRight.green._alpha = 0;
  74. playerRight.red._alpha = 0;
  75. playerRight.orange._alpha = 0;
  76. playerDown.yellow._alpha = 0;
  77. playerDown.green._alpha = 0;
  78. playerDown.red._alpha = 0;
  79. playerDown.orange._alpha = 0;
  80. brickWallDestination = -410;
  81. inARow = 0;
  82. currentInARow = 0;
  83. endGame = true;
  84. actions.onEnterFrame = function()
  85. {
  86.    if(mySound.song.position > grooveMark[i] - 25)
  87.    {
  88.       if(turn == "comp")
  89.       {
  90.          grooveMove[i % 4] = int(Math.random() * 3);
  91.          if(grooveMove[i % 4] == 0)
  92.          {
  93.             compLeft.green._alpha = 100;
  94.             gorilla.torso.armLeft._y = 30;
  95.             gorilla.torso.armLeft._rotation = 10;
  96.             gorilla.torso.armLeft.hand._rotation = -40;
  97.             i++;
  98.          }
  99.          else if(grooveMove[i % 4] == 1)
  100.          {
  101.             compRight.green._alpha = 100;
  102.             gorilla.torso.armRight._y = 30;
  103.             gorilla.torso.armRight._rotation = -10;
  104.             gorilla.torso.armRight.hand._rotation = 40;
  105.             i++;
  106.          }
  107.          else if(grooveMove[i % 4] == 2)
  108.          {
  109.             compDown.green._alpha = 100;
  110.             gorilla.torso.armLeft._rotation = -15;
  111.             gorilla.torso.armLeft.hand._rotation = -80;
  112.             gorilla.torso.armRight._rotation = 15;
  113.             gorilla.torso.armRight.hand._rotation = 80;
  114.             i++;
  115.          }
  116.       }
  117.       else if(turn == "player")
  118.       {
  119.          if(mySound.song.position - 200 > grooveMark[i] + 100 && i != 376)
  120.          {
  121.             i++;
  122.          }
  123.       }
  124.    }
  125.    if(compLeft.yellow._alpha > 0)
  126.    {
  127.       compLeft.yellow._alpha -= 6.25;
  128.    }
  129.    if(compLeft.green._alpha > 0)
  130.    {
  131.       compLeft.green._alpha -= 6.25;
  132.    }
  133.    if(compLeft.red._alpha > 0)
  134.    {
  135.       compLeft.red._alpha -= 6.25;
  136.    }
  137.    if(compLeft.orange._alpha > 0)
  138.    {
  139.       compLeft.orange._alpha -= 6.25;
  140.    }
  141.    if(compRight.yellow._alpha > 0)
  142.    {
  143.       compRight.yellow._alpha -= 6.25;
  144.    }
  145.    if(compRight.green._alpha > 0)
  146.    {
  147.       compRight.green._alpha -= 6.25;
  148.    }
  149.    if(compRight.red._alpha > 0)
  150.    {
  151.       compRight.red._alpha -= 6.25;
  152.    }
  153.    if(compRight.orange._alpha > 0)
  154.    {
  155.       compRight.orange._alpha -= 6.25;
  156.    }
  157.    if(compDown.yellow._alpha > 0)
  158.    {
  159.       compDown.yellow._alpha -= 6.25;
  160.    }
  161.    if(compDown.green._alpha > 0)
  162.    {
  163.       compDown.green._alpha -= 6.25;
  164.    }
  165.    if(compDown.red._alpha > 0)
  166.    {
  167.       compDown.red._alpha -= 6.25;
  168.    }
  169.    if(compDown.orange._alpha > 0)
  170.    {
  171.       compDown.orange._alpha -= 6.25;
  172.    }
  173.    if(playerLeft.yellow._alpha > 0)
  174.    {
  175.       playerLeft.yellow._alpha -= 6.25;
  176.    }
  177.    if(playerLeft.green._alpha > 0)
  178.    {
  179.       playerLeft.green._alpha -= 6.25;
  180.    }
  181.    if(playerLeft.red._alpha > 0)
  182.    {
  183.       playerLeft.red._alpha -= 6.25;
  184.    }
  185.    if(playerLeft.orange._alpha > 0)
  186.    {
  187.       playerLeft.orange._alpha -= 6.25;
  188.    }
  189.    if(playerRight.yellow._alpha > 0)
  190.    {
  191.       playerRight.yellow._alpha -= 6.25;
  192.    }
  193.    if(playerRight.green._alpha > 0)
  194.    {
  195.       playerRight.green._alpha -= 6.25;
  196.    }
  197.    if(playerRight.red._alpha > 0)
  198.    {
  199.       playerRight.red._alpha -= 6.25;
  200.    }
  201.    if(playerRight.orange._alpha > 0)
  202.    {
  203.       playerRight.orange._alpha -= 6.25;
  204.    }
  205.    if(playerDown.yellow._alpha > 0)
  206.    {
  207.       playerDown.yellow._alpha -= 6.25;
  208.    }
  209.    if(playerDown.green._alpha > 0)
  210.    {
  211.       playerDown.green._alpha -= 6.25;
  212.    }
  213.    if(playerDown.red._alpha > 0)
  214.    {
  215.       playerDown.red._alpha -= 6.25;
  216.    }
  217.    if(playerDown.orange._alpha > 0)
  218.    {
  219.       playerDown.orange._alpha -= 6.25;
  220.    }
  221.    if(mySound.song.position > grooveMark[0] - 225 && hitFirst)
  222.    {
  223.       lightComp._visible = true;
  224.       hitFirst = false;
  225.    }
  226.    if(mySound.song.position > grooveMark[128] - 225 && hitSecond)
  227.    {
  228.       lightComp._visible = true;
  229.       hitSecond = false;
  230.    }
  231.    if(mySound.song.position > grooveMark[264] - 225 && hitThird)
  232.    {
  233.       lightComp._visible = true;
  234.       hitThird = false;
  235.    }
  236.    if(mySound.song.position > grooveMark[127] + 500 && roundOne)
  237.    {
  238.       roundOnePerfect = perfect;
  239.       roundOneEarly = early;
  240.       roundOneLate = late;
  241.       roundOneAccuracy = Math.round((roundOnePerfect + (roundOneEarly + roundOneLate) / 2) / 64 * 100);
  242.       roundResults.gotoAndStop("roundOne");
  243.       roundResultsDestination = 171;
  244.       roundResults.perfect.text = roundOnePerfect;
  245.       roundResults.perfectShad.text = roundOnePerfect;
  246.       roundResults.early.text = roundOneEarly;
  247.       roundResults.earlyShad.text = roundOneEarly;
  248.       roundResults.late.text = roundOneLate;
  249.       roundResults.lateShad.text = roundOneLate;
  250.       roundResults.accuracy.text = roundOneAccuracy + "%";
  251.       roundResults.accuracyShad.text = roundOneAccuracy + "%";
  252.       roundOne = false;
  253.    }
  254.    if(mySound.song.position > grooveMark[263] + 500 && roundTwo)
  255.    {
  256.       roundTwoPerfect = perfect - roundOnePerfect;
  257.       roundTwoEarly = early - roundOneEarly;
  258.       roundTwoLate = late - roundOneLate;
  259.       roundTwoAccuracy = Math.round((roundTwoPerfect + (roundTwoEarly + roundTwoLate) / 2) / 68 * 100);
  260.       roundResults.gotoAndStop("roundTwo");
  261.       roundResultsDestination = 171;
  262.       roundResults.perfect.text = roundTwoPerfect;
  263.       roundResults.perfectShad.text = roundTwoPerfect;
  264.       roundResults.early.text = roundTwoEarly;
  265.       roundResults.earlyShad.text = roundTwoEarly;
  266.       roundResults.late.text = roundTwoLate;
  267.       roundResults.lateShad.text = roundTwoLate;
  268.       roundResults.accuracy.text = roundTwoAccuracy + "%";
  269.       roundResults.accuracyShad.text = roundTwoAccuracy + "%";
  270.       roundTwo = false;
  271.    }
  272.    if(mySound.song.position > grooveMark[375] + 500 && roundThree)
  273.    {
  274.       roundThreePerfect = perfect - roundOnePerfect - roundTwoPerfect;
  275.       roundThreeEarly = early - roundOneEarly - roundTwoEarly;
  276.       roundThreeLate = late - roundOneLate - roundTwoLate;
  277.       roundThreeAccuracy = Math.round((roundThreePerfect + (roundThreeEarly + roundThreeLate) / 2) / 56 * 100);
  278.       roundResults.gotoAndStop("roundThree");
  279.       roundResultsDestination = 171;
  280.       roundResults.perfect.text = roundThreePerfect;
  281.       roundResults.perfectShad.text = roundThreePerfect;
  282.       roundResults.early.text = roundThreeEarly;
  283.       roundResults.earlyShad.text = roundThreeEarly;
  284.       roundResults.late.text = roundThreeLate;
  285.       roundResults.lateShad.text = roundThreeLate;
  286.       roundResults.accuracy.text = roundThreeAccuracy + "%";
  287.       roundResults.accuracyShad.text = roundThreeAccuracy + "%";
  288.       roundThree = false;
  289.    }
  290.    if(mySound.song.position > grooveMark[128] - 2000 && roundOneEnd)
  291.    {
  292.       roundResultsDestination = 400;
  293.       roundOneEnd = false;
  294.    }
  295.    if(mySound.song.position > grooveMark[264] - 2000 && roundTwoEnd)
  296.    {
  297.       roundResultsDestination = 400;
  298.       roundTwoEnd = false;
  299.    }
  300.    if(mySound.song.position >= mySound.song.duration - 100 && roundThreeEnd)
  301.    {
  302.       roundResultsDestination = 400;
  303.       roundThreeEnd = false;
  304.    }
  305.    if(mySound.song.position > grooveMark[i - 1] + 225)
  306.    {
  307.       if(i % 4 == 0 && i == nextI)
  308.       {
  309.          if(turn == "comp")
  310.          {
  311.             turn = "player";
  312.             lightPlayer._visible = true;
  313.             lightComp._visible = false;
  314.          }
  315.          else if(turn == "player" && i != 128 && i != 264 && i != 376)
  316.          {
  317.             turn = "comp";
  318.             lightPlayer._visible = false;
  319.             lightComp._visible = true;
  320.          }
  321.          else
  322.          {
  323.             turn = "comp";
  324.             lightPlayer._visible = false;
  325.             lightComp._visible = false;
  326.          }
  327.          nextI += 4;
  328.       }
  329.    }
  330.    if(roundResults._y != roundResultsDestination)
  331.    {
  332.       roundResults._y -= (roundResults._y - roundResultsDestination) / 5;
  333.    }
  334.    if(roundResults._y >= 399.5)
  335.    {
  336.       roundResults.gotoAndStop("blank");
  337.    }
  338.    if(brickWall._y != brickWallDestination)
  339.    {
  340.       brickWall._y -= (brickWall._y - brickWallDestination) / 7;
  341.    }
  342.    if(brickWall._y <= -409.5 && brickWallDestination == -410)
  343.    {
  344.       brickWall.gotoAndStop("blank");
  345.    }
  346.    if(mySound.song.position >= mySound.song.duration - 100 && endGame)
  347.    {
  348.       brickWallDestination = 0;
  349.       brickWall.gotoAndStop("brickWall");
  350.       endGame = false;
  351.    }
  352.    if(brickWall._y >= -0.5 && !endGame)
  353.    {
  354.       Key.removeListener(listener);
  355.       delete actions.onEnterFrame;
  356.       gotoAndStop("enterName");
  357.    }
  358.    if(mySound.song.position <= left[leftTotal] - time)
  359.    {
  360.       russelLeftDestination = 0;
  361.    }
  362.    else if(mySound.song.position <= left[leftTotal])
  363.    {
  364.       russelLeftDestination = -9;
  365.    }
  366.    else if(mySound.song.position >= left[leftTotal] + time)
  367.    {
  368.       leftTotal++;
  369.    }
  370.    else if(mySound.song.position > left[leftTotal])
  371.    {
  372.       russelLeftDestination = 11;
  373.    }
  374.    russel.armLeft._rotation -= (russel.armLeft._rotation - russelLeftDestination) / 3.5;
  375.    if(mySound.song.position <= right[rightTotal] - time)
  376.    {
  377.       russelRightDestination = 0;
  378.       russelHeadDestination = 0;
  379.    }
  380.    else if(mySound.song.position <= right[rightTotal])
  381.    {
  382.       russelRightDestination = 9;
  383.    }
  384.    else if(mySound.song.position >= right[rightTotal] + time)
  385.    {
  386.       rightTotal++;
  387.    }
  388.    else if(mySound.song.position > right[rightTotal])
  389.    {
  390.       russelRightDestination = -11;
  391.       russelHeadDestination = 10;
  392.    }
  393.    if(mySound.song.position <= rhythmMark[rhythmMarkTotal] - time)
  394.    {
  395.       gorillaHeadDestination = 0;
  396.       gorillaArmDestination = 60;
  397.       gorillaTorsoDestination = 15;
  398.       gorillaLegLeftDestination = 0;
  399.       gorillaLegLeftUpperDestination = 0;
  400.       gorillaLegRightDestination = 0;
  401.       gorillaLegRightUpperDestination = 0;
  402.       twoDHeadDestination = 68;
  403.       twoDTorsoDestination = 74;
  404.       twoDArmRightDestination = 0;
  405.       twoDArmRightLowerDestination = 0;
  406.       twoDArmLeftDestination = 0;
  407.       twoDArmLeftLowerDestination = 0;
  408.       twoDLegLeftDestination = 0;
  409.       twoDLegLeftUpperDestination = 0;
  410.       twoDLegRightDestination = 0;
  411.       twoDLegRightUpperDestination = 0;
  412.    }
  413.    else if(mySound.song.position >= rhythmMark[rhythmMarkTotal] + time * 1.5)
  414.    {
  415.       rhythmMarkTotal++;
  416.    }
  417.    else if(mySound.song.position > rhythmMark[rhythmMarkTotal])
  418.    {
  419.       gorillaHeadDestination = 60;
  420.       gorillaArmDestination = 70;
  421.       gorillaTorsoDestination = 60;
  422.       gorillaLegLeftDestination = -20;
  423.       gorillaLegLeftUpperDestination = 80;
  424.       gorillaLegRightDestination = 20;
  425.       gorillaLegRightUpperDestination = -80;
  426.       twoDHeadDestination = 98;
  427.       twoDTorsoDestination = 96;
  428.       twoDArmRightDestination = 10;
  429.       twoDArmRightLowerDestination = -20;
  430.       twoDArmLeftDestination = -10;
  431.       twoDArmLeftLowerDestination = 20;
  432.       twoDLegLeftDestination = -10;
  433.       twoDLegLeftUpperDestination = 20;
  434.       twoDLegRightDestination = 15;
  435.       twoDLegRightUpperDestination = -30;
  436.    }
  437.    russel.armRight.lower._rotation -= (russel.armRight.lower._rotation - russelRightDestination) / 3.5;
  438.    russel.head._y -= (russel.head._y - russelHeadDestination) / 10;
  439.    gorilla.head._y -= (gorilla.head._y - gorillaHeadDestination) / 8;
  440.    gorilla.torso.armLeft._y -= (gorilla.torso.armLeft._y - gorillaArmDestination) / 6;
  441.    gorilla.torso.armRight._y -= (gorilla.torso.armRight._y - gorillaArmDestination) / 6;
  442.    gorilla.torso._y -= (gorilla.torso._y - gorillaTorsoDestination) / 8;
  443.    gorilla.legLeft._rotation -= (gorilla.legLeft._rotation - gorillaLegLeftDestination) / 6;
  444.    gorilla.legLeft.upper._rotation -= (gorilla.legLeft.upper._rotation - gorillaLegLeftUpperDestination) / 6;
  445.    gorilla.legRight._rotation -= (gorilla.legRight._rotation - gorillaLegRightDestination) / 6;
  446.    gorilla.legRight.upper._rotation -= (gorilla.legRight.upper._rotation - gorillaLegRightUpperDestination) / 6;
  447.    twoD.head._y -= (twoD.head._y - twoDHeadDestination) / 8;
  448.    twoD.torso._y -= (twoD.torso._y - twoDTorsoDestination) / 8;
  449.    twoD.torso.armRight._rotation -= (twoD.torso.armRight._rotation - twoDArmRightDestination) / 6;
  450.    twoD.torso.armRight.lower._rotation -= (twoD.torso.armRight.lower._rotation - twoDArmRightLowerDestination) / 6;
  451.    twoD.torso.armLeft._rotation -= (twoD.torso.armLeft._rotation - twoDArmLeftDestination) / 6;
  452.    twoD.torso.armLeft.lower._rotation -= (twoD.torso.armLeft.lower._rotation - twoDArmLeftLowerDestination) / 6;
  453.    twoD.legLeft._rotation -= (twoD.legLeft._rotation - twoDLegLeftDestination) / 6;
  454.    twoD.legLeft.upper._rotation -= (twoD.legLeft.upper._rotation - twoDLegLeftUpperDestination) / 6;
  455.    twoD.legRight._rotation -= (twoD.legRight._rotation - twoDLegRightDestination) / 6;
  456.    twoD.legRight.upper._rotation -= (twoD.legRight.upper._rotation - twoDLegRightUpperDestination) / 6;
  457.    twoD.head._rotation -= twoD.head._rotation / 7;
  458.    gorilla.torso.armLeft._rotation -= gorilla.torso.armLeft._rotation / 7;
  459.    gorilla.torso.armRight._rotation -= gorilla.torso.armRight._rotation / 7;
  460.    gorilla.torso.armLeft.hand._rotation -= (gorilla.torso.armLeft.hand._rotation - gorillaHandLeftDestination) / 6;
  461.    gorilla.torso.armRight.hand._rotation -= (gorilla.torso.armRight.hand._rotation - gorillaHandRightDestination) / 6;
  462. };
  463. listener = new Object();
  464. listener.onKeyDown = function()
  465. {
  466.    if(Key.isDown(39))
  467.    {
  468.       twoD.torso.armRight._rotation = -45;
  469.       twoD.torso.armRight.lower._rotation = 30;
  470.       twoD.torso.armLeft._rotation = 0;
  471.       twoD.torso.armLeft.lower._rotation = -20;
  472.       if(mySound.song.position - 200 > grooveMark[i] - 32 && mySound.song.position - 200 < grooveMark[i] + 32 && grooveMove[i % 4] == 1)
  473.       {
  474.          currentInARow++;
  475.          if(currentInARow > inARow)
  476.          {
  477.             inARow = currentInARow;
  478.          }
  479.          playerRight.green._alpha = 100;
  480.          perfect++;
  481.          i++;
  482.       }
  483.       else if(mySound.song.position - 200 > grooveMark[i] - 100 && mySound.song.position - 200 < grooveMark[i] - 32 && grooveMove[i % 4] == 1)
  484.       {
  485.          if(currentInARow > inARow)
  486.          {
  487.             inARow = currentInARow;
  488.          }
  489.          currentInARow = 0;
  490.          playerRight.yellow._alpha = 100;
  491.          early++;
  492.          i++;
  493.       }
  494.       else if(mySound.song.position - 200 > grooveMark[i] + 32 && mySound.song.position - 200 < grooveMark[i] + 100 && grooveMove[i % 4] == 1)
  495.       {
  496.          if(currentInARow > inARow)
  497.          {
  498.             inARow = currentInARow;
  499.          }
  500.          currentInARow = 0;
  501.          playerRight.orange._alpha = 100;
  502.          late++;
  503.          i++;
  504.       }
  505.       else
  506.       {
  507.          if(currentInARow > inARow)
  508.          {
  509.             inARow = currentInARow;
  510.          }
  511.          currentInARow = 0;
  512.          playerRight.red._alpha = 100;
  513.          penalty++;
  514.       }
  515.    }
  516.    if(Key.isDown(37))
  517.    {
  518.       twoD.torso.armRight._rotation = 0;
  519.       twoD.torso.armRight.lower._rotation = 20;
  520.       twoD.torso.armLeft._rotation = 45;
  521.       twoD.torso.armLeft.lower._rotation = -30;
  522.       if(mySound.song.position - 200 > grooveMark[i] - 32 && mySound.song.position - 200 < grooveMark[i] + 32 && grooveMove[i % 4] == 0)
  523.       {
  524.          currentInARow++;
  525.          if(currentInARow > inARow)
  526.          {
  527.             inARow = currentInARow;
  528.          }
  529.          playerLeft.green._alpha = 100;
  530.          perfect++;
  531.          i++;
  532.       }
  533.       else if(mySound.song.position - 200 > grooveMark[i] - 100 && mySound.song.position - 200 < grooveMark[i] - 32 && grooveMove[i % 4] == 0)
  534.       {
  535.          if(currentInARow > inARow)
  536.          {
  537.             inARow = currentInARow;
  538.          }
  539.          currentInARow = 0;
  540.          playerLeft.yellow._alpha = 100;
  541.          early++;
  542.          i++;
  543.       }
  544.       else if(mySound.song.position - 200 > grooveMark[i] + 32 && mySound.song.position - 200 < grooveMark[i] + 100 && grooveMove[i % 4] == 0)
  545.       {
  546.          if(currentInARow > inARow)
  547.          {
  548.             inARow = currentInARow;
  549.          }
  550.          currentInARow = 0;
  551.          playerLeft.orange._alpha = 100;
  552.          late++;
  553.          i++;
  554.       }
  555.       else
  556.       {
  557.          if(currentInARow > inARow)
  558.          {
  559.             inARow = currentInARow;
  560.          }
  561.          currentInARow = 0;
  562.          playerLeft.red._alpha = 100;
  563.          penalty++;
  564.       }
  565.    }
  566.    if(Key.isDown(40))
  567.    {
  568.       twoD.torso.armRight._rotation = 15;
  569.       twoD.torso.armRight.lower._rotation = 20;
  570.       twoD.torso.armLeft._rotation = -15;
  571.       twoD.torso.armLeft.lower._rotation = -20;
  572.       if(mySound.song.position - 200 > grooveMark[i] - 32 && mySound.song.position - 200 < grooveMark[i] + 32 && grooveMove[i % 4] == 2)
  573.       {
  574.          currentInARow++;
  575.          if(currentInARow > inARow)
  576.          {
  577.             inARow = currentInARow;
  578.          }
  579.          playerDown.green._alpha = 100;
  580.          perfect++;
  581.          i++;
  582.       }
  583.       else if(mySound.song.position - 200 > grooveMark[i] - 100 && mySound.song.position - 200 < grooveMark[i] - 32 && grooveMove[i % 4] == 2)
  584.       {
  585.          if(currentInARow > inARow)
  586.          {
  587.             inARow = currentInARow;
  588.          }
  589.          currentInARow = 0;
  590.          playerDown.yellow._alpha = 100;
  591.          early++;
  592.          i++;
  593.       }
  594.       else if(mySound.song.position - 200 > grooveMark[i] + 32 && mySound.song.position - 200 < grooveMark[i] + 100 && grooveMove[i % 4] == 2)
  595.       {
  596.          if(currentInARow > inARow)
  597.          {
  598.             inARow = currentInARow;
  599.          }
  600.          currentInARow = 0;
  601.          playerDown.orange._alpha = 100;
  602.          late++;
  603.          i++;
  604.       }
  605.       else
  606.       {
  607.          if(currentInARow > inARow)
  608.          {
  609.             inARow = currentInARow;
  610.          }
  611.          currentInARow = 0;
  612.          playerDown.red._alpha = 100;
  613.          penalty++;
  614.       }
  615.    }
  616. };
  617. Key.addListener(listener);
  618.