예제 #1
0
 static void Main2(string[] args)
 {
     using (TerrainMap game = new TerrainMap())
     {
         game.Run();
     }
 }
예제 #2
0
/*
 * /// <summary>
 * /// UnloadContent will be called once per game and is the place to unload
 * /// all content.
 * /// </summary>
 * protected override void UnloadContent() {
 *    // TODO: Unload any non ContentManager content here
 *    }
 */

        /// <summary>
        /// Process user keyboard input.
        /// Pressing 'T' or 't' will toggle the display between the height and color textures
        /// </summary>

        protected override void Update(GameTime gameTime)
        {
            KeyboardState keyboardState = Keyboard.GetState();

            if (keyboardState.IsKeyDown(Keys.Escape))
            {
                Exit();
            }
            else if (Keyboard.GetState().IsKeyDown(Keys.T) && !oldState.IsKeyDown(Keys.T))
            {
                showHeight = !showHeight;
            }

            if (keyboardState.IsKeyDown(Keys.Q) && !oldKeyboardState.IsKeyDown(Keys.Q))
            {
                using (var game = new TerrainMap())
                    game.Run();
            }
            oldKeyboardState = keyboardState;

            oldState = keyboardState; // Update saved state.
            base.Update(gameTime);
        }
예제 #3
0
 static void Main()
 {
     using (var game = new TerrainMap())
         game.Run();
 }
 static void Main2(string[] args)
 {
     using (TerrainMap game = new TerrainMap())
     {
         game.Run();
     }
 }