From a0ba20f754146e02508bc40503eb9c093f0db3ad Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 10 Sep 2016 23:55:12 +0200 Subject: [PATCH] Fix ordering of rays --- tabakrolletjie/rays.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tabakrolletjie/rays.py b/tabakrolletjie/rays.py index 7d880d0..ac51802 100644 --- a/tabakrolletjie/rays.py +++ b/tabakrolletjie/rays.py @@ -18,13 +18,13 @@ def screen_rays(pos, bounding_radius): """ r = int(bounding_radius) left, right = int(pos.x) - r, int(pos.x) + r - bottom, top = int(pos.y) + r, int(pos.y) - r + bottom, top = int(pos.y) - r, int(pos.y) + r step = 1 - for y in range(top, bottom + 1, step): + for y in range(bottom, top + 1, step): yield pymunk.Vec2d(left, y) for x in range(left, right + 1, step): yield pymunk.Vec2d(x, top) - for y in range(bottom, top - 1, -step): + for y in range(top, bottom - 1, -step): yield pymunk.Vec2d(right, y) for x in range(right, left - 1, -step): yield pymunk.Vec2d(x, bottom) -- 2.34.1