示例#1
0
 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();
     }
 }
示例#2
0
 private void Start()
 {
     grid1.Children.Clear();
     plansza = new Plansza(grid1);
     gameTimer.Start();
 }