[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Ok another question from me - Python Classes and Pygame is pretty hard to understand.



Whats the best method to understand how to use classes w/ pygame code.  I seen some complex stuff like:
class Fist(pygame.sprite.Sprite):
"""moves a clenched fist on the screen, following the mouse"""
def __init__(self):
pygame.sprite.Sprite.__init__(self) #call Sprite initializer
Thats pretty hard to understand imho[snippet from the Chip Game]  Can someone explain how the sprites work.  Quick question:

class First(pygame.sprite.Sprite):

does that inherit that sprite class?  then what does the __init__ do?