Example #1
0
        //Tastenbelegung
        private void HandleKeyDown(object sender, KeyEventArgs e)
        {
            switch (e.Key)
            {
            case Key.Left:
                if (Timer.IsEnabled)
                {
                    myBoard.CurrTetraminoMoveLeft();
                }
                break;

            case Key.Right:
                if (Timer.IsEnabled)
                {
                    myBoard.CurrTetraminoMoveReight();
                }
                break;

            case Key.Down:
                if (Timer.IsEnabled)
                {
                    myBoard.CurrTetraminoMoveDown();
                }
                break;

            case Key.Up:
                if (Timer.IsEnabled)
                {
                    myBoard.CurrTetraminoMoveRotate();
                }
                break;

            case Key.F2:
                GameStart();
                break;

            case Key.F3:
                GamePause();
                break;

            case Key.F4:
                GameEnd();
                break;

            default:
                break;
            }
        }