Beispiel #1
0
 private void Form1_KeyUp(object sender, KeyEventArgs e)
 {
     Player1TimerDown.Stop();
     Player1TimerUp.Stop();
     Player2TimerDown.Stop();
     Player2TimerUp.Stop();
 }
Beispiel #2
0
        private void Form1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Down)
            {
                Player2TimerDown.Start();
            }
            else if (e.KeyCode == Keys.Up)
            {
                Player2TimerUp.Start();
            }

            if (e.KeyCode == Keys.W)
            {
                Player1TimerUp.Start();
            }
            else if (e.KeyCode == Keys.S)
            {
                Player1TimerDown.Start();
            }

            if (e.KeyCode == Keys.Enter)
            {
                label1.Text = "";
                BallTimer.Start();
            }
        }