Exemplo n.º 1
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;
        }
Exemplo n.º 2
0
 public bool HitsCeilingOf(Playground playground)
 {
     return(_bounds.Top <= playground.Bounds.Top);
 }
Exemplo n.º 3
0
 public bool HitsWallsOf(Playground playground)
 {
     return(_bounds.Left <= playground.Bounds.Left ||
            _bounds.Right >= playground.Bounds.Right);
 }
Exemplo n.º 4
0
 public void Center(Playground playground)
 {
     _control.Left    = playground.Bounds.Width / 2 - _control.Width / 2;
     _control.Top     = playground.Bounds.Height / 2 - _control.Height / 2;
     _control.Visible = false;
 }