Your project manager does not want the game to start immediately. He wants you to add a button in order to allow the player to start the game by clicking on it. As you are using Balder, adding a button is not as simple as expected.
We are going to add a button to the main page, and we are going to change Balder's default game initialization:
1. Stay in the
3DInvadersSilverlight
project.2. Expand
App.xaml
in the Solution Explorer and openApp.xaml.cs
— the C# code forApp.xaml
.3. Comment the following line of code (we are not going to use Balder's services in this class):
//using Balder.Silverlight.Services;
4. Comment the following line of code in the event handler for the
Application_Startup
event, after the linethis.RootVisual = new MainPage();
://TargetDevice.Initialize<InvadersGame>();
5. Open the XAML code for
MainPage.xaml
and add the following lines of code after the line<Grid x:Name="LayoutRoot" Background="White" >...