X hits on this document

218 views

0 shares

0 downloads

0 comments

55 / 102

// State of the catapult during its last update

CatapultState lastUpdateState = CatapultState.Idle;

// Used to stall animations

int stallUpdateCycles;

// MARK: Fields end

You will notice some comments that begin with “UNCOMMENT”. We will later introduce the fields that these comments hide, but they are not required at the current stage (and one of them relies on a class which we have yet to implement). You might remember that we have already encountered these fields when implementing one of the Catapult class’s constructors.

127.

Add the following properties and backing fields to the Catapult class:

C#

float wind;

public float Wind

{

   set

   {

       wind = value;

   }

}

Player enemy;

internal Player Enemy

{

   set

   {

       enemy = value;

   }

}

Player self;

internal Player Self

{

   set

   {

       self = value;

   }

}

// Describes how powerful the current shot being fired is. The more powerful

// the shot, the further it goes. 0 is the weakest, 1 is the strongest.

public float ShotStrength { get; set; }

public float ShotVelocity { get; set; }

Page | 55

Document info
Document views218
Page views218
Page last viewedSat Dec 03 13:47:28 UTC 2016
Pages102
Paragraphs3115
Words17333

Comments