Removed debug print and made some performance upgrades.
This commit is contained in:
parent
24b6d0b94d
commit
fe10689d7a
1 changed files with 3 additions and 4 deletions
|
@ -174,14 +174,13 @@ class FallingSand:
|
|||
def spawn_sand(self, position):
|
||||
x, y = position
|
||||
|
||||
for ax in range(-4, 5):
|
||||
for ay in range(-4, 5):
|
||||
print(ax, ay)
|
||||
for ax in range(-8, 9):
|
||||
for ay in range(-8, 9):
|
||||
bx, by = position
|
||||
bx += ax
|
||||
by += ay
|
||||
|
||||
if self.matrix[bx, by] == self.sand_surface.map_rgb(self.gray):
|
||||
if self.matrix[bx, by] == self.sand_surface.map_rgb(self.gray) and bx % 2 == 0 and by % 2 == 0:
|
||||
self.falling_sand_particles.append(FallingSandParticle(self, (bx, by)))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue