X hits on this document

288 views

0 shares

0 downloads

0 comments

68 / 102

   {

       gameOver = true;

       if (player.Score > computer.Score)

       {

           // TODO: Play sound

       }

       else

       {

           // TODO: Play sound

       }

base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);

       return;

   }

   // If Reset flag raised and both catapults are not animating -

   // active catapult finished the cycle, new turn!

   if ((player.Catapult.CurrentState == CatapultState.Reset ||

       computer.Catapult.CurrentState == CatapultState.Reset) &&

       !(player.Catapult.AnimationRunning ||

       computer.Catapult.AnimationRunning))

   {

       changeTurn = true;

       if (player.IsActive == true) //Last turn was a human turn?

       {

           player.IsActive = false;

           computer.IsActive = true;

           isHumanTurn = false;

           player.Catapult.CurrentState = CatapultState.Idle;

computer.Catapult.CurrentState = CatapultState.Aiming;

       }

       else //It was an AI turn

       {

           player.IsActive = true;

           computer.IsActive = false;

           isHumanTurn = true;

           computer.Catapult.CurrentState = CatapultState.Idle;

           player.Catapult.CurrentState = CatapultState.Idle;

       }

   }

   if (changeTurn)

Page | 68

Document info
Document views288
Page views288
Page last viewedSat Dec 10 03:39:32 UTC 2016
Pages102
Paragraphs3115
Words17333

Comments