Advertisement
afterlife88

Untitled

Mar 26th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 KB | None | 0 0
  1.             while (true)
  2.             {
  3.                 var num = _random.Next(100);
  4.                 BombSet = false;
  5.  
  6.                 if (num <= 24)
  7.                 {
  8.                     if (this.Movable(this.X - 1, this.Y))
  9.                     {
  10.                         state = GetDownKeyboardState(Keys.LEFT);
  11.                     }
  12.                     else
  13.                         state = GetDownKeyboardState(Keys.RIGHT);
  14.                 }
  15.                 if (num > 24 && num <= 48)
  16.                 {
  17.                     if (this.Movable(this.X, this.Y - 1))
  18.                     {
  19.                         state = GetDownKeyboardState(Keys.UP);
  20.                     }
  21.                     else
  22.                         state = GetDownKeyboardState(Keys.DOWN);
  23.                 }
  24.                 if (num > 48 && num <= 72)
  25.                 {
  26.                     if (this.Movable(this.X + 1, this.Y))
  27.                     {
  28.                         state = GetDownKeyboardState(Keys.RIGHT);
  29.                     }
  30.                     else
  31.                         state = GetDownKeyboardState(Keys.LEFT);
  32.                 }
  33.                 if (num > 72 && num <= 96)
  34.                 {
  35.                     if (this.Movable(this.X, this.Y + 1))
  36.                     {
  37.                         state = GetDownKeyboardState(Keys.DOWN);
  38.                     }
  39.                     else
  40.                         state = GetDownKeyboardState(Keys.UP);
  41.  
  42.                 }
  43.                 if (num > 96 && num <= 100)
  44.                 {
  45.                     state = GetDownKeyboardState(Keys.SPACE);
  46.                     BombSet = true;
  47.                 }
  48.                 for (int i = 0; i < ConstantValues.CountToMoveOnActualPosition; i++)
  49.                 {
  50.                     yield return state;
  51.                 }
  52.             }
  53.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement