actually fix the bug
This commit is contained in:
parent
f3e26fbfc7
commit
65b97a1d53
12
render.py
12
render.py
|
@ -21,6 +21,13 @@ class Renderer:
|
||||||
if i.ttype == "standard":
|
if i.ttype == "standard":
|
||||||
i.update(self.tiles)
|
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):
|
def selectForRendering(self):
|
||||||
"""
|
"""
|
||||||
Returns what tiles are in the viewport.
|
Returns what tiles are in the viewport.
|
||||||
|
@ -45,9 +52,8 @@ class Renderer:
|
||||||
|
|
||||||
return tilesInScene
|
return tilesInScene
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
def render(self):
|
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()
|
toRender = self.selectForRendering()
|
||||||
|
|
||||||
|
@ -70,5 +76,3 @@ class Renderer:
|
||||||
buf.append(rendered[j][i])
|
buf.append(rendered[j][i])
|
||||||
print(''.join(buf))
|
print(''.join(buf))
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> parent of 34d7984 (demo under construction)
|
|
||||||
|
|
Loading…
Reference in New Issue