示例#1
0
        // Los pinta abajo a la derecha en vertical
        private static void initializeGameButtons(Button[] buttons)
        {
            int x = WINDOW_WIDTH - GameButtonList.BUTTON_WIDTH - 20;
            int y = WINDOW_HEIGHT - GameButtonList.getGameNumber() / 2 * GameButtonList.BUTTON_HEIGHT -
                    (GameButtonList.getGameNumber() % 2) * GameButtonList.BUTTON_HEIGHT / 2 - 20;

            foreach (GameButtonList.gameButton b in Enum.GetValues(typeof(GameButtonList.gameButton)))
            {
                buttons[(int)b] = new Button(b.ToString(), x, y, GameButtonList.BUTTON_WIDTH, GameButtonList.BUTTON_HEIGHT);
                y += GameButtonList.BUTTON_HEIGHT;
            }
        }
示例#2
0
        public GameCore(GraphicsDevice graphicsDevice)
        {
            this.gameScreen         = new GameScreen(graphicsDevice);
            this.nextScreenState    = screenState.INIT;
            this.nextPlayState      = playState.INIT;
            this.playerSkeleton     = null;
            this.gamePostures       = null;
            this.gameScores         = new Dictionary <PostureInformation, double>();
            this.menuButtons        = new Button[GameButtonList.getMenuNumber()];
            this.scoreButtons       = new Button[GameButtonList.getScoreNumber()];
            this.gameButtons        = new Button[GameButtonList.getGameNumber()];
            this.pauseButtons       = new Button[GameButtonList.getPauseNumber()];
            this.drawPostureTimeOut = Stopwatch.StartNew();
            this.holdPostureTimeOut = Stopwatch.StartNew();
            this.scoreTimeOut       = Stopwatch.StartNew();

            // Crea los botones del juego
            // por ahora les asignamos su posicion en pantalla con esos metodos...
            initializeMenuButtons(this.menuButtons);
            initializeScoreButtons(this.scoreButtons);
            initializeGameButtons(this.gameButtons);
            initializePauseButtons(this.pauseButtons);
        }