X hits on this document

280 views

0 shares

0 downloads

0 comments

37 / 102

   base.Initialize();

}

81.

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

82.

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

C#

using Microsoft.Xna.Framework;

using Microsoft.Xna.Framework.Graphics;

using Microsoft.Xna.Framework.Input.Touch;

83.

Change the Human class to inherit from the Player class:

C#

class Human : Player

{

}

84.

Add the following constructors inside the Human class:

C#

public Human(Game game)

   : base(game)

{

}

public Human(Game game, SpriteBatch screenSpriteBatch)

   : base(game, screenSpriteBatch)

{

   // TODO: Initialize catapult

}

We will later initialize the player’s catapult as part of the second constructor.

85.

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

86.

Add the following using statements to the top of the new class file:

C#

using Microsoft.Xna.Framework;

using Microsoft.Xna.Framework.Graphics;

87.

Change the AI class to inherit from the Player class:

C#

class AI : Player

{

}

88.

Add the following constructors inside the AI class:

C#

public AI(Game game)

Page | 37

Document info
Document views280
Page views280
Page last viewedFri Dec 09 09:57:57 UTC 2016
Pages102
Paragraphs3115
Words17333

Comments