private void CurrentGame_Over(object sender, EventArgs e) { if (_gameoverDisplay == null) { _gameoverDisplay = new GameOverForm(CurrentGame); } _gameoverDisplay.ShowDialog(CurrentGame); pointsValue.Text = "0"; // Otherwise KeyDown (MainForm) wont trigger CurrentGame.Focus(); }
public FormsManager(GUIForm guiForm) { MainMenu = new MainMenuForm(guiForm, this); Game = new GameForm(guiForm, this); StageNumber = new StageNumberForm(guiForm, this); GameOver = new GameOverForm(guiForm, this); Construction = new ConstructionForm(guiForm, this, Game.Field); Options = new OptionsForm(guiForm, this); Records = new RecordsForm(guiForm, this); ActiveForm = MainMenu; SetMainMenuForm(); }
private void TimerTick(object sender, EventArgs args) { gameState.PerformAct(game); if (game.IsEnd) { timer.Stop(); var endGameForm = new GameOverForm(menuBitmaps) { StartPosition = FormStartPosition.CenterParent }; endGameForm.ShowDialog(); Close(); } tickCount++; tickCount %= 100; Invalidate(); }