示例#1
0
        public void BallPaddleIntersect()
        {
            if (players[0].GetUpperPaddleBounds().Intersects(ball.GetBallBounce()))
            {
                ball.UpperRightPadCollision();
                padEffect.Play();
            }
            if (players[0].GetLowerPaddleBounds().Intersects(ball.GetBallBounce()))
            {
                ball.LowerRightPadCollision();
                padEffect.Play();
            }


            if (players[0].GetUpperPaddleBounds().Intersects(ball.GetBallBounce()))
            {
                ball.UpperLeftPadCollision();
                padEffect.Play();
            }
            if (players[0].GetLowerPaddleBounds().Intersects(ball.GetBallBounce()))
            {
                ball.LowerLeftPadCollision();
                padEffect.Play();
            }


            //if (player2.GetUpperPaddleBounds().Intersects(ball.GetBallBounce()))
            //{
            //    ball.UpperRightPadCollision();
            //    padEffect.Play();
            //}
            //if (player2.GetLowerPaddleBounds().Intersects(ball.GetBallBounce()))
            //{
            //    ball.LowerRightPadCollision();
            //    padEffect.Play();
            //}


            //if (player.GetUpperPaddleBounds().Intersects(ball.GetBallBounce()))
            //{
            //    ball.UpperLeftPadCollision();
            //    padEffect.Play();
            //}
            //if (player.GetLowerPaddleBounds().Intersects(ball.GetBallBounce()))
            //{
            //    ball.LowerLeftPadCollision();
            //    padEffect.Play();
            //}
        }