コード例 #1
0
ファイル: Ball.cs プロジェクト: daniellee/BallBounce
        private void HandleFrameAndBallCollision(Rectangle ballRectangle, FrameModel frame)
        {
            if (frame.IntersectsWithTopWall(ballRectangle))
            {
                ChangeVelocityToDown();
            }
            if (frame.IntersectsWithLeftWall(ballRectangle))
            {
                ChangeVelocityToRight();
            }

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