X hits on this document

230 views

0 shares

0 downloads

0 comments

85 / 102

                   // a direct hit will trigger the explosion sound

                   AudioManager.PlaySound("boulderHit");

               }

               // Hit animation finished playing

               if (animations["fireMiss"].IsActive == false)

               {

                   postUpdateStateChange = CatapultState.Reset;

               }

               animations["fireMiss"].Update();

           }

           else

           {

               // Catapult hit - start longer vibration on any catapult hit

               // Remember that the call to "CheckHit" updates the catapult's

               // state to "Hit"

               VibrateController.Default.Start(

                   TimeSpan.FromMilliseconds(500));

           }

           break;

       case CatapultState.Hit:

           // Progress hit animation

           if ((animations["Destroyed"].IsActive == false) &&

               (animations["hitSmoke"].IsActive == false))

           {

               if (enemy.Score >= winScore)

               {

                   GameOver = true;

                   break;

               }

               postUpdateStateChange = CatapultState.Reset;

           }

           animations["Destroyed"].Update();

           animations["hitSmoke"].Update();

           break;

       case CatapultState.Reset:

           AnimationRunning = false;

           break;

       default:

           break;

   }

Page | 85

Document info
Document views230
Page views230
Page last viewedSun Dec 04 19:01:33 UTC 2016
Pages102
Paragraphs3115
Words17333

Comments