void t4_Tick(object sender, EventArgs e) { if (Program.f == 0) { Random r = new Random(); for (int i = 0; i < linii.Count; i++) { SolidBrush bb1 = new SolidBrush(Color.FromArgb(r.Next(0, 255), r.Next(0, 255), r.Next(0, 255))); Color c1 = bb1.Color; LinearGradientBrush br = new LinearGradientBrush(new Point(linii[i].x, linii[i].y), new Point(linii[i].x + linii[i].dolzina, linii[i].y + 3), c1, Color.Gray); linii[i].boja = br; } if (progressBar1.Value == 16) { label3.Text = ""; } if (progressBar1.Value == 16 && covece.y == 0) { t5.Start(); } if (progressBar1.Value == 0) { t1.Stop(); t2.Stop(); t3.Stop(); t4.Stop(); DialogResult rez = new DialogResult(); rez = MessageBox.Show("Sledno nivo??.", "Sledno nivo?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (rez == DialogResult.Yes) { Program.Poeni = Program.Poeni + Poeni; this.Visible = false; Igraa1 nivo2 = new Igraa1(); nivo2.ShowDialog(); } if (rez == DialogResult.No) { MessageBox.Show("Osvoivte: " + Poeni + " poeni!"); this.Close(); } } if (progressBar1.Value != 0) { if (!this.IsAccessible) { progressBar1.Value--; } } } }
private void button4_Click(object sender, EventArgs e) { bool flag = false; if (tbIme.Text == "") { MessageBox.Show("Vnesete Ime!"); return; } if (cmbLevel.SelectedIndex == -1) { MessageBox.Show("Izberete level!"); return; } foreach (Player p in players) { if (p.Nickname == tbIme.Text) { flag = true; p.Poeni = 0; } } if (flag == false) { Player p = new Player(tbIme.Text, 0); players.Add(p); } //this.Hide(); if (cmbLevel.SelectedIndex == 0) { Program.Poeni = 0; Igra igra = new Igra(); if (igra.ShowDialog() == DialogResult.Cancel) { } } if (cmbLevel.SelectedIndex == 1) { Program.Poeni = 0; Igraa1 igra1 = new Igraa1(); if (igra1.ShowDialog() == DialogResult.Cancel) { } } if (cmbLevel.SelectedIndex == 2) { Program.Poeni = 0; Igra2 igra2 = new Igra2(); if (igra2.ShowDialog() == DialogResult.Cancel) { } } for (int i = 0; i < players.Count; i++) { if (players[i].Nickname == tbIme.Text) { players[i].Poeni = Program.Poeni; } } }
void t4_Tick(object sender, EventArgs e) { if (Program.f == 0) { Random r = new Random(); for (int i = 0; i < linii.Count; i++) { SolidBrush bb1 = new SolidBrush(Color.FromArgb(r.Next(0, 255), r.Next(0, 255), r.Next(0, 255))); Color c1 = bb1.Color; LinearGradientBrush br = new LinearGradientBrush(new Point(linii[i].x, linii[i].y), new Point(linii[i].x + linii[i].dolzina, linii[i].y + 3), c1, Color.Gray); linii[i].boja = br; } if (progressBar1.Value == 16) { label3.Text = ""; } if (progressBar1.Value == 16 && covece.y==0) { t5.Start(); } if (progressBar1.Value == 0) { t1.Stop(); t2.Stop(); t3.Stop(); t4.Stop(); DialogResult rez = new DialogResult(); rez = MessageBox.Show("Sledno nivo??.", "Sledno nivo?", MessageBoxButtons.YesNo,MessageBoxIcon.Question); if (rez == DialogResult.Yes) { Program.Poeni = Program.Poeni + Poeni; this.Visible = false; Igraa1 nivo2 = new Igraa1(); nivo2.ShowDialog(); } if (rez == DialogResult.No) { MessageBox.Show("Osvoivte: " + Poeni + " poeni!"); this.Close(); } } if (progressBar1.Value != 0) { if (!this.IsAccessible) progressBar1.Value--; } } }