public void SplitBalls(Player player)
        {
            for (int i = gameObjects.Count - 1; i >= 0; i--)
            {
                if (gameObjects[i] is Ball && (gameObjects[i] as Ball).Owner == player)
                {
                    float   angle   = (float)Game1.rand.NextDouble() * MathHelper.TwoPi;
                    Vector2 heading = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle));
                    (gameObjects[i] as Ball).Launch(heading);

                    for (int j = 0; j < Game1.rand.Next(2, 5); j++)
                    {
                        if (player.Balls >= 15)
                        {
                            continue;
                        }
                        angle   = (float)Game1.rand.NextDouble() * MathHelper.TwoPi;
                        heading = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle));



                        player.AddBall();
                        Ball b = new Ball(player, gameObjects[i].Position + new Vector2(0, 0.001f), ConvertUnits.ToSimUnits(10.0f), ConvertUnits.ToSimUnits(screenHeight), world);
                        gameObjects.Add(b);
                        b.Launch(heading);
                    }
                }
            }
        }
        /// <summary>
        /// Spawns a ball and attaches it to player's paddle
        /// </summary>
        /// <param name="player"></param>
        public void SpawnBall(Player player)
        {
            player.AddBall();
            Ball b = new Ball(player, ConvertUnits.ToSimUnits(new Vector2(screenWidth / 2.0f, screenHeight - 400.0f)), ConvertUnits.ToSimUnits(10.0f), ConvertUnits.ToSimUnits(screenHeight), world);

            gameObjects.Add(b);
            player.Paddle.Attach(b);
        }
        public void SplitBalls(Player player)
        {
            for(int i = gameObjects.Count - 1; i >= 0; i--)
            {
                if (gameObjects[i] is Ball && (gameObjects[i] as Ball).Owner == player) {
                    

                    float angle = (float)Game1.rand.NextDouble() * MathHelper.TwoPi;
                    Vector2 heading = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle));
                    (gameObjects[i] as Ball).Launch(heading);

                    for(int j = 0; j < Game1.rand.Next(2,5); j++)
                    {
                        if (player.Balls >= 15)
                            continue;
                        angle = (float)Game1.rand.NextDouble() * MathHelper.TwoPi;
                        heading = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle));



                        player.AddBall();
                        Ball b = new Ball(player, gameObjects[i].Position + new Vector2(0, 0.001f), ConvertUnits.ToSimUnits(10.0f), ConvertUnits.ToSimUnits(screenHeight), world);
                        gameObjects.Add(b);
                        b.Launch(heading);
                    }
                }
            }
        }
 /// <summary>
 /// Spawns a ball and attaches it to player's paddle
 /// </summary>
 /// <param name="player"></param>
 public void SpawnBall(Player player) {
     player.AddBall();
     Ball b = new Ball(player, ConvertUnits.ToSimUnits(new Vector2(screenWidth / 2.0f, screenHeight - 400.0f)), ConvertUnits.ToSimUnits(10.0f), ConvertUnits.ToSimUnits(screenHeight), world);
     gameObjects.Add(b);
     player.Paddle.Attach(b);
 }