def draw(self, degrade_alpha): if len(self.p_list1) > 1 and len(self.p_list2) > 1 and len( self.p_list3) > 1: self.surface.fill(BLACK) self.init_color_length -= 1 p_list1 = CAMERA.apply_points(self.p_list1) p_list2 = CAMERA.apply_points(self.p_list2) p_list3 = CAMERA.apply_points(self.p_list3) if self.init_color_length < 0: pygame.draw.aalines(self.surface, (self.color1), False, p_list1, 1) pygame.draw.aalines(self.surface, (self.color2), False, p_list2, 1) pygame.draw.aalines(self.surface, (self.color3), False, p_list3, 1) else: pygame.draw.aalines(self.surface, (self.init_color), False, p_list1, 1) pygame.draw.aalines(self.surface, (self.init_color), False, p_list2, 1) pygame.draw.aalines(self.surface, (self.init_color), False, p_list3, 1) self.surface.set_alpha(self.alpha) if degrade_alpha: self.alpha -= ALPHA_RATE SCREEN.blit(self.surface, (0, 0))
def move(self): self.rect.centerx = self.pos.x self.rect.centery = self.pos.y CAMERA.update(self) offset = CAMERA.apply(self.rect) self.rect.x = offset.x self.rect.y = offset.y self.dirty = 1
def move(self): self.rect.centerx = self.pos.x self.rect.centery = self.pos.y # if self.name == "Bullet.png": # CAMERA.update(self) offset = CAMERA.apply(self.rect) self.rect.x = offset.x self.rect.y = offset.y # if self.name != "Bullet.png": # self.dirty = 1 self.dirty = 1
def draw(self, degrade_alpha): if len(self.p_list1) > 1 and len(self.p_list2) > 1 and len(self.p_list3) > 1: self.surface.fill(BLACK) self.init_color_length -= 1 p_list1 = CAMERA.apply_points(self.p_list1) p_list2 = CAMERA.apply_points(self.p_list2) p_list3 = CAMERA.apply_points(self.p_list3) if self.init_color_length < 0: pygame.draw.aalines(self.surface, (self.color1), False, p_list1, 1) pygame.draw.aalines(self.surface, (self.color2), False, p_list2, 1) pygame.draw.aalines(self.surface, (self.color3), False, p_list3, 1) else: pygame.draw.aalines(self.surface, (self.init_color), False, p_list1, 1) pygame.draw.aalines(self.surface, (self.init_color), False, p_list2, 1) pygame.draw.aalines(self.surface, (self.init_color), False, p_list3, 1) self.surface.set_alpha(self.alpha) if degrade_alpha: self.alpha -= ALPHA_RATE SCREEN.blit(self.surface, (0, 0))
def move(self): self.rect.centerx, self.rect.centery = self.pos.x, self.pos.y offset = CAMERA.apply(self.rect) self.dirty = 1 self.rect.x, self.rect.y = offset.x, offset.y