Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private DirectionsKeys CheckBomb()
- {
- foreach (var bomb in MapLoader.MapInstance.ListOfBombs)
- {
- var ourPosition = new Point(this.X, this.Y);
- var dangerPoints = bomb.GetDangerPoints();
- dangerPoints.Add(bomb.Location);
- if (dangerPoints.Contains(ourPosition))
- {
- if (ourPosition.X >= bomb.Location.X)
- {
- return DirectionsKeys.RIGHT;
- }
- else
- {
- return DirectionsKeys.LEFT;
- }
- if (ourPosition.Y >= bomb.Location.Y)
- {
- return DirectionsKeys.UP;
- }
- else
- {
- return DirectionsKeys.DOWN;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement