home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Esportes / SkiRun.swf / scripts / frame_5 / DoAction.as
Encoding:
Text File  |  2005-08-05  |  2.6 KB  |  142 lines

  1. function playSound()
  2. {
  3.    effect1.start();
  4. }
  5. function playWind()
  6. {
  7.    effect2.start();
  8. }
  9. function cheer()
  10. {
  11.    effect3.start();
  12. }
  13. function bells()
  14. {
  15.    effect4.start();
  16. }
  17. function swish()
  18. {
  19.    effect5.setPan(0);
  20.    effect5.start();
  21. }
  22. function swishLeft()
  23. {
  24.    effect5.setPan(-50);
  25.    effect5.start();
  26. }
  27. function swishRight()
  28. {
  29.    effect5.setPan(50);
  30.    effect5.start();
  31. }
  32. function pause()
  33. {
  34.    main.translated_x = 0;
  35.    main.translated_z = 0;
  36.    main.keyControl.playing = false;
  37.    main.keyControl.translateIncr = 0;
  38.    main.keyControl.translateIncrFast = 0;
  39.    main.keyControl.straffeIncr = 0;
  40.    main.keyControl.straffeSlow = 0;
  41.    main.keyControl.straffeFast = 0;
  42. }
  43. function disqualify(flagNum)
  44. {
  45.    miss.miss = miss.miss + 1;
  46.    playSound();
  47.    if(miss.miss >= 3)
  48.    {
  49.       pause();
  50.       bells();
  51.       disqualified.gotoAndPlay(2);
  52.    }
  53. }
  54. function levelComplete()
  55. {
  56.    pause();
  57.    cheer();
  58.    if(stage < 5)
  59.    {
  60.       gameOver.gotoAndPlay(2);
  61.    }
  62.    else
  63.    {
  64.       endGame.gotoAndPlay(2);
  65.    }
  66. }
  67. function outOfTime()
  68. {
  69.    pause();
  70.    playSound();
  71.    bells();
  72.    timeOut.gotoAndPlay(2);
  73. }
  74. function reStart()
  75. {
  76.    cheer();
  77.    bells();
  78.    stageNumber.gotoAndPlay(1);
  79.    timeOut.gotoAndStop(1);
  80.    gameOver.gotoAndStop(1);
  81.    disqualified.gotoAndStop(1);
  82.    cover.gotoAndStop(1);
  83.    mountains.reset();
  84.    ground.reset();
  85.    miss.miss = 0;
  86.    gotoAndPlay(5);
  87. }
  88. function nextStage()
  89. {
  90.    stage++;
  91.    stageNumber.nextFrame();
  92.    stageNumber.play();
  93.    cheer();
  94.    bells();
  95.    timeOut.gotoAndStop(1);
  96.    gameOver.gotoAndStop(1);
  97.    disqualified.gotoAndStop(1);
  98.    cover.gotoAndStop(1);
  99.    mountains.reset();
  100.    ground.reset();
  101.    if(stage == 2)
  102.    {
  103.       mountains.gotoAndStop(2);
  104.       ground._y = 184;
  105.    }
  106.    else if(stage == 3)
  107.    {
  108.       mountains.gotoAndStop(3);
  109.       ground.gotoAndStop(2);
  110.       ground._y = 184;
  111.    }
  112.    else if(stage == 4)
  113.    {
  114.       mountains.gotoAndStop(4);
  115.       ground.gotoAndStop(3);
  116.       cover.gotoAndStop(2);
  117.    }
  118.    else if(stage == 5)
  119.    {
  120.       mountains.gotoAndStop(5);
  121.       ground.gotoAndStop(1);
  122.       cover.gotoAndStop(3);
  123.    }
  124.    miss.miss = 0;
  125.    gotoAndPlay(6);
  126. }
  127. _quality = "low";
  128. effect1 = new Sound("gameSound1");
  129. effect1.attachSound("missSound");
  130. effect2 = new Sound("gameSound2");
  131. effect2.attachSound("wind");
  132. effect3 = new Sound("gameSound3");
  133. effect3.attachSound("cheer");
  134. effect4 = new Sound("gameSound4");
  135. effect4.attachSound("cowbells");
  136. effect5 = new Sound("gameSound5");
  137. effect5.attachSound("swish");
  138. stage = 1;
  139. score = 0;
  140. cheer();
  141. bells();
  142.