Пример #1
0
        //Avaa käyttäjävalikon
        private void btYksinpeli_Click(object sender, EventArgs e)
        {
            this.Hide();

            using (var kayttajavalikko = new Kayttajavalikko(this))
            {
                kayttajavalikko.ShowDialog();
                this.Show();

                if (mute == true)
                {
                    btMute.BackgroundImage = Properties.Resources.on;
                }

                else if (mute == false)
                {
                    btMute.BackgroundImage = Properties.Resources.off;
                }
            }
        }
Пример #2
0
        public Pelilauta(Kayttajavalikko kayttajavalikko)
        {
            InitializeComponent();

            this.kayttajavalikko = kayttajavalikko;

            if (Paavalikko.mute == true)
            {
                btMute.BackgroundImage = Properties.Resources.on;
                peli.PlayLooping();
            }

            else if (Paavalikko.mute == false)
            {
                btMute.BackgroundImage = Properties.Resources.off;
                peli.Stop();
            }

            //Lisätään oikean rivin pictureboxit taulukkoon
            oikeaRivi[0] = pbOikea1;
            oikeaRivi[1] = pbOikea2;
            oikeaRivi[2] = pbOikea3;
            oikeaRivi[3] = pbOikea4;

            //Lisätään värien pictureboxit taulukkoon
            varit[0] = pbKeltainen;
            varit[1] = pbOranssi;
            varit[2] = pbValkoinen;
            varit[3] = pbPunainen;
            varit[4] = pbSininen;
            varit[5] = pbTurkoosi;
            varit[6] = pbVihrea;
            varit[7] = pbVioletti;

            //Lisätään värien taulukosta listaan
            variLista = varit.ToList();

            //Lisätään rivit omaan taulukkoon
            Rivit[0, 0] = pb1R1;
            Rivit[0, 1] = pb2R1;
            Rivit[0, 2] = pb3R1;
            Rivit[0, 3] = pb4R1;
            Rivit[1, 0] = pb1R2;
            Rivit[1, 1] = pb2R2;
            Rivit[1, 2] = pb3R2;
            Rivit[1, 3] = pb4R2;
            Rivit[2, 0] = pb1R3;
            Rivit[2, 1] = pb2R3;
            Rivit[2, 2] = pb3R3;
            Rivit[2, 3] = pb4R3;
            Rivit[3, 0] = pb1R4;
            Rivit[3, 1] = pb2R4;
            Rivit[3, 2] = pb3R4;
            Rivit[3, 3] = pb4R4;
            Rivit[4, 0] = pb1R5;
            Rivit[4, 1] = pb2R5;
            Rivit[4, 2] = pb3R5;
            Rivit[4, 3] = pb4R5;
            Rivit[5, 0] = pb1R6;
            Rivit[5, 1] = pb2R6;
            Rivit[5, 2] = pb3R6;
            Rivit[5, 3] = pb4R6;
            Rivit[6, 0] = pb1R7;
            Rivit[6, 1] = pb2R7;
            Rivit[6, 2] = pb3R7;
            Rivit[6, 3] = pb4R7;
            Rivit[7, 0] = pb1R8;
            Rivit[7, 1] = pb2R8;
            Rivit[7, 2] = pb3R8;
            Rivit[7, 3] = pb4R8;
            Rivit[8, 0] = pb1R9;
            Rivit[8, 1] = pb2R9;
            Rivit[8, 2] = pb3R9;
            Rivit[8, 3] = pb4R9;
            Rivit[9, 0] = pb1R10;
            Rivit[9, 1] = pb2R10;
            Rivit[9, 2] = pb3R10;
            Rivit[9, 3] = pb4R10;

            //Lisätään kaikki tarkistus-pictureboxit taulukkoon
            Tarkistus[0, 0] = pbTark1R1;
            Tarkistus[0, 1] = pbTark2R1;
            Tarkistus[0, 2] = pbTark3R1;
            Tarkistus[0, 3] = pbTark4R1;
            Tarkistus[1, 0] = pbTark1R2;
            Tarkistus[1, 1] = pbTark2R2;
            Tarkistus[1, 2] = pbTark3R2;
            Tarkistus[1, 3] = pbTark4R2;
            Tarkistus[2, 0] = pbTark1R3;
            Tarkistus[2, 1] = pbTark2R3;
            Tarkistus[2, 2] = pbTark3R3;
            Tarkistus[2, 3] = pbTark4R3;
            Tarkistus[3, 0] = pbTark1R4;
            Tarkistus[3, 1] = pbTark2R4;
            Tarkistus[3, 2] = pbTark3R4;
            Tarkistus[3, 3] = pbTark4R4;
            Tarkistus[4, 0] = pbTark1R5;
            Tarkistus[4, 1] = pbTark2R5;
            Tarkistus[4, 2] = pbTark3R5;
            Tarkistus[4, 3] = pbTark4R5;
            Tarkistus[5, 0] = pbTark1R6;
            Tarkistus[5, 1] = pbTark2R6;
            Tarkistus[5, 2] = pbTark3R6;
            Tarkistus[5, 3] = pbTark4R6;
            Tarkistus[6, 0] = pbTark1R7;
            Tarkistus[6, 1] = pbTark2R7;
            Tarkistus[6, 2] = pbTark3R7;
            Tarkistus[6, 3] = pbTark4R7;
            Tarkistus[7, 0] = pbTark1R8;
            Tarkistus[7, 1] = pbTark2R8;
            Tarkistus[7, 2] = pbTark3R8;
            Tarkistus[7, 3] = pbTark4R8;
            Tarkistus[8, 0] = pbTark1R9;
            Tarkistus[8, 1] = pbTark2R9;
            Tarkistus[8, 2] = pbTark3R9;
            Tarkistus[8, 3] = pbTark4R9;
            Tarkistus[9, 0] = pbTark1R10;
            Tarkistus[9, 1] = pbTark2R10;
            Tarkistus[9, 2] = pbTark3R10;
            Tarkistus[9, 3] = pbTark4R10;
        }
Пример #3
0
 public Ohjeet(Kayttajavalikko kayttajavalikko)
 {
     InitializeComponent();
 }