Browse Source

do not clear the entire frame when paining the playground

master
Fr3deric 8 years ago committed by Frederic
parent
commit
0fc367f200
  1. 6
      ttrs.py

6
ttrs.py

@ -169,9 +169,9 @@ class Playground():
return True return True
def paint(self, frame, xpos, ypos): def paint(self, frame, xpos, ypos):
for x in range(frame.dimension.width): for x in range(self.width):
for y in range(frame.dimension.height): for y in range(self.height):
frame.setPixel(x, y, (0, 0, 0)) frame.setPixel(xpos + x, ypos + y, (0, 0, 0))
for b in set.union(self.blocks, *[ m.blocks for m in self.minos ]): for b in set.union(self.blocks, *[ m.blocks for m in self.minos ]):
frame.setPixel(xpos + int(b.pos.x), ypos + int(b.pos.y), b.color) frame.setPixel(xpos + int(b.pos.x), ypos + int(b.pos.y), b.color)

Loading…
Cancel
Save