Ejemplo n.º 1
0
 public void Update(Game1 game, GamePadState gamePad, GamePadState oldPad)
 {
     mousePointer.Update(gamePad);
     backButton.Update((float)mousePointer.x, (float)mousePointer.y);
     if (backButton.overLapping && gamePad.Buttons.A == ButtonState.Pressed)
     {
         game.gameState = GameState.START;
     }
 }
Ejemplo n.º 2
0
        public void Update(Game1 game, GraphicsDeviceManager graphics, GamePadState gamePad, GamePadState oldPad)
        {
            // if (sourceRectangle.Width < titleImage.Width) sourceRectangle.Width++;
            mousePointer.Update(gamePad);
            settingsButton.Update((float)mousePointer.x, (float)mousePointer.y);
            startGameButton.Update((float)mousePointer.x, (float)mousePointer.y);
            if (settingsButton.overLapping && gamePad.Buttons.A == ButtonState.Pressed)
            {
                game.gameState = GameState.SETTINGS;
            }
            if (startGameButton.overLapping && gamePad.Buttons.A == ButtonState.Pressed)
            {
                game.gameState = GameState.LEVEL_ONE;
                graphics.PreferredBackBufferWidth  = 800;
                graphics.PreferredBackBufferHeight = 600;
                graphics.ApplyChanges();
            }

            if (timer % 200 == 0)
            {
                blackingOut        = true;
                blackoutStartTimer = 1;
            }
            if (blackoutStartTimer == 7)
            {
                blackingOut = false;
            }
            else if (blackoutStartTimer == 15)
            {
                blackingOut = true;
            }
            else if (blackoutStartTimer == 25)
            {
                blackingOut = false;
            }
            else if (blackoutStartTimer == 40)
            {
                blackingOut = true;
            }
            else if (blackoutStartTimer == 60)
            {
                blackingOut        = false;
                blackoutStartTimer = 0;
            }


            timer++;
            if (blackoutStartTimer != 0)
            {
                blackoutStartTimer++;
            }
        }
Ejemplo n.º 3
0
        public void Update(Game1 game, GamePadState gamePad, GraphicsDeviceManager graphics)
        {
            graphics.PreferredBackBufferWidth  = StartingScreen.TITLESCREEN_SIZE;
            graphics.PreferredBackBufferHeight = StartingScreen.TITLESCREEN_SIZE;
            graphics.ApplyChanges();
            mousePointer.Update(gamePad);
            playAgainButton.Update((float)mousePointer.x, (float)mousePointer.y);
            if (playAgainButton.overLapping && gamePad.Buttons.A == ButtonState.Pressed)
            {
                game.gameState = GameState.START;
                game.resetLevels();
            }
            if (timer % 200 == 0)
            {
                blackingOut        = true;
                blackoutStartTimer = 1;
            }
            if (blackoutStartTimer == 7)
            {
                blackingOut = false;
            }
            else if (blackoutStartTimer == 15)
            {
                blackingOut = true;
            }
            else if (blackoutStartTimer == 25)
            {
                blackingOut = false;
            }
            else if (blackoutStartTimer == 40)
            {
                blackingOut = true;
            }
            else if (blackoutStartTimer == 60)
            {
                blackingOut        = false;
                blackoutStartTimer = 0;
            }


            timer++;
            if (blackoutStartTimer != 0)
            {
                blackoutStartTimer++;
            }
        }