protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                this.Exit();
            }
            OldMouseState     = CurrentMouseState;
            CurrentMouseState = Mouse.GetState();
            SoundButton.Update();

            base.Update(gameTime);
        }
 protected override void Draw(GameTime gameTime)
 {
     GraphicsDevice.Clear(Color.Black);
     spriteBatch.Begin();
     spriteBatch.Draw(this.Content.Load <Texture2D>("Background"), GraphicsDevice.Viewport.Bounds, Color.White);
     if (Game1.CurrentGameState == GameState.Play)
     {
         spriteBatch.Draw(this.Content.Load <Texture2D>("Game"), GraphicsDevice.Viewport.Bounds, Color.White);
     }
     spriteBatch.End();
     base.Draw(gameTime);
     SoundButton.Draw(this.spriteBatch);
 }
Exemple #3
0
 public static void LoadContent(ContentManager content)
 {
     SoundManager.IsEnabled        = true;
     SoundManager.MainMenu         = content.Load <Song>("Sound/MainMenu");
     SoundManager.Play             = content.Load <Song>("Sound/Play");
     SoundManager.GameOver         = content.Load <Song>("Sound/GameOver");
     SoundManager.Food             = content.Load <SoundEffect>("Sound/Food").CreateInstance();
     SoundManager.Scored           = content.Load <SoundEffect>("Sound/Scored").CreateInstance();
     SoundManager.SpeedUp          = content.Load <SoundEffect>("Sound/SpeedUp").CreateInstance();
     SoundManager.NextMap          = content.Load <SoundEffect>("Sound/NextMap").CreateInstance();
     SoundManager.Button           = content.Load <SoundEffect>("Sound/Button").CreateInstance();
     SoundManager.SpeedUp.IsLooped = true;
     SoundButton.LoadContent(content);
 }