private static void Btn_Click(object sender, EventArgs e) { if (MinesCount != 0) { FormCenter.lblTotalTime.Text = "Kalan Süre = " + OldTime.ToString(); Time = OldTime; Button btn = (Button)sender; if (MineFine(int.Parse(btn.Name))) { btn.BackColor = Color.Red; HelperMineField.GameRestart(Control, Timer); MessageBox.Show("Oyun Bitti.\nYeniden Başlayın"); } else { int s = MineCountButton(btn); btn.Text = s.ToString(); btn.BackColor = Color.Green; GreenButtonCount++; if (Winner == GreenButtonCount) { MessageBox.Show("Tebrikler\nYeniden başlamak için 'Başla' butonuna basın!"); GameRestart(Control, Timer); } } } else { MessageBox.Show("Oyun Başlamadı."); } }
private void time_Tick(object sender, EventArgs e) { lblTotalTime.Text = "Kalan Süre = " + HelperMineField.Time.ToString(); if (HelperMineField.Time == 0) { HelperMineField.GameRestart(panelMines,time); MessageBox.Show("Süre Bitti.\nYeniden başlayın!.", "Game", MessageBoxButtons.OK, MessageBoxIcon.Warning); } HelperMineField.Time--; }
private void btnStart_Click(object sender, EventArgs e) { if ((int)numbericMinesCount.Value < 25 && (int)numbericMinesCount.Value > 0) { HelperMineField.MineCreated((int)numbericMinesCount.Value, panelMines, (int)numbericTime.Value,time); time.Enabled = true; _FormPreview = new FormPreview(); _FormPreview.Name = "form"; if (Application.OpenForms["form"] == null) _FormPreview.Show(); } else MessageBox.Show("1-24 arasında değer girin!"); }
private void FormCenter_Load(object sender, EventArgs e) { HelperMineField.DinamicButton(panelMines); }
private void refresh_Tick(object sender, EventArgs e) { HelperMineField.MinePreview(panelMine); }
private void FormPreview_Load(object sender, EventArgs e) { HelperMineField.DinamicButton(panelMine); refresh.Start(); }