Esempio n. 1
0
        public Form1()
        {
            InitializeComponent();

            _playerOne           = 170;
            _playerTwo           = 170;
            _objPostionPlayerOne = positionPlayerOne.stop;
            _objPostionPlayerTwo = positionPlayerTwo.stop;
        }
Esempio n. 2
0
 private void Form1_KeyUp(object sender, KeyEventArgs e)
 {
     // Makes the players stop
     if (e.KeyCode == Keys.W || e.KeyCode == Keys.S)
     {
         _objPostionPlayerOne = positionPlayerOne.stop;
     }
     if (e.KeyCode == Keys.O || e.KeyCode == Keys.L)
     {
         _objPostionPlayerTwo = positionPlayerTwo.stop;
     }
 }
Esempio n. 3
0
        private void directions(KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.W:
                _objPostionPlayerOne = positionPlayerOne.up;
                break;

            case Keys.S:
                _objPostionPlayerOne = positionPlayerOne.down;
                break;

            case Keys.O:
                _objPostionPlayerTwo = positionPlayerTwo.up;
                break;

            case Keys.L:
                _objPostionPlayerTwo = positionPlayerTwo.down;
                break;
            }
        }