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

  1. function catchKey()
  2. {
  3.    var _loc1_ = Key.getCode();
  4.    switch(_loc1_)
  5.    {
  6.       case 49:
  7.          onePlayerGame();
  8.          break;
  9.       case 50:
  10.          twoPlayerGame();
  11.          break;
  12.       case 79:
  13.          options();
  14.    }
  15. }
  16. function onePlayerGame()
  17. {
  18.    textIntro.btnOnePlayer.enabled = false;
  19.    Key.removeListener(this);
  20.    sChoix = "1 Player";
  21.    gotoAndPlay(13);
  22. }
  23. function twoPlayerGame()
  24. {
  25.    textIntro.btnTwoPlayers.enabled = false;
  26.    Key.removeListener(this);
  27.    sChoix = "2 Players";
  28.    gotoAndPlay(13);
  29. }
  30. function options()
  31. {
  32.    textIntro.btnOptions.enabled = false;
  33.    Key.removeListener(this);
  34.    sChoix = "Options";
  35.    gotoAndPlay(13);
  36. }
  37. stop();
  38. var nPlayers = 0;
  39. var sPlayerName1 = "Player1";
  40. var nLevel1 = 0;
  41. var nHandicap1 = 0;
  42. var nMatchPoint1 = 0;
  43. var sPlayerName2 = "Player2";
  44. var nLevel2 = 0;
  45. var nHandicap2 = 0;
  46. var nMatchPoint2 = 0;
  47. var sChoix = "Options";
  48. Key.removeListener(this);
  49. Key.addListener(this);
  50. this.onKeyDown = catchKey;
  51. textIntro.btnOnePlayer.onPress = function()
  52. {
  53.    onePlayerGame();
  54. };
  55. textIntro.btnTwoPlayers.onPress = function()
  56. {
  57.    twoPlayerGame();
  58. };
  59. textIntro.btnOptions.onPress = function()
  60. {
  61.    options();
  62. };
  63.