コード例 #1
0
        /// <summary>
        /// Handles all menu updates when the GameState isn't running
        /// and pause requests when it is
        /// </summary>
        /// <param name="time">Snapshot fo the curretn gameTime</param>
        public static void Update(GameTime time)
        {
            HandlePauseRequest();

            float nexTime = (float)time.ElapsedGameTime.Milliseconds / 1000.0f;

            titleTimer += nexTime;

            if (doReset)
            {
                colorIndex2++;
                if (colorIndex2 == titleColors2.Length)
                {
                    colorIndex2 = 0;
                }
                ShaderWrapper.ClearBG(titleColors2[colorIndex2]);
                doReset = false;
            }
            if (LevelManager.State != GameState.Running)
            {
                pauseMenu.Update(time);
                startMenu.Update(time);
                restartMenu.Update(time);
                instructionMenu.Update(time);
                bonusMenu.Update(time);
            }
        }
コード例 #2
0
 public static void ShowStartMenu()
 {
     startMenu.Show = true;
     ShaderWrapper.DestroySaveTex();
     if (LevelManager.State != GameState.OtherMenu)
     {
         LevelManager.ResetGame();
         LevelManager.State = GameState.MainMenu;
         ShaderWrapper.ClearBG(Color.White);
     }
 }
コード例 #3
0
        protected override void LoadContent()
        {
            LevelManager.Assemble();
            CollisionGrid.Assemble();

            spriteBatch   = new SpriteBatch(GraphicsDevice);
            rand          = new Random();
            player        = new Player(this);
            eManager      = new EnemyManager(this);
            uILayer       = new UILayer(this, spriteBatch);
            shaderWrapper = new ShaderWrapper(this);
            counter       = new ForceCounter(this);

            ShaderWrapper.ClearBG(Color.SteelBlue);
        }