def __init__(self, x, y, color, direction, speed, container, brain = None):
pygame.sprite.Sprite.__init__(self, container)
self.image = pygame.Surface((16,16), flags=pygame.SRCALPHA)
self.rect = self.image.get_rect()
basex = 423
if color==RED:
basex += 96
## Generate the sprite image from spritesheet
ssrect = pygame.Rect((basex,710,16,16))
global spritesheet
self.image.blit(spritesheet,(0,0),ssrect)
self.rect = self.image.get_rect()
self.rect.center = (x, y)
self.direction = direction
self.speed = speed
self.brain = brain
评论列表
文章目录