Advertisement
afterlife88

Untitled

Mar 27th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1.         private DirectionsKeys CheckBomb()
  2.         {
  3.            
  4.             foreach (var bomb in MapLoader.MapInstance.ListOfBombs)
  5.             {
  6.                 var ourPosition = new Point(this.X, this.Y);
  7.                 var dangerPoints = bomb.GetDangerPoints();
  8.                 dangerPoints.Add(bomb.Location);
  9.                 if (dangerPoints.Contains(ourPosition))
  10.                 {
  11.                     if (ourPosition.X >= bomb.Location.X)
  12.                     {
  13.                         return DirectionsKeys.RIGHT;
  14.                     }
  15.                     else
  16.                     {
  17.                         return DirectionsKeys.LEFT;
  18.  
  19.                     }
  20.                     if (ourPosition.Y >= bomb.Location.Y)
  21.                     {
  22.                         return DirectionsKeys.UP;
  23.  
  24.                     }
  25.                     else
  26.                     {
  27.                         return DirectionsKeys.DOWN;
  28.  
  29.                     }
  30.  
  31.                 }
  32.                
  33.             }
  34.            
  35.  
  36.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement