[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] basketball trouble



My friend is making a basketball program.  He is
having trouble getting started as he is new to pygame.
The code is based on examples obtained from the aliens
and chimp examples but with modifications.  The
trouble so far is that the basketball that is supposed
to be shot at the hoop after the space bar is pressed
does not appear. Please Help! He's been stuck on this
for five straight days.  

Here is where he thinks the problem is:
    
class Ball(pygame.sprite.Sprite):
    images = []
    def __init__(self, pos):
        pygame.sprite.Sprite.__init__(self) 
        self.image = self.images[0]
        self.rect = self.image.get_rect()
        
    def update(self):
        self.rect.move_ip(3, 7)
        if self.rect.top <= 0:
            self.kill()
------------------------------------------------------
for event in pygame.event.get():
    keystate = pygame.key.get_pressed()
    allsprites.update()
    ball2 = keystate[K_SPACE]
    if event.type is ball2:
        shot = Ball(pygame.mouse.get_pos())



__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org