public void BoundCameraOffsetAndZoom(HackGameBoard board) { if (cameraOffset.X > 0.0f) { cameraOffset.X = 0.0f; } if (cameraOffset.Y > 0.0f) { cameraOffset.Y = 0.0f; } Vector2 boardmax = board.GetMaxCameraOffsetBottomRight(cameraZoom, board.GetGame().GraphicsDevice); if (cameraOffset.X < boardmax.X) { cameraOffset.X = boardmax.X; } if (cameraOffset.Y < boardmax.Y) { cameraOffset.Y = boardmax.Y; } float minZoom = board.GetMinZoom(board.GetGame().GraphicsDevice); if (cameraZoom < minZoom) { cameraZoom = minZoom; } if (cameraZoom > 1.5f) { cameraZoom = 1.5f; } }
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(); } } } }
public void UpdateBeingKilledState(GameTime time, HackGameBoard board, HackNodeGameBoardMedia drawing) { if (justKilled == true) { justKilled = false; board.GetGame().StopMusic(); } }