X hits on this document

231 views

0 shares

0 downloads

0 comments

57 / 102

   if (gameTime == null)

       throw new ArgumentNullException("gameTime");

   switch (currentState)

   {

       case CatapultState.Idle:

           // Nothing to do

           break;

       case CatapultState.Aiming:

           if (lastUpdateState != CatapultState.Aiming)

           {

               // TODO: Play sound

               AnimationRunning = true;

               if (isAI == true)

               {

                   // TODO: Play animation

                   stallUpdateCycles = 20;

                   startStall = false;

               }

           }

           // Progress Aiming "animation"

           if (isAI == false)

           {

               // TODO: Play animation

           }

           else

           {

               // TODO: Play animation

               // TODO: take “startStall” into account

               currentState = (true) ?

CatapultState.Stalling : CatapultState.Aiming;

           }

           break;

       case CatapultState.Stalling:

           if (stallUpdateCycles-- <= 0)

           {

               // We've finished stalling, fire the projectile

               Fire(ShotVelocity);

               postUpdateStateChange = CatapultState.Firing;

           }

           break;

       case CatapultState.Firing:

           // Progress Fire animation

           if (lastUpdateState != CatapultState.Firing)

           {

               // TODO: Play Sounds and animate

Page | 57

Document info
Document views231
Page views231
Page last viewedSun Dec 04 19:12:35 UTC 2016
Pages102
Paragraphs3115
Words17333

Comments