summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test.py')
-rw-r--r--test.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/test.py b/test.py
index e030e87..0a4151a 100644
--- a/test.py
+++ b/test.py
@@ -199,7 +199,17 @@ while True:
c.on_message()
- gfxdraw.rectangle(screen, (c.world.top_left, c.world.bottom_right), (0,0,0));
+
+ top = int((c.world.top_left[0] - c.player.center[1])*zoom + screensize[1]/2)
+ left = int((c.world.top_left[1] - c.player.center[0])*zoom + screensize[0]/2)
+ bottom = int((c.world.bottom_right[0] - c.player.center[1])*zoom + screensize[1]/2)
+ right = int((c.world.bottom_right[1] - c.player.center[0])*zoom + screensize[0]/2)
+
+ print ((top,bottom,left,right))
+ if (top >= 0): gfxdraw.hline(screen, 0, screensize[0], top, (0,0,0))
+ if (bottom <= screensize[1]): gfxdraw.hline(screen, 0, screensize[0], bottom, (0,0,0))
+ if (left >= 0): gfxdraw.vline(screen, left, 0, screensize[1], (0,0,0))
+ if (right <= screensize[0]): gfxdraw.vline(screen, right, 0, screensize[1], (0,0,0))
for cell in c.world.cells.values():
drawCell(cell)