OmerKSonmez / ISP-Project

0 stars 0 forks source link

Task: Random Brick Generation #32

Closed OmerKSonmez closed 8 months ago

OmerKSonmez commented 8 months ago

Each new game attempt spawns in different, randomly generated, set of bricks with different colors.

OmerKSonmez commented 8 months ago

21

maxwellwys commented 7 months ago

Create bricks with equally distributed colors

colors = [RED, BLUE, WHITE] bricks = [] for row in range(5): for col in range(WIDTH // BRICK_WIDTH): brick_color = random.choice(colors) brick = pygame.Rect(col BRICK_WIDTH, row BRICK_HEIGHT, BRICK_WIDTH, BRICK_HEIGHT) bricks.append((brick, brick_color))

See brickBreakerGame.py main branch