Exemplo n.º 1
0
        private void UpdatePause(KeyboardState kState, MouseState mState)
        {
            MediaPlayer.Volume = 0.10f;

            boutonResume.Update(kState, mState);

            if (kState.IsKeyDown(Keys.Back))
            {
                gameState = GameState.Loading;
            }
        }
Exemplo n.º 2
0
        private void UpdateStartMenu(KeyboardState kState, MouseState mState)
        {
            if (MediaPlayer.State == MediaState.Stopped)
            {
                MediaPlayer.IsRepeating = true;
                MediaPlayer.Play(mainMenuMusic);
            }

            if (kState.IsKeyDown(Keys.Enter))
            {
                gameState = GameState.Loading;
            }

            boutonExit.Update(kState, mState);
            boutonStart.Update(kState, mState);
        }
Exemplo n.º 3
0
        private void UpdateStartMenu(KeyboardState kState, MouseState mState, GameTime gameTime)
        {
            if (MediaPlayer.State == MediaState.Stopped)
            {
                MediaPlayer.IsRepeating = true;
                MediaPlayer.Play(mainMenuMusic);
            }

            if (kState.IsKeyDown(Keys.Enter))
            {
                MediaPlayer.Stop();
                pressed   = true;
                gameState = GameState.Loading;
            }

            boutonExit.Update(kState, mState);
            boutonStart.Update(kState, mState);

            //Animated ball in background
            if (balleAnim.getEnable() == false)
            {
                balleAnim.setEnable(true);
            }
            boutonStart.checkBallCollision(balleAnim);
            boutonExit.checkBallCollision(balleAnim);
            balleAnim.checkBallCollision(balleAnim2.getLocation());
            balleAnim2.checkBallCollision(balleAnim.getLocation());
            soundEngineInstance = balleMur.CreateInstance();
            balleAnim.Update(kState, gameTime, soundEngineInstance);
            if (balleAnim2.getEnable() == false)
            {
                balleAnim2.setEnable(true);
            }
            boutonExit.checkBallCollision(balleAnim2);
            boutonStart.checkBallCollision(balleAnim2);
            balleAnim2.Update(kState, gameTime, soundEngineInstance);
        }