[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.
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Ok another question from me - Python Classes and Pygame is pretty hard to understand.
- From: "Lamonte Harris" <pyth0nc0d3r@xxxxxxxxx>
- Date: Fri, 31 Aug 2007 16:52:29 -0500
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Fri, 31 Aug 2007 17:52:37 -0400
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=EAJ/UsQ5jtencT98ZbHKXYN5pEHqF9WNp8H6732jaR0prardoUZB7gyGvbEBWS4dsjfiCRF/e1HcrXr7kkCc0VmKR/crsDTMunwd0WxuVMPn75w2rSKoI3Tk3leQFAt1nkXcop9GKwprTgEcuuYILdlOpwXoeSu5vM1c2h1vHJ8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=KZfGdCIx02j1Rn8FI2cBkDiheIlfrSpz3fKzvhecPdmascd95Qwbps96fHhEr+FKTrtPGrW30XrxzcQpgrO/z/jhgBXeiShlSKVdjVL3kE13RSPm+BaYJLXgjpYv+WZH7cFGdfVVZihX4jBbu4cmS4bwqCBrwrH7ZETDV8Bw7HE=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
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?