diff options
author | Florian Jung <flo@windfisch.org> | 2015-08-08 05:16:51 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2015-08-08 05:16:51 +0200 |
commit | 36623c66c215dc4ef7fc7d6707cba5b3858b9bb9 (patch) | |
tree | 93126d531d5ee7d79b040f8be0c84765004dd97c /test.py | |
parent | 4c7c9ae495fdf7b8f06a0be2daa9a322bb2b390c (diff) |
what the actual fuck?! border works now, no idea why
Diffstat (limited to 'test.py')
-rw-r--r-- | test.py | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -194,7 +194,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) |