예제 #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;
        }
예제 #2
0
        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();
        }
예제 #3
0
        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();
        }
예제 #4
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();
        }
예제 #5
0
        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();
        }