X hits on this document

312 views

0 shares

0 downloads

0 comments

48 / 102

111.

Override the base class’s Initialize method:

C#

public override void Initialize()

{

   // TODO: Load textures

   Catapult.Initialize();

   base.Initialize();

}

Notice that we have left a placeholder where we will later load additional textures used by the Human class.

112.

Open the AI.cs file and locate the TODO marker we have left in the AI class’s constructor. Change it so that the constructor would look as follows:

C#

public AI(Game game, SpriteBatch screenSpriteBatch)

   : base(game, screenSpriteBatch)

{

   Catapult = new Catapult(game, screenSpriteBatch,

                   "Textures/Catapults/Red/redIdle/redIdle",

new Vector2(600, 332), SpriteEffects.FlipHorizontally,

                   true);

}

113.

Override the base class’s Initialize method:

C#

public override void Initialize()

{

   // TODO: Additional initialization

   Catapult.Initialize();

   base.Initialize();

}

Notice that we have left a placeholder where we will later perform further initialization.

114.

Add the DrawComputer and DrawPlayer helper method:

C#

void DrawPlayer(GameTime gameTime)

{

   if (!gameOver)

       player.Draw(gameTime);

}

Page | 48

Document info
Document views312
Page views312
Page last viewedTue Jan 17 02:55:53 UTC 2017
Pages102
Paragraphs3115
Words17333

Comments