void GameClear() { if (game != null) { game.Stop(); gameAppearence.ClearCache(); game = null; gameAppearence = null; } tsmiPause.Enabled = false; gameStatusLeftWords.Text = "Осталось слов:"; gameStatusErrors.Text = "Ошибок:"; }
void GameCreateAndStart() { try { game = new Game(20, 15, gameSettings); } catch (InvalidOperationException ex) { MessageBox.Show(this, ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } gameAppearence = new GameAppearence(game); gameAppearence.MainFont = Font; gameAppearence.GrayCellImageData = CommonHelper.GetResourceData("WordGame.Data.cell.bmp"); game.OnStartLetterDieAnimation += new StartLetterDieAnimationHandler(game_OnStartLetterDieAnimation); game.OnStartWordAndLetterDieAnimation += new StartWordAndLetterDieAnimationHandler(game_OnStartWordAndLetterDieAnimation); game.OnUpdateScreen += new EventHandler(game_OnUpdateScreen); gameAppearence.UpdateScreenSize(gamePanel.ClientSize); game.StartGameThreads(); timer1.Enabled = true; tsmiPause.Enabled = true; }