Example #1
0
        /// <summary>
        ///   Creates a default orthographic camera and lets it respond to the provided
        ///   controls once with a 1 second update.
        /// </summary>
        /// <param name="keyboardState">
        ///   Keyboard state that will be reported to the camera
        /// </param>
        /// <param name="gamePadState">
        ///   GamePad state that will be reported to the camera
        /// </param>
        /// <returns>The camera after it has responded to the provided controls</returns>
        private Camera handleControlsOnDefaultCamera(
            KeyboardState keyboardState, GamePadState gamePadState
            )
        {
            Camera camera = Camera.DefaultOrthographic;

            camera.HandleControls(OneSecondGameTime, keyboardState, gamePadState);
            return(camera);
        }
Example #2
0
        public void TestHandleControls()
        {
            Camera camera = Camera.DefaultOrthographic;

            camera.HandleControls(OneSecondGameTime);

            // We can't make assumptions about which keys the user held down while
            // the unit test ran, so we just verify it's not blowing up.
        }