Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. def checkWallsBetween(p1, p2):
  2. wall = True
  3. step = 1
  4. if int(p1.x) == int(p2.x):
  5. if p1.y > p2.y:
  6. step = -1
  7. for y in range(int(p1.y), int(p2.y), step):
  8. x = get_x_straight(y, p1, p2)
  9. if (game.level.tiles[int(x)][int(y)] == model.Tile.WALL):
  10. wall = False
  11. else:
  12. if p1.x > p2.x:
  13. step = -1
  14. for x in range(int(p1.x), int(p2.x), step):
  15. y = get_y_straight(x, p1, p2)
  16. if (game.level.tiles[int(x)][int(y)] == model.Tile.WALL):
  17. wall = False
  18. return wall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement