Example #1
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            BGL bgl = new BGL();

            this.Close();
            bgl.Show();
        }
Example #2
0
        private void buttonStart_Click(object sender, EventArgs e)
        {
            name = textBoxIme.Text;
            if (name != "")
            {
                if (name.Contains(" "))
                {
                    MessageBox.Show("Ime mora biti jedna riječ");
                    return;
                }
                this.Hide();
                BGL bgl = new BGL(name, 1, 0, 6); //prima ime, trenutni level, bodove i preostale zivote
                BGL.allSprites.Clear();
                bgl.ShowDialog();

                bgl.Dispose();

                this.Close();
            }

            else
            {
                MessageBox.Show("Niste unijeli ime :)");
                return;
            }
        }
Example #3
0
        private void btnStart_Click_1(object sender, EventArgs e)
        {
            GameOptions.kraj = false;
            if (txtPlayerName.Text == "")
            {
                MessageBox.Show("Upišite ime!");
                return;
            }

            BGL igra = new BGL();

            if (rbtNature.Checked)
            {
                igra.Background = "nature.jpg";
            }
            else if (rbtSavana.Checked)
            {
                igra.Background = "savana.jpg";
            }
            else
            {
                igra.Background = "default.jpg";
            }

            playerName = txtPlayerName.Text;

            igra.frmStart = this;
            igra.Player   = txtPlayerName.Text;


            igra.ShowDialog();
        }
Example #4
0
        public void Prijelazi(int brZ, int b, string ime)
        {
            if ((level == 1 || level == 2) && brZ <= 0) //ako su izgubljeni svi zivoti
            {
                DatotekaUpis(ime, b);
                Form3 zavrsna = new Form3(ime, b);
                START = false;

                //wait da pričeka dok se sve pogasi što treba na start
                Wait(0.5);
                //hide, da se ne zatvori jer nakon Close se ništa više neće izvršiti
                this.Hide();
                //bgl nije zatvorena te čeka dok završna ne obavi što treba
                zavrsna.ShowDialog();
                //nakon što se završna zatvori, ili će se zatvoriti ili će prije djelovati Restart
                this.Close();
            }

            if (brZ > 0 && level == 1 && timeLeft == 0) //prijelaz na drugi level
            {
                if (brZ == 6)
                {
                    b += 10;
                }
                START = false;
                START = true;
                MessageBox.Show("CESTITATMO! IDETE NA DRUGI LEVEL!\n\nVasi trenutni bodovi: " + b + "\nPreostali zivoti: " + brZ);
                BGL novi = new BGL(imeIgraca, 2, b, brZ);
                this.Hide();
                novi.ShowDialog();
                this.Close();
            }

            if (brZ > 0 && level == 2 && timeLeft == 0) //kraj
            {
                if (brZ == 6)
                {
                    b += 10;
                }
                DatotekaUpis(ime, b);
                MessageBox.Show("BRAVO\nDošli ste do kraja igre :)\n\nBodovi: " + b);

                Form3 zavrsna = new Form3(ime, b);
                this.Hide();
                zavrsna.ShowDialog();
                START = false;
                allSprites.Clear();
            }
        }