Beispiel #1
0
        public GameRunner(int width, int height)
        {
            Width = width;
            Height = height;

            _ball = new Ball(new Vector2(width / 2, height / 2), new Vector2(5, 5), 20.0f);
            _players[0] = new Paddle(Vector2.Empty, Vector2.Empty, 20, 80);
            _players[1] = new Paddle(new Vector2(width - 20, 0), Vector2.Empty, 20, 80);
        }
Beispiel #2
0
 public void Draw(Ball ball)
 {
     _graphics.DrawEllipse(_blackPen, ball.Location.X - ball.Radius, ball.Location.Y - ball.Radius, ball.Radius, ball.Radius);
 }