X hits on this document

221 views

0 shares

0 downloads

0 comments

83 / 102

           {

               AudioManager.PlaySound("ropeStretch");

               AnimationRunning = true;

               if (isAI == true)

               {

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

                   stallUpdateCycles = 20;

                   startStall = false;

               }

           }

           // Progress Aiming "animation"

           if (isAI == false)

           {

               UpdateAimAccordingToShotStrength();

           }

           else

           {

               animations["Aim"].Update();

               startStall = AimReachedShotStrength();

               currentState = (startStall) ?

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)

           {

               AudioManager.StopSound("ropeStretch");

               AudioManager.PlaySound("catapultFire");

               StartFiringFromLastAimPosition();

           }

           animations["Fire"].Update();

           // If in the "split" point of the animation start

           // projectile fire sequence

if (animations["Fire"].FrameIndex == splitFrames["Fire"])

Page | 83

Document info
Document views221
Page views221
Page last viewedSat Dec 03 18:18:38 UTC 2016
Pages102
Paragraphs3115
Words17333

Comments