public void UpgradePlayer(Battlefield b) { if (Score >= player.price && player.price != 0) { Score -= player.price; float tempX = ConvertUnits.ToDisplayUnits(Player.body.Position.X); float tempY = ConvertUnits.ToDisplayUnits(Player.body.Position.Y); float tempRotation = Player.body.Rotation; Player.body.Dispose(); b.Player = ShipFactory.UpgradeShip(b.Player.name, tempX, tempY, world); b.Player.body.Rotation = tempRotation; b.Player.body.BodyId = 1; input.P = Player; playerHud = new HUD(Player); Player.body.CollisionCategories = Category.Cat6; c.updatePlayerBody(Player); pause = false; } }