def __init__(self, x, y, dx, dy): super(Bullet,self).__init__() self.x, self.y, self.dx, self.dy = x, y, dx, dy self.image = pygame.Surface((10,10)) self.rect = pygame.Rect(x-5,y-5,10,10) self.image.fill((0,0,0)) self.buff = SubPixelSurface(self.image)
def __init__(self, x, y, dx, dy): super(BasicBaddie,self).__init__() self.image = pygame.Surface((30,30)) self.image.fill((0,0,255)) self.rect = self.image.get_rect() self.buff = SubPixelSurface(self.image) self.x, self.y, self.dx, self.dy = x, y, dx, dy self.rect.topleft = (x, y)
def __init__(self): super(Player,self).__init__() self.image = pygame.Surface((40,40)) self.rect = self.image.get_rect() self.image.fill((255,255,255)) pygame.draw.circle(self.image, (255,0,0), (20,20), 20) self.buff = SubPixelSurface(self.image) self.firerate = 7 self.timer = 0 self.bulletspeed = 12