Exemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        protected void UpdateKeyboardPlayGameTraining()
        {
            if (!m_CurrentKeyboardState.IsKeyDown(Keys.LeftControl))
            {
                if (m_CurrentPlayGameState == PlayGameState.Running)
                {
                    if (!m_PreviousKeyboardState.IsKeyDown(Keys.Escape) && m_CurrentKeyboardState.IsKeyDown(Keys.Escape))
                    {
                        m_CurrentPlayGameState = PlayGameState.Paused;
                    }
                    if (KeyDownTwoInput(Keys.F1))
                    {
                        m_World.LoadNewMap("Maps//Map1.ini");
                    }
                    else if (KeyDownTwoInput(Keys.F2))
                    {
                        m_World.LoadNewMap("Maps//Map2.ini");
                    }
                    else if (KeyDownTwoInput(Keys.F3))
                    {
                        m_World.LoadNewMap("Maps//Map3.ini");
                    }
                    else if (KeyDownTwoInput(Keys.F5))
                    {
                        m_World.LoadNewMap("Maps//Map5.ini");
                    }
                    else if (KeyDownTwoInput(Keys.F6))
                    {
                        m_World.LoadNewMap("Maps//Map6.ini");
                    }
                    else if (KeyDownTwoInput(Keys.F7))
                    {
                        m_World.LoadNewMap("Maps//Map7.ini");
                    }
                    else if (KeyDownTwoInput(Keys.F12))
                    {
                        LevelGenerator LG = new LevelGenerator();
                        LG.genLevel();
                        m_World.LoadNewMap("Maps//MapRand.ini");
                    }

                }
                else if (m_CurrentPlayGameState == PlayGameState.Paused)
                {
                    if (!m_PreviousKeyboardState.IsKeyDown(Keys.Enter) && m_CurrentKeyboardState.IsKeyDown(Keys.Enter))
                    {
                        m_CurrentPlayGameState = PlayGameState.Running;
                    }
                    if (!m_PreviousKeyboardState.IsKeyDown(Keys.Escape) && m_CurrentKeyboardState.IsKeyDown(Keys.Escape))
                    {
                        m_CurrentGameState = GameState.ModeSelect;
                        m_CurrentPlayGameState = PlayGameState.None;
                    }
                }
            }
            else
            {
                if (KeyDownTwoInput(Keys.F1))
                {
                    m_World.ToggleSenseBombs();
                }
                else if(KeyDownTwoInput(Keys.F2))
                {
                    m_World.ToggleSenseAgents();
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 
        /// </summary>
        protected void InitializePlayGamePerson()
        {
            //create the new map
            LevelGenerator LG = new LevelGenerator();
            LG.genLevel();
            m_World = new Map(Content, "Maps\\MapRand.ini");

            m_CurrentPlayGameState = PlayGameState.Running;

            //init game over flag
            m_GameOverFlag = false;
            m_WinFlag = false;
        }