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; }
private void StartGame() { GameStatus = GAME_STATUS.IN_GAME; UserScore = 0; CompScore = 0; UserScoreLabel.Text = UserScore.ToString(); CompScoreLabel.Text = CompScore.ToString(); CompRacket.Enabled = false; Ball.Enabled = false; RestartButton.Enabled = false; RestartButton.Hide(); UserRacket.Enabled = true; UserRacket.Focus(); }
private void StartGame() { GameStatus = GAME_STATUS.IN_GAME; UserScore = 0; CompScore = 0; Ball.Location = new Point(UserRacket.Left + UserRacket.Size.Width / 2 - Size.Width / 2, UserRacket.Top - UserRacket.Size.Height); UserScoreLabel.Text = UserScore.ToString(); CompScoreLabel.Text = CompScore.ToString(); CompRacket.Enabled = false; Ball.Enabled = false; RestartButton.Enabled = false; RestartButton.Hide(); UserRacket.Enabled = true; UserRacket.Focus(); }
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(); }