Beispiel #1
0
        private void FormGame_KeyDown(object sender, KeyEventArgs e)
        {
            if (timerGameOver.Enabled)
            {
                switch (e.KeyCode)
                {
                case Keys.Left: board.MovePlayer(Arrows.left); break;

                case Keys.Right: board.MovePlayer(Arrows.right); break;

                case Keys.Up: board.MovePlayer(Arrows.up); break;

                case Keys.Down: board.MovePlayer(Arrows.down); break;

                case Keys.Space: board.PutBomb(); break;
                }
            }
        }
Beispiel #2
0
        private void FormGame_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Left:
                board.MovePlayer(Arrows.left);
                break;

            case Keys.Right:
                board.MovePlayer(Arrows.right);
                break;

            case Keys.Up:
                board.MovePlayer(Arrows.up);
                break;

            case Keys.Down:
                board.MovePlayer(Arrows.dawn);
                break;
            }
        }