private void HandleKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Left && gameTimer.IsEnabled) { plansza.TetrominoLewo(); } else if (e.Key == Key.Right && gameTimer.IsEnabled) { plansza.TetrominoPrawo(); } else if (e.Key == Key.Up && gameTimer.IsEnabled) { plansza.TetrominoObrot(); } else if (e.Key == Key.Down && gameTimer.IsEnabled) { plansza.TetrominoDol(); } else if (e.Key == Key.F1) { gameTimer.Stop(); grid1.Children.Clear(); plansza = new Plansza(grid1); gameTimer.Start(); } }
private void Start() { grid1.Children.Clear(); plansza = new Plansza(grid1); gameTimer.Start(); }