Esempio n. 1
0
        public TennisGame(MainMenuForm mainMenu)
        {
            InitializeComponent();
            this.mainMenu = mainMenu;
            gameStatus    = GAME_STATUS.IN_GAME;
            UserScore     = 0;
            CompScore     = 0;

            UserScoreLabel.Text = UserScore.ToString();
            CompScoreLabel.Text = CompScore.ToString();

            table = TablePanel.CreateGraphics();

            userRacket = new UserRacket(this);
            compRacket = new CompRacket(this);
            ball       = new Ball(this);

            TablePanel.Controls.Add(userRacket);
            TablePanel.Controls.Add(compRacket);
            TablePanel.Controls.Add(ball);

            userRacket.Show();
            compRacket.Show();
            ball.Show();

            compRacket.Enabled = false;
            ball.Enabled       = false;
        }
Esempio n. 2
0
        public TennisGame(MainMenuForm mainMenu)
        {
            InitializeComponent();
            this.mainMenu = mainMenu;
            gameStatus    = GAME_STATUS.IN_GAME;

            table = TablePanel.CreateGraphics();

            userRacket = new UserRacket(this);
            compRacket = new CompRacket(this);
            ball       = new Ball(this);

            TablePanel.Controls.Add(userRacket);
            TablePanel.Controls.Add(compRacket);
            TablePanel.Controls.Add(ball);

            userRacket.Show();
            compRacket.Show();
            ball.Show();
        }
        public TennisGame(MainMenuForm mainMenu)
        {
            InitializeComponent();
            this.mainMenu = mainMenu;

            Table = TablePanel.CreateGraphics();

            UserRacket = new UserRacket(this);
            CompRacket = new CompRacket(this);
            Ball       = new Ball(this);

            TablePanel.Controls.Add(UserRacket);
            TablePanel.Controls.Add(CompRacket);
            TablePanel.Controls.Add(Ball);

            UserRacket.Show();
            CompRacket.Show();
            Ball.Show();

            UserRacket.Enabled = false;
            RestartButton.Focus();
        }