home *** CD-ROM | disk | FTP | other *** search
/ GKGM 014 / GKGM014.iso / trash / gorillazgroove.swf / scripts / frame_12 / DoAction.as
Text File  |  2007-01-09  |  23KB  |  493 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. roundOne = true;
  43. roundTwo = true;
  44. roundThree = true;
  45. roundOneEnd = true;
  46. roundTwoEnd = true;
  47. roundThreeEnd = true;
  48. roundResultsDestination = 400;
  49. compLeft.yellow._alpha = 0;
  50. compLeft.green._alpha = 0;
  51. compLeft.red._alpha = 0;
  52. compLeft.orange._alpha = 0;
  53. compRight.yellow._alpha = 0;
  54. compRight.green._alpha = 0;
  55. compRight.red._alpha = 0;
  56. compRight.orange._alpha = 0;
  57. compDown.yellow._alpha = 0;
  58. compDown.green._alpha = 0;
  59. compDown.red._alpha = 0;
  60. compDown.orange._alpha = 0;
  61. playerLeft.yellow._alpha = 0;
  62. playerLeft.green._alpha = 0;
  63. playerLeft.red._alpha = 0;
  64. playerLeft.orange._alpha = 0;
  65. playerRight.yellow._alpha = 0;
  66. playerRight.green._alpha = 0;
  67. playerRight.red._alpha = 0;
  68. playerRight.orange._alpha = 0;
  69. playerDown.yellow._alpha = 0;
  70. playerDown.green._alpha = 0;
  71. playerDown.red._alpha = 0;
  72. playerDown.orange._alpha = 0;
  73. brickWallDestination = -410;
  74. demoDone = false;
  75. demoDestination = "home";
  76. endGame = true;
  77. actions.onEnterFrame = function()
  78. {
  79.    if(mySound.song.position > grooveMark[i] - 25)
  80.    {
  81.       if(turn == "comp")
  82.       {
  83.          grooveMove[i % 4] = int(Math.random() * 3);
  84.          if(grooveMove[i % 4] == 0)
  85.          {
  86.             compLeft.green._alpha = 100;
  87.             gorilla.torso.armLeft._y = 30;
  88.             gorilla.torso.armLeft._rotation = 10;
  89.             gorilla.torso.armLeft.hand._rotation = -40;
  90.             i++;
  91.          }
  92.          else if(grooveMove[i % 4] == 1)
  93.          {
  94.             compRight.green._alpha = 100;
  95.             gorilla.torso.armRight._y = 30;
  96.             gorilla.torso.armRight._rotation = -10;
  97.             gorilla.torso.armRight.hand._rotation = 40;
  98.             i++;
  99.          }
  100.          else if(grooveMove[i % 4] == 2)
  101.          {
  102.             compDown.green._alpha = 100;
  103.             gorilla.torso.armLeft._rotation = -15;
  104.             gorilla.torso.armLeft.hand._rotation = -80;
  105.             gorilla.torso.armRight._rotation = 15;
  106.             gorilla.torso.armRight.hand._rotation = 80;
  107.             i++;
  108.          }
  109.       }
  110.       else if(turn == "player")
  111.       {
  112.          if(grooveMove[i % 4] == 0)
  113.          {
  114.             keyboardLeft._yscale = 80;
  115.             keyboardLeft._xscale = 80;
  116.             keyboardLeft._alpha = 50;
  117.             i++;
  118.          }
  119.          else if(grooveMove[i % 4] == 1)
  120.          {
  121.             keyboardRight._yscale = 80;
  122.             keyboardRight._xscale = 80;
  123.             keyboardRight._alpha = 50;
  124.             i++;
  125.          }
  126.          else if(grooveMove[i % 4] == 2)
  127.          {
  128.             keyboardDown._yscale = 80;
  129.             keyboardDown._xscale = 80;
  130.             keyboardDown._alpha = 50;
  131.             i++;
  132.          }
  133.       }
  134.    }
  135.    if(compLeft.yellow._alpha > 0)
  136.    {
  137.       compLeft.yellow._alpha -= 6.25;
  138.    }
  139.    if(compLeft.green._alpha > 0)
  140.    {
  141.       compLeft.green._alpha -= 6.25;
  142.    }
  143.    if(compLeft.red._alpha > 0)
  144.    {
  145.       compLeft.red._alpha -= 6.25;
  146.    }
  147.    if(compLeft.orange._alpha > 0)
  148.    {
  149.       compLeft.orange._alpha -= 6.25;
  150.    }
  151.    if(compRight.yellow._alpha > 0)
  152.    {
  153.       compRight.yellow._alpha -= 6.25;
  154.    }
  155.    if(compRight.green._alpha > 0)
  156.    {
  157.       compRight.green._alpha -= 6.25;
  158.    }
  159.    if(compRight.red._alpha > 0)
  160.    {
  161.       compRight.red._alpha -= 6.25;
  162.    }
  163.    if(compRight.orange._alpha > 0)
  164.    {
  165.       compRight.orange._alpha -= 6.25;
  166.    }
  167.    if(compDown.yellow._alpha > 0)
  168.    {
  169.       compDown.yellow._alpha -= 6.25;
  170.    }
  171.    if(compDown.green._alpha > 0)
  172.    {
  173.       compDown.green._alpha -= 6.25;
  174.    }
  175.    if(compDown.red._alpha > 0)
  176.    {
  177.       compDown.red._alpha -= 6.25;
  178.    }
  179.    if(compDown.orange._alpha > 0)
  180.    {
  181.       compDown.orange._alpha -= 6.25;
  182.    }
  183.    if(playerLeft.yellow._alpha > 0)
  184.    {
  185.       playerLeft.yellow._alpha -= 6.25;
  186.    }
  187.    if(playerLeft.green._alpha > 0)
  188.    {
  189.       playerLeft.green._alpha -= 6.25;
  190.    }
  191.    if(playerLeft.red._alpha > 0)
  192.    {
  193.       playerLeft.red._alpha -= 6.25;
  194.    }
  195.    if(playerLeft.orange._alpha > 0)
  196.    {
  197.       playerLeft.orange._alpha -= 6.25;
  198.    }
  199.    if(playerRight.yellow._alpha > 0)
  200.    {
  201.       playerRight.yellow._alpha -= 6.25;
  202.    }
  203.    if(playerRight.green._alpha > 0)
  204.    {
  205.       playerRight.green._alpha -= 6.25;
  206.    }
  207.    if(playerRight.red._alpha > 0)
  208.    {
  209.       playerRight.red._alpha -= 6.25;
  210.    }
  211.    if(playerRight.orange._alpha > 0)
  212.    {
  213.       playerRight.orange._alpha -= 6.25;
  214.    }
  215.    if(playerDown.yellow._alpha > 0)
  216.    {
  217.       playerDown.yellow._alpha -= 6.25;
  218.    }
  219.    if(playerDown.green._alpha > 0)
  220.    {
  221.       playerDown.green._alpha -= 6.25;
  222.    }
  223.    if(playerDown.red._alpha > 0)
  224.    {
  225.       playerDown.red._alpha -= 6.25;
  226.    }
  227.    if(playerDown.orange._alpha > 0)
  228.    {
  229.       playerDown.orange._alpha -= 6.25;
  230.    }
  231.    if(mySound.song.position > grooveMark[0] - 225 && hitFirst)
  232.    {
  233.       lightComp._visible = true;
  234.       hitFirst = false;
  235.    }
  236.    if(mySound.song.position > grooveMark[128] - 225 && hitSecond)
  237.    {
  238.       lightComp._visible = true;
  239.       hitSecond = false;
  240.    }
  241.    if(mySound.song.position > grooveMark[264] - 225 && hitThird)
  242.    {
  243.       lightComp._visible = true;
  244.       hitThird = false;
  245.    }
  246.    if(keyboardLeft._yscale != 100)
  247.    {
  248.       keyboardLeft._yscale -= (keyboardLeft._yscale - 100) / 5;
  249.       keyboardLeft._xscale -= (keyboardLeft._xscale - 100) / 5;
  250.       keyboardLeft._alpha -= (keyboardLeft._alpha - 100) / 5;
  251.    }
  252.    if(keyboardRight._yscale != 100)
  253.    {
  254.       keyboardRight._yscale -= (keyboardRight._yscale - 100) / 5;
  255.       keyboardRight._xscale -= (keyboardRight._xscale - 100) / 5;
  256.       keyboardRight._alpha -= (keyboardRight._alpha - 100) / 5;
  257.    }
  258.    if(keyboardDown._yscale != 100)
  259.    {
  260.       keyboardDown._yscale -= (keyboardDown._yscale - 100) / 5;
  261.       keyboardDown._xscale -= (keyboardDown._xscale - 100) / 5;
  262.       keyboardDown._alpha -= (keyboardDown._alpha - 100) / 5;
  263.    }
  264.    if(mySound.song.position > grooveMark[i - 1] + 225)
  265.    {
  266.       if(i % 4 == 0 && i == nextI)
  267.       {
  268.          if(turn == "comp")
  269.          {
  270.             turn = "player";
  271.             lightPlayer._visible = true;
  272.             lightComp._visible = false;
  273.          }
  274.          else if(turn == "player" && i != 128 && i != 264 && i != 376)
  275.          {
  276.             turn = "comp";
  277.             lightPlayer._visible = false;
  278.             lightComp._visible = true;
  279.          }
  280.          else
  281.          {
  282.             turn = "comp";
  283.             lightPlayer._visible = false;
  284.             lightComp._visible = false;
  285.          }
  286.          nextI += 4;
  287.       }
  288.    }
  289.    if(brickWall._y != brickWallDestination)
  290.    {
  291.       brickWall._y -= (brickWall._y - brickWallDestination) / 7;
  292.       if(demoDone || mySound.song.position > 61383)
  293.       {
  294.          mySound.song.setVolume(mySound.song.getVolume() - mySound.song.getVolume() / 7);
  295.       }
  296.    }
  297.    if(brickWall._y <= -409.5 && brickWallDestination == -410)
  298.    {
  299.       brickWall.gotoAndStop("blank");
  300.       if(demoDone || mySound.song.position > 61383)
  301.       {
  302.          brickWallDestination = 0;
  303.          brickWall.gotoAndStop("brickWall");
  304.       }
  305.    }
  306.    if(brickWall._y >= -0.5 && (demoDone || mySound.song.position > 61383))
  307.    {
  308.       Key.removeListener(listener);
  309.       delete actions.onEnterFrame;
  310.       _root.mySound.song.stop();
  311.       mySound.song.setVolume(100);
  312.       gotoAndStop(demoDestination);
  313.    }
  314.    if(mySound.song.position <= left[leftTotal] - time)
  315.    {
  316.       russelLeftDestination = 0;
  317.    }
  318.    else if(mySound.song.position <= left[leftTotal])
  319.    {
  320.       russelLeftDestination = -9;
  321.    }
  322.    else if(mySound.song.position >= left[leftTotal] + time)
  323.    {
  324.       leftTotal++;
  325.    }
  326.    else if(mySound.song.position > left[leftTotal])
  327.    {
  328.       russelLeftDestination = 11;
  329.    }
  330.    russel.armLeft._rotation -= (russel.armLeft._rotation - russelLeftDestination) / 3.5;
  331.    if(mySound.song.position <= right[rightTotal] - time)
  332.    {
  333.       russelRightDestination = 0;
  334.       russelHeadDestination = 0;
  335.    }
  336.    else if(mySound.song.position <= right[rightTotal])
  337.    {
  338.       russelRightDestination = 9;
  339.    }
  340.    else if(mySound.song.position >= right[rightTotal] + time)
  341.    {
  342.       rightTotal++;
  343.    }
  344.    else if(mySound.song.position > right[rightTotal])
  345.    {
  346.       russelRightDestination = -11;
  347.       russelHeadDestination = 10;
  348.    }
  349.    if(mySound.song.position <= rhythmMark[rhythmMarkTotal] - time)
  350.    {
  351.       gorillaHeadDestination = 0;
  352.       gorillaArmDestination = 60;
  353.       gorillaTorsoDestination = 15;
  354.       gorillaLegLeftDestination = 0;
  355.       gorillaLegLeftUpperDestination = 0;
  356.       gorillaLegRightDestination = 0;
  357.       gorillaLegRightUpperDestination = 0;
  358.       twoDHeadDestination = 68;
  359.       twoDTorsoDestination = 74;
  360.       twoDArmRightDestination = 0;
  361.       twoDArmRightLowerDestination = 0;
  362.       twoDArmLeftDestination = 0;
  363.       twoDArmLeftLowerDestination = 0;
  364.       twoDLegLeftDestination = 0;
  365.       twoDLegLeftUpperDestination = 0;
  366.       twoDLegRightDestination = 0;
  367.       twoDLegRightUpperDestination = 0;
  368.    }
  369.    else if(mySound.song.position >= rhythmMark[rhythmMarkTotal] + time * 1.5)
  370.    {
  371.       rhythmMarkTotal++;
  372.    }
  373.    else if(mySound.song.position > rhythmMark[rhythmMarkTotal])
  374.    {
  375.       gorillaHeadDestination = 60;
  376.       gorillaArmDestination = 70;
  377.       gorillaTorsoDestination = 60;
  378.       gorillaLegLeftDestination = -20;
  379.       gorillaLegLeftUpperDestination = 80;
  380.       gorillaLegRightDestination = 20;
  381.       gorillaLegRightUpperDestination = -80;
  382.       twoDHeadDestination = 98;
  383.       twoDTorsoDestination = 96;
  384.       twoDArmRightDestination = 10;
  385.       twoDArmRightLowerDestination = -20;
  386.       twoDArmLeftDestination = -10;
  387.       twoDArmLeftLowerDestination = 20;
  388.       twoDLegLeftDestination = -10;
  389.       twoDLegLeftUpperDestination = 20;
  390.       twoDLegRightDestination = 15;
  391.       twoDLegRightUpperDestination = -30;
  392.    }
  393.    russel.armRight.lower._rotation -= (russel.armRight.lower._rotation - russelRightDestination) / 3.5;
  394.    russel.head._y -= (russel.head._y - russelHeadDestination) / 10;
  395.    gorilla.head._y -= (gorilla.head._y - gorillaHeadDestination) / 8;
  396.    gorilla.torso.armLeft._y -= (gorilla.torso.armLeft._y - gorillaArmDestination) / 6;
  397.    gorilla.torso.armRight._y -= (gorilla.torso.armRight._y - gorillaArmDestination) / 6;
  398.    gorilla.torso._y -= (gorilla.torso._y - gorillaTorsoDestination) / 8;
  399.    gorilla.legLeft._rotation -= (gorilla.legLeft._rotation - gorillaLegLeftDestination) / 6;
  400.    gorilla.legLeft.upper._rotation -= (gorilla.legLeft.upper._rotation - gorillaLegLeftUpperDestination) / 6;
  401.    gorilla.legRight._rotation -= (gorilla.legRight._rotation - gorillaLegRightDestination) / 6;
  402.    gorilla.legRight.upper._rotation -= (gorilla.legRight.upper._rotation - gorillaLegRightUpperDestination) / 6;
  403.    twoD.head._y -= (twoD.head._y - twoDHeadDestination) / 8;
  404.    twoD.torso._y -= (twoD.torso._y - twoDTorsoDestination) / 8;
  405.    twoD.torso.armRight._rotation -= (twoD.torso.armRight._rotation - twoDArmRightDestination) / 6;
  406.    twoD.torso.armRight.lower._rotation -= (twoD.torso.armRight.lower._rotation - twoDArmRightLowerDestination) / 6;
  407.    twoD.torso.armLeft._rotation -= (twoD.torso.armLeft._rotation - twoDArmLeftDestination) / 6;
  408.    twoD.torso.armLeft.lower._rotation -= (twoD.torso.armLeft.lower._rotation - twoDArmLeftLowerDestination) / 6;
  409.    twoD.legLeft._rotation -= (twoD.legLeft._rotation - twoDLegLeftDestination) / 6;
  410.    twoD.legLeft.upper._rotation -= (twoD.legLeft.upper._rotation - twoDLegLeftUpperDestination) / 6;
  411.    twoD.legRight._rotation -= (twoD.legRight._rotation - twoDLegRightDestination) / 6;
  412.    twoD.legRight.upper._rotation -= (twoD.legRight.upper._rotation - twoDLegRightUpperDestination) / 6;
  413.    twoD.head._rotation -= twoD.head._rotation / 7;
  414.    gorilla.torso.armLeft._rotation -= gorilla.torso.armLeft._rotation / 7;
  415.    gorilla.torso.armRight._rotation -= gorilla.torso.armRight._rotation / 7;
  416.    gorilla.torso.armLeft.hand._rotation -= (gorilla.torso.armLeft.hand._rotation - gorillaHandLeftDestination) / 6;
  417.    gorilla.torso.armRight.hand._rotation -= (gorilla.torso.armRight.hand._rotation - gorillaHandRightDestination) / 6;
  418. };
  419. listener = new Object();
  420. listener.onKeyDown = function()
  421. {
  422.    if(Key.isDown(39))
  423.    {
  424.       twoD.torso.armRight._rotation = -45;
  425.       twoD.torso.armRight.lower._rotation = 30;
  426.       twoD.torso.armLeft._rotation = 0;
  427.       twoD.torso.armLeft.lower._rotation = -20;
  428.       if(mySound.song.position - 200 > grooveMark[i - 1] - 32 && mySound.song.position - 200 < grooveMark[i - 1] + 32 && grooveMove[(i - 1) % 4] == 1)
  429.       {
  430.          playerRight.green._alpha = 100;
  431.       }
  432.       else if(mySound.song.position - 200 > grooveMark[i - 1] - 100 && mySound.song.position - 200 < grooveMark[i - 1] - 32 && grooveMove[(i - 1) % 4] == 1)
  433.       {
  434.          playerRight.yellow._alpha = 100;
  435.       }
  436.       else if(mySound.song.position - 200 > grooveMark[i] + 32 && mySound.song.position - 200 < grooveMark[i] + 100 && grooveMove[(i - 1) % 4] == 1)
  437.       {
  438.          playerRight.orange._alpha = 100;
  439.       }
  440.       else
  441.       {
  442.          playerRight.red._alpha = 100;
  443.       }
  444.    }
  445.    if(Key.isDown(37))
  446.    {
  447.       twoD.torso.armRight._rotation = 0;
  448.       twoD.torso.armRight.lower._rotation = 20;
  449.       twoD.torso.armLeft._rotation = 45;
  450.       twoD.torso.armLeft.lower._rotation = -30;
  451.       if(mySound.song.position - 200 > grooveMark[i - 1] - 32 && mySound.song.position - 200 < grooveMark[i - 1] + 32 && grooveMove[(i - 1) % 4] == 0)
  452.       {
  453.          playerLeft.green._alpha = 100;
  454.       }
  455.       else if(mySound.song.position - 200 > grooveMark[i - 1] - 100 && mySound.song.position - 200 < grooveMark[i - 1] - 32 && grooveMove[(i - 1) % 4] == 0)
  456.       {
  457.          playerLeft.yellow._alpha = 100;
  458.       }
  459.       else if(mySound.song.position - 200 > grooveMark[i - 1] + 32 && mySound.song.position - 200 < grooveMark[i - 1] + 100 && grooveMove[(i - 1) % 4] == 0)
  460.       {
  461.          playerLeft.orange._alpha = 100;
  462.       }
  463.       else
  464.       {
  465.          playerLeft.red._alpha = 100;
  466.       }
  467.    }
  468.    if(Key.isDown(40))
  469.    {
  470.       twoD.torso.armRight._rotation = 15;
  471.       twoD.torso.armRight.lower._rotation = 20;
  472.       twoD.torso.armLeft._rotation = -15;
  473.       twoD.torso.armLeft.lower._rotation = -20;
  474.       if(mySound.song.position - 200 > grooveMark[i - 1] - 32 && mySound.song.position - 200 < grooveMark[i - 1] + 32 && grooveMove[(i - 1) % 4] == 2)
  475.       {
  476.          playerDown.green._alpha = 100;
  477.       }
  478.       else if(mySound.song.position - 200 > grooveMark[i - 1] - 100 && mySound.song.position - 200 < grooveMark[i - 1] - 32 && grooveMove[(i - 1) % 4] == 2)
  479.       {
  480.          playerDown.yellow._alpha = 100;
  481.       }
  482.       else if(mySound.song.position - 200 > grooveMark[i - 1] + 32 && mySound.song.position - 200 < grooveMark[i - 1] + 100 && grooveMove[(i - 1) % 4] == 2)
  483.       {
  484.          playerDown.orange._alpha = 100;
  485.       }
  486.       else
  487.       {
  488.          playerDown.red._alpha = 100;
  489.       }
  490.    }
  491. };
  492. Key.addListener(listener);
  493.