Exemplo n.º 1
0
        void GetKey(object sender, KeyEventArgs e)
        {
            switch (e.Key.ToString())
            {
            case "Left":
                game.MoveBlockHorizontal(true);
                break;

            case "Right":
                game.MoveBlockHorizontal(false);
                break;

            case "Up":
                game.RotateBlock();
                break;

            case "Down":
                game.BlockFall(2);
                break;

            case "Space":
                game.BlockFall(20);
                break;

            case "LeftCtrl":
                game.HoldBlock();
                break;
            }
        }