feat(game): generate new block after move

This commit is contained in:
Kristofers Solo 2023-12-27 23:36:30 +02:00
parent e45e6b16b3
commit 7fc9e0b644

View File

@ -60,8 +60,9 @@ class Game:
self.sprites.remove(other_block) self.sprites.remove(other_block)
moved_blocks.add(block) moved_blocks.add(block)
self.update() self.update()
self.generate_random_block()
def generate_random_block(self, count: int) -> None: def generate_random_block(self, count: int = 1) -> None:
for _ in range(count): for _ in range(count):
while True: while True:
x = random.randint(0, 2) * Config.BLOCK_SIZE # random column position x = random.randint(0, 2) * Config.BLOCK_SIZE # random column position