Beispiel #1
0
        private void window_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.A || e.Key == Key.Left)
            {
                tetris.LeftOrRightMove("left");
                label2.Content = "Score: " + tetris.score;
                label3.Content = "Lines: " + tetris.lines;
                tetris.GameFinish();
                SetDüsmeHizi();
            }
            else if (e.Key == Key.D || e.Key == Key.Right)
            {
                tetris.LeftOrRightMove("right");
                label2.Content = "Score: " + tetris.score;
                label3.Content = "Lines: " + tetris.lines;
                tetris.GameFinish();
                SetDüsmeHizi();
            }
            else if (e.Key == Key.W || e.Key == Key.Up)
            {
                label2.Content = "Score: " + tetris.score;
                label3.Content = "Lines: " + tetris.lines;
                tetris.SquareChangeShape();
                SetDüsmeHizi();
            }

            else if (e.Key == Key.S || e.Key == Key.Down)
            {
                label2.Content = "Score: " + tetris.score;
                label3.Content = "Lines: " + tetris.lines;
                speedDown.Start();
                SetDüsmeHizi();
            }
        }