This tutorial covers using XNA to read keyboard and mouse input.
This lab will be similar to the previous lab. You will once again control a ship, however, you will use the arrow keys and the mouse buttons to do so. While pressed, each of the following controls should have the following actions:
Up arrow: forward
This has already been implemented for you, as a guide.
Down arrow: backward
Left arrow: turn counter clockwise
Right arrow: turn clockwise
Right mouse button: turn on "shields"
You should create a translucent image that will represent your shield and overlay it on your ship when the shield is on.
If you wish, you can embellish the controls above. Also, while a ship image is provided, feel free to substitute your own, as in the previous lab.
The framework can be downloaded here.
The main tools you will use in this lab will be XNA's provided
KeyboardState and MouseState.
There is an update method that you must write in each XNA game that you create.
This is where you should check the state of the input devices and
perform whatever actions are necessary.
We suggest that you only modify the KeyMouse.cs and
Ship.cs files.