Inheritance: GameObject
Exemplo n.º 1
0
        public MenuText(string text, Action onPress=null)
            : base()
        {
            bodyText = text;
              this.onPress = onPress;

              hilightText = new Text(text);
              hilightText.visible = false;
              hilightText.color = Color.White;

              itemText = new Text(text);
              itemText.color = itemColor;

              add(itemText);
              add(hilightText);
        }
Exemplo n.º 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>();
        }