actually fix the bug

This commit is contained in:
randomuser 2022-04-28 13:55:29 -05:00
parent f3e26fbfc7
commit 65b97a1d53
1 changed files with 8 additions and 4 deletions

View File

@ -21,6 +21,13 @@ class Renderer:
if i.ttype == "standard":
i.update(self.tiles)
def inViewport(self, pos):
if pos[0] < 0 or pos[0] > self.viewport[0] - 1:
return False
if pos[1] < 0 or pos[1] > self.viewport[1] - 1:
return False
return True
def selectForRendering(self):
"""
Returns what tiles are in the viewport.
@ -45,9 +52,8 @@ class Renderer:
return tilesInScene
<<<<<<< HEAD
def render(self):
board = [["." for i in range(24)] for i in range(80)]
board = [["." for i in range(self.viewport[1])] for i in range(self.viewport[0])]
toRender = self.selectForRendering()
@ -70,5 +76,3 @@ class Renderer:
buf.append(rendered[j][i])
print(''.join(buf))
=======
>>>>>>> parent of 34d7984 (demo under construction)