Ejemplo n.º 1
0
 private void Level1_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (char.ToUpper(e.KeyChar) == (char)Keys.D)
     {
         character.HoditRight(barriersArray, bonus, timer1, timer2, RandBonus, Bot);
     }
     else
     {
         if (char.ToUpper(e.KeyChar) == (char)Keys.A)
         {
             character.HoditLeft(barriersArray, bonus, timer1, timer2, RandBonus, Bot);
         }
         else
         {
             if (char.ToUpper(e.KeyChar) == (char)Keys.W)
             {
                 character.HoditUp(barriersArray, bonus, timer1, timer2, RandBonus, Bot);
             }
             else
             {
                 if (char.ToUpper(e.KeyChar) == (char)Keys.S)
                 {
                     character.HoditDown(barriersArray, bonus, timer1, timer2, RandBonus, Bot);
                 }
             }
         }
     }
     if (character.row == pictureBoxes.GetLength(0) - 1 && character.col == pictureBoxes.GetLength(1) - 1)
     {
         MessageBox.Show("Поздровляю вы прошли уровень!!!");
         Level2 level2 = new Level2();
         level2.Show();
         this.Hide();
     }
 }
Ejemplo n.º 2
0
        private void Level2Button_Click(object sender, EventArgs e)
        {
            Level2 level2 = new Level2();

            level2.Show();
            this.Hide();
        }