foreach (var gesture in input.Gestures)
if (gesture.GestureType == GestureType.Tap)
//ScreenManager.AddScreen(new GameplayScreen(), null);
The above method will cause the screen to be replaced with the actual gameplay screen. However, since we have yet to implement the gameplay screen class, and will not do so until the next exercise, that portion of the code is currently commented out.
So far, we have created three screens and now it is time to make them visible. To do that, we are required to alter the game class CatapultGame. Open the CatapultGame.cs file from the solution explorer and delete all the content from the CatapultGame class.
Add the following using statement in the top of the class file:
Add a pair of variable declarations to the beginning of the class:
public class CatapultGame : Game
Now add a constructor to the class which will add the screens created in previous steps to the screen manager:
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
// Frame rate is 30 fps by default for Windows Phone.
TargetElapsedTime = TimeSpan.FromTicks(333333);
//Create a new instance of the Screen Manager
screenManager = new ScreenManager(this);
//Switch to full screen for best game experience
Page | 28