private void Menu_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { this.Close(); } if (e.KeyCode == Keys.S) { Top5Score top5 = new Top5Score(); top5.ShowDialog(); } }
private void AnaForm_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.Right: _game.Move(Direction.Right); break; case Keys.Left: _game.Move(Direction.Left); break; case Keys.Space: _game.Shoot(); break; case Keys.P: //P tuşuna bastıkca pause yi 1 artırıp kontrol olarak kullanır pause++; if (pause % 2 != 0) { _game.GamePause(true); } if (pause % 2 == 0) { _game.GamePause(false); } break; case Keys.S: Top5Score top5 = new Top5Score(); top5.ShowDialog(); break; default: break; } }