Example #1
0
        private void resetForm()
        {
            for (int i = 0; i < jednorozce.Length; i++)
            {
                jednorozce[i].UstawX(5);
            }

            pictureBoxJednorozec1.Location = new Point(J1.PodajX(), 5);
            pictureBoxJednorozec2.Location = new Point(J2.PodajX(), 105);
            pictureBoxJednorozec3.Location = new Point(J3.PodajX(), 205);
            pictureBoxJednorozec4.Location = new Point(J4.PodajX(), 305);

            buttonPodpiszZaklad.Enabled = true;
            buttonStart.Enabled         = true;
            buttonZasady.Enabled        = true;

            for (int i = 0; i < zaklady.Length; i++)
            {
                zaklady[i].ResetujZaglosowanie();
            }

            pula.ResetujPule();
            labelPula.Text = Convert.ToString(pula.StanPuli());

            labelZbychuZaklad.Text   = "Czekam na zakład Zbycha...";
            labelHelgaZaklad.Text    = "Czekam na zakład Helgi...";
            labelEustachyZaklad.Text = "Czekam na zaklad Eustachego...";

            label1.Text = "ma aktualnie " + gracze[comboBoxGracz.SelectedIndex].KasaGracza() + " PLN";
        }
Example #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            J1.UstawX(pictureBoxJednorozec1.Location.X);
            pictureBoxJednorozec1.Location = new Point(J1.PodajX() + J1.PodajPredkosc(), 5);

            J2.UstawX(pictureBoxJednorozec2.Location.X);
            pictureBoxJednorozec2.Location = new Point(J2.PodajX() + J2.PodajPredkosc(), 105);

            J3.UstawX(pictureBoxJednorozec3.Location.X);
            pictureBoxJednorozec3.Location = new Point(J3.PodajX() + J3.PodajPredkosc(), 205);

            J4.UstawX(pictureBoxJednorozec4.Location.X);
            pictureBoxJednorozec4.Location = new Point(J4.PodajX() + J4.PodajPredkosc(), 305);

            if (J1.CzyJuzWygral() == true)
            {
                timer1.Stop();
                pula.UstawIndeksWygrywajacegoJednorozca(0);
                J1.Wygrana();
                zakonczTure();
            }
            else if (J2.CzyJuzWygral() == true)
            {
                timer1.Stop();
                pula.UstawIndeksWygrywajacegoJednorozca(1);
                J2.Wygrana();
                zakonczTure();
            }
            else if (J3.CzyJuzWygral() == true)
            {
                timer1.Stop();
                pula.UstawIndeksWygrywajacegoJednorozca(2);
                J3.Wygrana();
                zakonczTure();
            }
            else if (J4.CzyJuzWygral() == true)
            {
                timer1.Stop();
                pula.UstawIndeksWygrywajacegoJednorozca(3);
                J4.Wygrana();
                zakonczTure();
            }
        }