// Start is called before the first frame update void Start() { total_score_text = this.GetComponent <Text>(); ts = GameObject.Find("Timer").GetComponent <TimerScore>(); rui = GameObject.Find("Heart_Score").GetComponent <RemainUI>(); tt = GameObject.Find("Timer_Score").GetComponent <TimerText>(); is_text_ienumerator = false; is_score_ienumerator = false; is_end_typing = false; score = 0; }
private void Form1_MouseClick(object sender, MouseEventArgs e) { //finding out what cell is clicked int X = (e.X) / 30; int Y = (e.Y) / 30; if (e.Button == MouseButtons.Right) { //if clicked outside grid, roast whoever did that if (PuusyBoi == true) { if (Y < 0 | Y > 8 | X < 0 | X > 8) { MessageBox.Show("stop doing shit u monkey"); } else { if (SweepGrid.GetTile(Y, X).Flag == false && SweepGrid.GetTile(Y, X).Quest == false && SweepGrid.GetTile(Y, X).Click == false) { SweepGrid.GetTile(Y, X).ForegroundColour = Resource1._76px_Minesweeper_flag_svg; Bombs--; lblBombs.Text = "Bombs: " + Bombs; SweepGrid.GetTile(Y, X).Flag = true; this.Refresh(); } else if (SweepGrid.GetTile(Y, X).Flag == true) { SweepGrid.GetTile(Y, X).ForegroundColour = Resource1._76px_Minesweeper_questionmark_svg; Bombs++; lblBombs.Text = "Bombs: " + Bombs; SweepGrid.GetTile(Y, X).Flag = false; SweepGrid.GetTile(Y, X).Quest = true; this.Refresh(); } else if (SweepGrid.GetTile(Y, X).Quest == true) { SweepGrid.GetTile(Y, X).ForegroundColour = Resource1._76px_Minesweeper_unopened_square_svg; SweepGrid.GetTile(Y, X).Quest = false; this.Refresh(); } for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { if (SweepGrid.GetTile(i, j).Click == true) { Win++; } if (Win == 71) { for (int r = 0; r < 9; r++) { for (int c = 0; c < 9; c++) { if (SweepGrid.GetTile(r, c).Bomb == true) { SweepGrid.GetTile(r, c).ForegroundColour = Resource1.Bomb; } SweepGrid.GetTile(r, c).Click = true; //message box } } i = 9; j = 9; this.Refresh(); TimerScore.Stop(); MessageBox.Show("grats ur not absolute aids"); } } } Win = 0; } } if (UgandanKnuckles == true) { if (Y < 0 | Y > 15 | X < 0 | X > 15) { MessageBox.Show("stop doing shit u monkey"); } else { if (SweepGrid.GetTile(Y, X).Flag == false && SweepGrid.GetTile(Y, X).Quest == false && SweepGrid.GetTile(Y, X).Click == false) { SweepGrid.GetTile(Y, X).ForegroundColour = Resource1._76px_Minesweeper_flag_svg; Bombs--; lblBombs.Text = "Bombs: " + Bombs; SweepGrid.GetTile(Y, X).Flag = true; this.Refresh(); } else if (SweepGrid.GetTile(Y, X).Flag == true) { SweepGrid.GetTile(Y, X).ForegroundColour = Resource1._76px_Minesweeper_questionmark_svg; Bombs++; lblBombs.Text = "Bombs: " + Bombs; SweepGrid.GetTile(Y, X).Flag = false; SweepGrid.GetTile(Y, X).Quest = true; this.Refresh(); } else if (SweepGrid.GetTile(Y, X).Quest == true) { SweepGrid.GetTile(Y, X).ForegroundColour = Resource1._76px_Minesweeper_unopened_square_svg; SweepGrid.GetTile(Y, X).Quest = false; this.Refresh(); } for (int i = 0; i < 16; i++) { for (int j = 0; j < 16; j++) { if (SweepGrid.GetTile(i, j).Click == true) { Win++; } if (Win == 216) { for (int r = 0; r < 16; r++) { for (int c = 0; c < 16; c++) { if (SweepGrid.GetTile(r, c).Bomb == true) { SweepGrid.GetTile(r, c).ForegroundColour = Resource1.Bomb; } SweepGrid.GetTile(r, c).Click = true; //message box } } i = 16; j = 16; TimerScore.Stop(); this.Refresh(); MessageBox.Show("grats ur not absolute aids"); } } } Win = 0; } } } if (e.Button == MouseButtons.Left) { //if clicked outside grid, roast whoever did that if (PuusyBoi == true) { if (Y < 0 | Y > 8 | X < 0 | X > 8) { MessageBox.Show("stop doing shit u monkey"); } else { ClearSpace(Y, X); if (SweepGrid.GetTile(Y, X).Bomb == true && SweepGrid.GetTile(Y, X).Click == false) { for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { if (SweepGrid.GetTile(i, j).Bomb == true) { SweepGrid.GetTile(i, j).ForegroundColour = Resource1.Bomb; } SweepGrid.GetTile(i, j).Click = true; } } SweepGrid.GetTile(Y, X).ForegroundColour = Resource1._1200x630bb; //mesasge box that theyre trash and put options to restart TimerScore.Stop(); this.Refresh(); MessageBox.Show("Dang flabit! You lost! Try again"); } for (int i = 0; i < 9; i++) { for (int j = 0; j < 9; j++) { if (SweepGrid.GetTile(i, j).Click == true) { Win++; } if (Win == 71) { for (int r = 0; r < 9; r++) { for (int c = 0; c < 9; c++) { if (SweepGrid.GetTile(r, c).Bomb == true) { SweepGrid.GetTile(r, c).ForegroundColour = Resource1.Bomb; } SweepGrid.GetTile(r, c).Click = true; //message box } } i = 9; j = 9; TimerScore.Stop(); this.Refresh(); MessageBox.Show("grats ur not absolute aids"); } } } Win = 0; this.Refresh(); } } if (UgandanKnuckles == true) { if (Y < 0 | Y > 15 | X < 0 | X > 15) { MessageBox.Show("stop doing shit u monkey"); } else { //Change(Y, X); ClearSpace(Y, X); if (SweepGrid.GetTile(Y, X).Bomb == true && SweepGrid.GetTile(Y, X).Click == false) { for (int i = 0; i < 16; i++) { for (int j = 0; j < 16; j++) { if (SweepGrid.GetTile(i, j).Bomb == true) { SweepGrid.GetTile(i, j).ForegroundColour = Resource1.Bomb; } SweepGrid.GetTile(i, j).Click = true; } } SweepGrid.GetTile(Y, X).ForegroundColour = Resource1._1200x630bb; //mesasge box that theyre trash and put options to restart TimerScore.Stop(); this.Refresh(); MessageBox.Show("Dang flabit! You lost! Try again"); } for (int i = 0; i < 16; i++) { for (int j = 0; j < 16; j++) { if (SweepGrid.GetTile(i, j).Click == true) { Win++; } if (Win == 216) { for (int r = 0; r < 16; r++) { for (int c = 0; c < 16; c++) { if (SweepGrid.GetTile(r, c).Bomb == true) { SweepGrid.GetTile(r, c).ForegroundColour = Resource1.Bomb; } SweepGrid.GetTile(r, c).Click = true; //message box } } i = 16; j = 16; TimerScore.Stop(); this.Refresh(); MessageBox.Show("grats ur not absolute aids"); } } } Win = 0; this.Refresh(); } } } }
private void Awake() { instance = this; StartTimer(); }