-
Book Overview & Buying
-
Table Of Contents
3D Game Development with Microsoft Silverlight 3: Beginner's Guide
By :
Your project manager wants you to go back to the Invaders 2D game that you had submitted to the game contest website. Many players reported bugs and said that they could not use a gamepad to play the game. Remember that it was the most desired game.
The code that checks the keyboard is taking into account just one pressed key. It is time to create a keyboard manager class. It must be able to track multiple keys pressed by the user between each rendered frame:
1. Open the SilverlightInvaders2DVector project.
2. Create a new class—KeyboardManager.
3. Add the following line of code at the beginning of the class definition (as we are going to use the System.Collections.Generic.List class):
using System.Collections.Generic;
4. Add the following private and static variables:
// The list of pressed keys private static List<Key> _keys = new List<Key>(); // The list of keys to remove private static List<Key> _keysToRemove = new List<...
Change the font size
Change margin width
Change background colour