public override void Update(GameTime gameTime) { #region Input if (ControlManager.CheckHold(RebindableKeys.Up)) { txtSpeed += 0.01f; } else { txtSpeed -= 0.01f; } if (ControlManager.GamepadReady == false) { if (ControlManager.CheckPress(RebindableKeys.Action1) || ControlManager.CheckKeyPress(Keys.Enter)) { Game.stateManager.ChangeState("OverworldState"); } } if (ControlManager.GamepadReady == true) { if (ControlManager.CurrentGamepadState.IsButtonDown(ControlManager.GamepadAction)) { Game.stateManager.ChangeState("OverworldState"); } } #endregion textBox.Update(gameTime); textBox.TextBoxPosY -= txtSpeed; if (txtSpeed > txtMaxSpeed) { txtSpeed = txtMaxSpeed; } else if (txtSpeed < txtMinSpeed) { txtSpeed = txtMinSpeed; } if (textBox.TextBoxPosY < 325) { Game.stateManager.ChangeState("OverworldState"); } for (int i = 0; i < NumberOfStars; i++) { starPositions[i].X += (starSpeed * starSpeedModifiers[i]) * gameTime.ElapsedGameTime.Milliseconds; int returnValue = StaticFunctions.IsPositionOutsideScreenX(starPositions[i], Game); if (returnValue == 2) { starPositions[i] = new Vector2(-30, (float)Game.random.Next(0, Game1.ScreenSize.Y)); } } }
public override void Update(GameTime gameTime) { StaticFunctions.CheckObjectUsage(Game, deepSpaceGameObjects); camera.CameraUpdate(gameTime, Game.player); DetermineCurrentRegion(); sectorX.Update(gameTime); outpostX.Update(gameTime); borderXOutpost.Update(gameTime); miningOutpost.Update(gameTime); rebelOutpost.Update(gameTime); highFenceOrbit.Update(gameTime); fortrunOrbit.Update(gameTime); newNorrlandOrbit.Update(gameTime); soelaraOrbit.Update(gameTime); lavisOrbit.Update(gameTime); peyeOrbit.Update(gameTime); UpdateDeepSpaceObjects(gameTime); bGManagerOverworld.Update(gameTime); HUD.Update(gameTime, GetAllOverworldGameObjects); if (ZoomMap.MapState == MapState.Off) { Inputhandling(); } if (burnOutEnding.Finished && GameStateManager.currentState.Equals("OverworldState")) { Game.stateManager.outroState.SetOutroType(OutroType.OnYourOwnEnd); Game.stateManager.ChangeState("OutroState"); Game.player.EnableControls(); } if (StatsManager.gameMode == GameMode.Develop) { InputhandlingDebug(); } EdgeCollisionCheck(); if (garbageDeepSpaceGameObjects.Count > 0) { DeleteRemovedGameObjects(); } if (garbageEffectsObjects.Count > 0) { DeleteRemovedEffects(); } burnOutEnding.Update(gameTime); foreach (Beacon beacon in beacons) { if (Vector2.Distance(Game.player.position, beacon.position) < BeaconActivationRadius && !beacon.IsActivated) { beacon.PlayerGetsClose(); } } base.Update(gameTime); }