예제 #1
0
 public bool HitsRacket(Racket racket)
 {
     return(_bounds.Bottom >= racket.Area.Top &&
            _bounds.Bottom <= racket.Area.Bottom &&
            _bounds.Left >= racket.Area.Left &&
            _bounds.Right <= racket.Area.Right);
 }
예제 #2
0
        private void ResetGame()
        {
            _random = new Random();
            Cursor.Hide();
            _playground = new Playground(this);
            _playground.FullScreen();

            _ball = new Ball
            {
                X = 4,
                Y = 4
            };

            _racket = new Racket(racket, Bottom);
            _score  = new Score(points);

            _gameover = new Gameover(gameover);
            _gameover.Hide();
            _gameover.Center(_playground);

            timer1.Enabled = true;
        }
예제 #3
0
 public bool MissesRacket(Racket racket)
 {
     return(_bounds.Bottom >= racket.Area.Bottom);
 }