예제 #1
0
        private void pictureBox5_Click(object sender, EventArgs e)
        {
            PictureBox kaktus = sender as PictureBox;

            for (int indeks = 0; indeks < panel1.Controls.Count; indeks++)
            {
                if ((panel1.Controls[indeks] is Label) && (panel1.Controls[indeks].Location.X == (kaktus.Location.X + 48)))
                {
                    Kaktusi.Izbrani_kaktus          = panel1.Controls[indeks].Text;
                    kaktus.Visible                  = false;
                    panel1.Controls[indeks].Visible = false;

                    if (Kaktusi.Preveri_kaktus() == true)
                    {
                        Igra_2.URL = "prav.mp3";

                        MessageBox.Show("BRAVO! V mislih sem imel črko " + Kaktusi.Izbrani_kaktus + "!", "Kaktus sporoča", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        Razporedi_vse_potrebno();

                        Kaktusi.Polni_Puscavske_Crke();
                    }

                    else
                    {
                        Kaktusi.Poskusi--;

                        label6.Text = Convert.ToString(Kaktusi.Poskusi);

                        if (Kaktusi.Poskusi == 0)
                        {
                            Igra_2.URL = "wrong.wav";

                            DialogResult dialog = MessageBox.Show("HMMM, ZMANJKALO TI JE POSKUSOV! Bi poskusil/a gibati še enkrat?", "Kaktusi sporočajo", MessageBoxButtons.YesNo, MessageBoxIcon.Information);

                            if (dialog == DialogResult.Yes)
                            {
                                Razporedi_vse_potrebno();
                            }

                            else
                            {
                                Application.Exit();
                            }
                        }

                        else
                        {
                            Igra_2.URL = "wrong.wav";

                            MessageBox.Show("HMMMM, NE BO DRŽALO! Poskusi še enkrat!", "Kaktus sporoča", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                    }
                }
            }
        }
예제 #2
0
        public void Razporedi_vse_potrebno()
        {
            for (int indeks = 0; indeks < panel1.Controls.Count; indeks++)
            {
                panel1.Controls[indeks].Visible = true;
            }

            Kaktusi.Poskusi = 3;

            label6.Text = Convert.ToString(Kaktusi.Poskusi);

            Kaktusi.Polni_Puscavske_Crke();

            Kaktusi.Izbrani_kaktusek();

            Razporedi_kaktuse();
        }