I wrote Shooter Game from XNA example. This game supports touch, keyboard and gamepad Input.
If I run this game on Windows 10 Desktop that use keyboard, touch screen and also Xbox One controller I can use all Input methods.
What are your suggestions:
a) leave the ability to control various ways?
b) in tab settings in the game menu to add the ability to choose just one method of control: touch / keyboard / gamepad?
How to program the game to active was only one form of control mode selected by the user in the settings of the game?
The following code in my game is executed in the method :override void Update (GameTime GameTime) in class Game1: Game
GestureSample gesture = TouchPanel.ReadGesture();
if (gesture.GestureType == GestureType.FreeDrag)
player.Position += gesture.Delta;
Keyboard and gamepad
if (currentKeyboardState.IsKeyDown(Keys.Left)|| currentGamePadState.DPad.Left==ButtonState.Pressed)
player.Position.X -= playerMoveSpeed;
if (currentKeyboardState.IsKeyDown(Keys.Right) || currentGamePadState.DPad.Right == ButtonState.Pressed)
player.Position.X += playerMoveSpeed;
if (currentKeyboardState.IsKeyDown(Keys.Up)|| currentGamePadState.DPad.Up == ButtonState.Pressed)
player.Position.Y -= playerMoveSpeed;
if (currentKeyboardState.IsKeyDown(Keys.Down) || currentGamePadState.DPad.Down==ButtonState.Pressed)
player.Position.Y += playerMoveSpeed;