Inheritance: Group
Example #1
0
        public PauseGroup(Card card, Action unPauseCallback)
            : base()
        {
            z = HUD.HUGE_Z + 1;

              this.unPauseCallback = unPauseCallback;

              pauseOverlay = new PauseOverlay();
              add(pauseOverlay);

              this.card = card;
              add(card);

              controls = new Sprite(190, 148);
              controls.loadGraphic("controls", 251, 125);
              controls.visible = false;
              controls.screenPositioning = ScreenPositioning.Absolute;
              add(controls);

              pauseMenu = new Menu(195, 148);
              pauseMenu.addMenuText(new MenuText("RESUME", UnPause));
              pauseMenu.addMenuText(new MenuText("CONTROLS", displayControls));
              pauseMenu.addMenuText(new MenuText("RESTART", restart));
              pauseMenu.addMenuText(new MenuText("QUIT", quit));
              pauseMenu.deactivate();
              add(pauseMenu);

              restartMenu = new Menu(195, 148);
              restartMenu.addMenuText(new MenuText("YES", () => {
            //Assets.getSound("superKO").Play();
            Assets.getSound("startButton").Play();
            restartMenu.deactivate();
            card.Close();
              }));
              restartMenu.addMenuText(new MenuText("NO", goBack));
              restartMenu.deactivate();
              add(restartMenu);
        }
Example #2
0
        public override void Create()
        {
            G.playMusic("titleMusic");
              titleScreen = new Sprite();
              titleScreen.screenPositioning = ScreenPositioning.Absolute;
              titleScreen.loadGraphic("titleScreen", 640, 360);
              add(titleScreen);

              roundOption = new MenuText("ROUNDS:", () => {
            Assets.getSound("select").Play(0.6f, 0, 0);
            GameTracker.RoundsToWin = (GameTracker.RoundsToWin % 5) + 1;
            roundOption.valueText = rounds[GameTracker.RoundsToWin - 1].ToString();
              });
              roundOption.valueText = rounds[GameTracker.RoundsToWin - 1].ToString();

              mainMenu = new Menu(MENU_X, 204);
              mainMenu.addMenuText(new MenuText("START GAME", () => {
            Assets.getSound("superKO").Play();
            flicker = false;
            mainMenu.deactivate();
            G.DoForSeconds(0.5f, () => {
              //MediaPlayer.Volume -= G.elapsed;
            }, () => {
              G.switchState(new TeamSelectState(), "gate");
            });
              }));
              mainMenu.addMenuText(new MenuText("CONTROLS", displayControls));
              mainMenu.addMenuText(roundOption);
              //mainMenu.addMenuText(new MenuText("OPTIONS", displayOptions));
              mainMenu.addMenuText(new MenuText("CREDITS", displayCredits));
              mainMenu.addMenuText(new MenuText("EXIT", () => G.exit()));
              mainMenu.deactivate();
              add(mainMenu);

              optionsMenu = new Menu(MENU_X, 204);
              //optionsMenu.addMenuText(new MenuText("ROUNDS:"));
              //optionsMenu.addMenuText(new MenuText("ZOOM:"));
              //optionsMenu.addMenuText(new MenuText("FULLSCREEN:", G.toggleFullscreen));
              optionsMenu.deactivate();
              add(optionsMenu);

              credits = new Group();
              Text credit;
              credit = new Text("CODE", MENU_X, 204);
              credit.color = new Color(0x77, 0x80, 0x85);
              credits.add(credit);
              credits.add(new Text("JOSH SCHONSTAL", MENU_X, 220));
              credit = new Text("ART", MENU_X, 236);
              credit.color = new Color(0x77, 0x80, 0x85);
              credits.add(credit);
              credits.add(new Text("IAN BROCK", MENU_X, 252));
              credit = new Text("SOUND", MENU_X, 268);
              credit.color = new Color(0x77, 0x80, 0x85);
              credits.add(credit);
              credits.add(new Text("GUERIN MCMURRY", MENU_X, 284));
              credits.visible = false;
              add(credits);

              controls = new Sprite(190, 182);
              controls.loadGraphic("controls", 251, 125);
              controls.visible = false;
              controls.screenPositioning = ScreenPositioning.Absolute;
              add(controls);

              DoInSeconds(2, () => {
            pressStart = new Text("PUSH START BUTTON");
            pressStart.y = 210;
            pressStart.x = 259;
            pressStartShadow = new Text(pressStart.text);
            pressStartShadow.y = pressStart.y + 1;
            pressStartShadow.x = pressStart.x;
            pressStartShadow.color = Color.Black;
            add(pressStartShadow);
            add(pressStart);
            ready = true;
              });

              GameTracker.MatchesWon[Team.Left] = 0;
              GameTracker.MatchesWon[Team.Right] = 0;
              GameTracker.RoundsWon[Team.Left] = 0;
              GameTracker.RoundsWon[Team.Right] = 0;
              GameTracker.LeftPlayers = new List<PlayerIndex>();
              GameTracker.RightPlayers = new List<PlayerIndex>();
        }