示例#1
0
 public bomba(Mapa mapa, int x, int y)
 {
     this.mapa = mapa;
     this.x    = x;
     this.y    = y;
     smer      = -1;
 }
示例#2
0
 public kanon(Mapa mapa, int x, int y)
 {
     this.mapa = mapa;
     this.x    = x;
     this.y    = y;
     smer      = 3;
 }
示例#3
0
 public duch(Mapa mapa, int x, int y)
 {
     this.mapa = mapa;
     this.x    = x;
     this.y    = y;
     smer      = mapa.rnd.Next(4);
 }
示例#4
0
 public int barva            = 1; //zivoty
 public Had(Mapa mapa, int kdex, int kdey)
 {
     this.mapa = mapa;
     this.x    = kdex;
     this.y    = kdey;
     smer      = -1;
 }
示例#5
0
 public ohnivaKoule(Mapa mapa, int x, int y)
 {
     this.mapa = mapa;
     this.x    = x;
     this.y    = y;
     smer      = 2;
 }
示例#6
0
 public Koule(Mapa mapa, int x, int y, int smer)
 {
     this.mapa = mapa;
     this.x    = x;
     this.y    = y;
     this.smer = smer;
 }
示例#7
0
 public BombPad(Mapa mapa, int x, int y)
 {
     this.mapa = mapa;
     this.x    = x;
     this.y    = y;
     smer      = 2; //pod sebe
 }
示例#8
0
 public ocas(Mapa mapa, PohyblivyPrvek otec, int x, int y)
 {
     this.mapa = mapa;
     this.x    = x;
     this.y    = y;
     mapa.VytvorOcas(x, y);
     this.otec = otec;
     mapa.PohyblivePrvky.Add(this);
 }
示例#9
0
        private void button1_Click(object sender, EventArgs e)
        {
            lvl = 1;
            g   = Graphics.FromImage(DrawArea);
            CteckaPokoju.CtecPokoju("MyTest2.txt", "mapaPokoju.png"); //vytvoří soubor z mapa0.2.png
            mapa = new Mapa(lvl, "dot.png", barva, pocetOcasu);



            pocetOcasu     = 4;
            barva          = 0;
            timer1.Enabled = true;
        }
示例#10
0
        private void timer1_Tick_1(object sender, EventArgs e)
        {
            switch (mapa.stav)
            {
            case Stav.nezacala:

                pictureBox1.Visible = true;
                button1.Visible     = true;
                stisknutaSipka      = StisknutaSipka.zadna;
                pictureBox2.Visible = false;

                break;


            case Stav.zacala:
                pictureBox2.Image = DrawArea;
                mapa.vykresliSe(g, ClientSize.Width, ClientSize.Height, 3);
                pictureBox2.Visible = true;
                pictureBox1.Visible = false;
                button1.Visible     = false;
                mapa.stav           = Stav.bezi;
                break;

            case Stav.bezi:
                tic++;

                timer1.Enabled = false;
                if (tic % 4 == 0)
                {
                    mapa.PohniVsemiPrvky(stisknutaSipka);
                }
                mapa.vykresliSe(g, ClientSize.Width, ClientSize.Height, tic % 4);
                if (mapa.stav != Stav.prohra)
                {
                    Refresh();
                }

                timer1.Enabled = true;


                this.Text = "skore   -    " + mapa.skore;
                break;

            case Stav.vyhra:
                timer1.Enabled = false;
                if (lvl < 6)
                {
                    lvl++;
                    pocetOcasu = mapa.had.pocetOcasu;
                    barva      = mapa.had.barva;
                    MessageBox.Show("pokračujete do úrovně: " + lvl);
                    celkoveSkore += mapa.skore;
                    label2.Text   = celkoveSkore.ToString();
                    mapa          = new Mapa(lvl, "dot.png", barva, pocetOcasu);
                    mapa.vykresliSe(g, ClientSize.Width, ClientSize.Height, 3);
                    mapa.stav      = Stav.bezi;
                    stisknutaSipka = StisknutaSipka.zadna;
                    timer1.Enabled = true;
                }
                else
                {
                    MessageBox.Show("Vyhra!");
                    mapa.stav      = Stav.nezacala;
                    timer1.Enabled = true;
                }

                break;

            case Stav.prohra:
                timer1.Enabled = false;
                celkoveSkore  += mapa.skore;
                label2.Text    = celkoveSkore.ToString();
                mapa.vykresliSe(g, ClientSize.Width, ClientSize.Height, 3);
                Refresh();
                MessageBox.Show("Prohra!");

                mapa.stav      = Stav.nezacala;
                timer1.Enabled = true;
                break;

            default:
                break;
            }
        }
示例#11
0
 public Klic(Mapa mapa, int kdex, int kdey)
 {
     this.mapa = mapa;
     this.x    = kdex;
     this.y    = kdey;
 }
示例#12
0
 public Diamant(Mapa mapa, int kdex, int kdey)
 {
     this.mapa = mapa;
     this.x    = kdex;
     this.y    = kdey;
 }
示例#13
0
 public armor(Mapa mapa, int kdex, int kdey)
 {
     this.mapa = mapa;
     this.x    = kdex;
     this.y    = kdey;
 }
示例#14
0
 public Jablko(Mapa mapa, int kdex, int kdey)
 {
     this.mapa = mapa;
     this.x    = kdex;
     this.y    = kdey;
 }
示例#15
0
 public OdpalPlosina(Mapa mapa, int kdex, int kdey)
 {
     this.mapa = mapa;
     this.x    = kdex;
     this.y    = kdey;
 }
示例#16
0
 public ohen(Mapa mapa, int x, int y)
 {
     this.mapa = mapa;
     this.x    = x;
     this.y    = y;
 }