O'Reilly logo

3D Game Development with Microsoft Silverlight 3 Beginner's Guide by Gastón C. Hillar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action—rotating cameras using input devices

As you were able to use a gamepad in Silverlight, your project manager wants to control the camera that shows the ship using this device.

Now, we are going to add the keyboard and mouse management classes to our application that shows the spaceship, using Balder and Silverlight:

  1. Open the project, 3DInvadersSilverlight.
  2. Copy and paste the previously created keyboard and mouse management classes to the main project, KeyboardManager and MouseManager.
  3. Open MainPage.xaml.cs.
  4. Add the following private variables in the public partial class MainPage : UserControl, to hold instances of the KeyboardManager and MouseManager classes:
    private KeyboardManager _keyboardManager; private MouseManager _mouseManager; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required