예제 #1
0
        public static Ball GetBallForTestingPurposes(Rectangle ball, Rectangle screen, Paddle paddle, bool isUp, bool isRight)
        {
            Ball toReturn = new Ball(ball.Width, screen.Width, screen.Height, paddle)
            {
                BoundingBox = ball,
                _velocity   = new Vector2(isRight ? 1 : -1, isUp ? 1 : -1)
            };

            return(toReturn);
        }
예제 #2
0
파일: CPUPaddle.cs 프로젝트: RoanWC/PVPPong
 /// <summary>
 /// handles the score increase event
 /// </summary>
 protected virtual void OnScoreUp(Paddle p)
 {
     scoreUp?.Invoke(p);
 }