internal void UpdateMoves(ShipMovements shipMove) { _Thrust = Math.Max(_Thrust + shipMove.ThrustChange, 0.0f); _Spin += shipMove.SpinChange; _Angle += _Spin; _Velocity += TranslateThrustAngleToMovement(_Thrust, _Angle); }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { // Parse current keyboard state and update player speed ShipMovements shipMove = new ShipMovements(); bool exit = false; // TODO MIKAEL: This needs to be handled // ShipMovements shipMove = _InputHandler.Parse(out bool exit); if (exit) { Exit(); } ShipManager.Instance.GetPlayerShip().UpdateMoves(shipMove); ShipManager.Instance.UpdatePositions(); base.Update(gameTime); }