X hits on this document

276 views

0 shares

0 downloads

0 comments

84 / 102

           {

               postUpdateStateChange =

currentState | CatapultState.ProjectileFlying;

               projectile.ProjectilePosition =

                   projectile.ProjectileStartPosition;

           }

           break;

case CatapultState.Firing | CatapultState.ProjectileFlying:

           // Progress Fire animation                    

           animations["Fire"].Update();

           // Update projectile velocity & position in flight

           projectile.UpdateProjectileFlightData(gameTime, wind,

               gravity, out isGroundHit);

           if (isGroundHit)

           {

               // Start hit sequence

postUpdateStateChange = CatapultState.ProjectileHit;

               animations["fireMiss"].PlayFromFrameIndex(0);

           }

           break;

       case CatapultState.ProjectileFlying:

           // Update projectile velocity & position in flight

           projectile.UpdateProjectileFlightData(gameTime, wind,

               gravity, out isGroundHit);

           if (isGroundHit)

           {

               // Start hit sequence

postUpdateStateChange = CatapultState.ProjectileHit;

               animations["fireMiss"].PlayFromFrameIndex(0);

           }

           break;

       case CatapultState.ProjectileHit:

           // Check hit on ground impact

           if (!CheckHit())

           {

if (lastUpdateState != CatapultState.ProjectileHit)

               {

                   VibrateController.Default.Start(

                       TimeSpan.FromMilliseconds(100));

                   // Play hit sound only on a missed hit,

Page | 84

Document info
Document views276
Page views276
Page last viewedFri Dec 09 06:45:40 UTC 2016
Pages102
Paragraphs3115
Words17333

Comments