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—writing the game loop

It is time to write the code for the main game loop. We have to show the characters, make them move and control the ship movement according to the keys pressed by the player.

  1. Stay in the SilverlightInvaders2DVector project.
  2. Open the XAML code for MainPage.xaml and replace the existing code with the following (you will see a button with the title Start the game):
    <UserControl x:Class="SilverlightInvaders2DVector.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/ presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="1366" Height="768" xmlns:SilverlightInvaders2D= "clr-namespace:SilverlightInvaders2DVector"> <Canvas x:Name="LayoutRoot" Background="White"> <!-- A button to start ...

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