import pygame
from pygame.sprite import Sprite
from pygame.sprite import Group
class Raindrop(Sprite):
def __init__(self, screen):
super().__init__()
...
...
def drop(self):
...
...
raindrops = Group()
...
raindrops.drop()
...
When I use this code, I end up with an error:
Traceback (most recent call last):
File "raindrops.py", line 74, in <module>
rain()
File "raindrops.py", line 71, in rain
update_raindrops.py(screen, raindrops)
Dile "raindrops.py", line 57, in update_raindrops
raindrops.drop()
AttributeError: 'Group' object has no attribute 'drop'
Why does this happen? When I was doing some very similar examples from a textbook, it would define a method for a subclass of Sprite, than make a Group list of sprites and then GroupList.ClassMethod() worked just fine. But not in this case, for some reason. I can provide the whole code, if you need.