Time for action – handling input
Add the following declarations to the declarations region of the
Player
module:Private baseAngle As Vector2 = Vector2.Zero Private turretAngle As Vector2 = Vector2.Zero Private playerSpeed As Single = 90
Add the methods to handle keyboard and gamepad input to the
Player
module:#Region "Input Handling" Private Function handleKeyboardMovement( keyState As KeyboardState) As Vector2 Dim keyMovement As Vector2 = Vector2.Zero If keyState.IsKeyDown(Keys.W) Then keyMovement.Y -= 1 End If If keyState.IsKeyDown(Keys.A) Then keyMovement.X -= 1 End If If keyState.IsKeyDown(Keys.S) Then keyMovement.Y += 1 End If If keyState.IsKeyDown(Keys.D) Then keyMovement.X += 1 End If Return keyMovement End Function Private Function handleGamePadMovement(padState As GamePadState) As Vector2 Return New Vector2( padState.ThumbSticks.Left.X, -padState.ThumbSticks.Left.Y) End Function Private...