Example #1
0
 private void Timer1_Tick(object sender, EventArgs e)
 {
     ///colision
     right = B.Testr(player, right);
     left  = B.Testl(player, left);
     up    = B.Testt(player, up);
     down  = B.Testb(player, down);
     ///moving
     if (right == true)
     {
         player.Left += 3;
     }
     if (left == true)
     {
         player.Left -= 3;
     }
     if (up == true)
     {
         player.Top -= 3;
     }
     if (down == true)
     {
         player.Top += 3;
     }
 }
Example #2
0
 private void Timer1_Tick(object sender, EventArgs e)
 {
     if (right == true && index == 1)
     {
         player.Image = Properties.Resources.PlayerR;
     }
     if (left == true && index == 1)
     {
         player.Image = Properties.Resources.PlayerL;
     }
     if (up == true && index == 1)
     {
         player.Image = Properties.Resources.PlayerU;
     }
     if (down == true && index == 1)
     {
         player.Image = Properties.Resources.PlayerD;
     }
     if (down == false && up == false && left == false && right == false && index == 0)
     {
         player.Image = Properties.Resources.PlayerS;
     }
     ///colision plansza
     right = B.Testr(player, right);
     left  = B.Testl(player, left);
     up    = B.Testt(player, up);
     down  = B.Testb(player, down);
     ///moving
     if (right == true)
     {
         player.Left += 3;
     }
     if (left == true)
     {
         player.Left -= 3;
     }
     if (up == true)
     {
         player.Top -= 3;
     }
     if (down == true)
     {
         player.Top += 3;
     }
 }