python - Collision not working for pygame Sprites -
i'm trying make spaceship game python programming class, , want use sprite.spritecollideany check if player sprite spaceship colliding of asteroid sprites in spritegroup group, no matter do, doesn't seem work. here's code: import pygame import random pygame.init() screen = pygame.display.set_mode((600, 600)) pygame.display.set_caption("asteroids , spaceships") background = pygame.image.load("background.png") background = background.convert() white = 255,255,255 #first make asteroids class. class asteroids(pygame.sprite.sprite): def __init__(self, x, y): pygame.sprite.sprite.__init__(self) self.x = x self.y = y self.width = 30 self.height = 30 self.i1 = pygame.image.load("smallasteroid.png") self.i1 = self.i1.convert() self.i1.set_colorkey(white) self.rect = self.i1.get_rect() self.rect.left = x self.rect.top = y self.i2 = pygame.i...