Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (true)
- {
- var num = _random.Next(100);
- BombSet = false;
- if (num <= 24)
- {
- if (this.Movable(this.X - 1, this.Y))
- {
- state = GetDownKeyboardState(Keys.LEFT);
- }
- else
- state = GetDownKeyboardState(Keys.RIGHT);
- }
- if (num > 24 && num <= 48)
- {
- if (this.Movable(this.X, this.Y - 1))
- {
- state = GetDownKeyboardState(Keys.UP);
- }
- else
- state = GetDownKeyboardState(Keys.DOWN);
- }
- if (num > 48 && num <= 72)
- {
- if (this.Movable(this.X + 1, this.Y))
- {
- state = GetDownKeyboardState(Keys.RIGHT);
- }
- else
- state = GetDownKeyboardState(Keys.LEFT);
- }
- if (num > 72 && num <= 96)
- {
- if (this.Movable(this.X, this.Y + 1))
- {
- state = GetDownKeyboardState(Keys.DOWN);
- }
- else
- state = GetDownKeyboardState(Keys.UP);
- }
- if (num > 96 && num <= 100)
- {
- state = GetDownKeyboardState(Keys.SPACE);
- BombSet = true;
- }
- for (int i = 0; i < ConstantValues.CountToMoveOnActualPosition; i++)
- {
- yield return state;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement