X hits on this document

291 views

0 shares

0 downloads

0 comments

43 / 102

Finally, we draw a text prompt at the bottom of the screen. The exact text depends on whether the human player is currently the active player or not, and whether the player is currently in the process of taking a shot.

95.

Compile and deploy the project. Navigating to the game screen, you should now see the following image:

Figure 26

The gameplay screen, with the new HUD

While the game screen now contains much more information, it is still missing a key aspect, which is also the namesake of the game – the catapults. We will now focus on adding the Catapult class, which is responsible for drawing the game’s catapults and which will eventually be responsible for much of the game’s logic.

96.

Create a new project folder and name it Catapult.

97.

Add a new class under the Catapult project folder and name it Catapult.

98.

Add the following using statements to the top of the newly created file:

C#

using Microsoft.Xna.Framework;

using Microsoft.Xna.Framework.Graphics;

using Microsoft.Xna.Framework.Input.Touch;

using Microsoft.Devices;

using System.Xml.Linq;

99.

One of the above using statements requires us to add an assembly reference to the project. This will allow the project to utilize the services implemented by the

Page | 43

Document info
Document views291
Page views291
Page last viewedSat Dec 10 19:21:28 UTC 2016
Pages102
Paragraphs3115
Words17333

Comments