Removed debug print and made some performance upgrades.

This commit is contained in:
The Wobbler 2024-02-25 21:52:57 +01:00
parent 24b6d0b94d
commit fe10689d7a

View file

@ -174,14 +174,13 @@ class FallingSand:
def spawn_sand(self, position): def spawn_sand(self, position):
x, y = position x, y = position
for ax in range(-4, 5): for ax in range(-8, 9):
for ay in range(-4, 5): for ay in range(-8, 9):
print(ax, ay)
bx, by = position bx, by = position
bx += ax bx += ax
by += ay 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))) self.falling_sand_particles.append(FallingSandParticle(self, (bx, by)))