Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def checkWallsBetween(p1, p2):
- wall = True
- step = 1
- if int(p1.x) == int(p2.x):
- if p1.y > p2.y:
- step = -1
- for y in range(int(p1.y), int(p2.y), step):
- x = get_x_straight(y, p1, p2)
- if (game.level.tiles[int(x)][int(y)] == model.Tile.WALL):
- wall = False
- else:
- if p1.x > p2.x:
- step = -1
- for x in range(int(p1.x), int(p2.x), step):
- y = get_y_straight(x, p1, p2)
- if (game.level.tiles[int(x)][int(y)] == model.Tile.WALL):
- wall = False
- return wall
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement