예제 #1
0
        private void HandleFrameAndBallCollision(Rectangle ballRectangle, FrameModel frame)
        {
            if (frame.IntersectsWithTopWall(ballRectangle))
            {
                ChangeVelocityToDown();
            }
            if (frame.IntersectsWithLeftWall(ballRectangle))
            {
                ChangeVelocityToRight();
            }

            if (frame.IntersectsWithRightWall(ballRectangle))
            {
                ChangeVelocityToLeft();
            }
        }