Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
364 B
1
Indexable
Never
class Snow(pygame.sprite.Sprite):
def __init__(self):
super().__init__(all_sprites)
self.image = pygame.Surface((2, 2), pygame.SRCALPHA, 32)
self.image.fill((250, 250, 250))
self.rect = pygame.Rect(random.randrange(0, screen_width), 0, 2, 2)

def update(self):
self.rect = all_sprites.remove(self) if self.rect.y > screen_height else self.rect.move(0, 1)