Exemple #1
0
        private void UpdateExitingOutState(GameTime time, HackGameBoard board, HackNodeGameBoardMedia drawing)
        {
            if (exitOutData.Starting)
            {
                exitOutData.Starting = false;
                exitOutData.StartSpawnSound = true;
                Vector2 newCam = board.GetCameraOffsetToCenterOnElement(getCurrentBoardLocation(), board.GetScreen().GetCamera().GetCameraZoom(), board.GetGame().GraphicsDevice);
                board.GetScreen().GetCamera().SetCameraOffsetAndZoom(newCam, board.GetScreen().GetCamera().GetCameraZoom(), board);
                board.GetScreen().LockCamera();
                board.SetKilledAnim(board.GetPlayer().getCurrentBoardLocation());
                board.ClearBackgroundTextPending();
                board.FadeOutBackgroundText(3.0f);
                board.FreezeCollapseTimer();
                board.ticker.ClearOverride();
            }
            exitOutData.totalTimer -= (float)time.ElapsedGameTime.TotalSeconds;
            if (exitOutData.totalTimer <= 0)
            {
                SetCurrentState(HackGameAgent_State.HackGameAgent_State_Exited);

            }
            else
            {
                if (exitOutData.lerping)
                {
                    exitOutData.flyOutLerp.Update(time);
                }
                else
                {
                    exitOutData.flyOutFlash.Update(time);
                    exitOutData.flashTimer.Update(time);
                    if (!exitOutData.flashTimer.IsAlive())
                    {
                        exitOutData.StartLerping();
                        board.KillAllAI();
                        board.StartExitEffect();
                        exitOutData.DrawImpact = true;
                        exitOutData.StartSpawnSound = true;
                        board.EndCollapse();
                    }

                }
            }
        }