Example #1
0
        public void createLvl(Form1 f1)
        {
            bonc  = 0;
            actb  = 0;
            pasb  = 0;
            timer = 0;
            for (int i = 0; i < 5; i++)
            {
                for (int t = 0; t < 9; t++)
                {
                    switch (matr[i, t])
                    {
                    case (char)49: ukb[i, t] = new Block(t, i, (char)49, this);
                        break;

                    case (char)50: ukb[i, t] = new BonBlock(t, i, (char)50, this);
                        bonc++;
                        break;
                    }
                }
            }
            bon   = new Bonus[bonc];
            platf = new Platform(268, 520, this);
            ball  = new Ball(288, 500, (float)0, (float)0, this);
            f1.controlKeyPressed += setC;
            f1.TimeTickUpdate    += refresh;
            SBlock(f1);
            status = 2;
        }
Example #2
0
        private void Redac_KeyPress(object sender, KeyPressEventArgs e) // нажатие клавиши
        {
            MovePoint(this);
            if (a < 5)
            {
                if (b < 9)
                {
                    matr[a, b] = e.KeyChar;
                    switch (e.KeyChar)
                    {
                    case (char)49: ukb[a, b] = new Block(b, a, (char)49, this); break;

                    case (char)50: ukb[a, b] = new BonBlock(b, a, (char)50, this); break;
                    }

                    b++;
                }
                else
                {
                    b = 0; a++;
                    if (a < 5)
                    {
                        matr[a, b] = e.KeyChar;
                        switch (e.KeyChar)
                        {
                        case (char)49: ukb[a, b] = new Block(b, a, (char)49, this); break;

                        case (char)50: ukb[a, b] = new BonBlock(b, a, (char)50, this); break;
                        }
                        b++;
                    }
                }
                if (SBlock != null)
                {
                    SBlock(this);
                }
            }
            if ((a == 4) && (b == 9))
            {
                textBox1.Enabled = true;
                button1.Enabled  = true;
            }
        }