def render(self, renderer): original_color = self.blend_color(self.color) renderer.rect(self, blend(7 / 8, self.game.background, original_color)) x = self.x y = 0 for j in range(2): color = blend(1 / (j + 2), original_color, self.game.background) radius = random.randint(5, 15) for i in range(5): next_x = random.randint(int(self.min.x + radius), int(self.max.x - radius)) if i == 4: next_x = self.x renderer.polygon( ((next_x - radius, y + self.height / 5), (next_x, y + self.height / 5), (x, y), (x - radius, y)), color=color) x = next_x y += self.height / 5
def render(self, renderer): original_color = self.blend_color(self.color) renderer.rect(self, blend(7 / 8, self.game.background, original_color)) x = 0 y = self.y for j in range(2): color = blend(1 / (j + 2), original_color, self.game.background) radius = random.randint(5, 15) for i in range(5): next_y = random.randint(int(self.min.y + radius), int(self.max.y - radius)) if i == 4: next_y = self.y renderer.polygon( ((x + self.width / 5, next_y - radius), (x + self.width / 5, next_y), (x, y), (x, y - radius)), color=color) x += self.width / 5 y = next_y
def render(self, renderer): fade_rate = self.fade_tick / 30 renderer.rect(self, blend(fade_rate, self.game.background, self.color)) renderer.polygon( ((self.x + 10, self.y + -20), (self.x + 10, self.y + -10), (self.x + 20, self.y + -10), (self.x + 20, self.y + 10), (self.x + 10, self.y + 10), (self.x + 10, self.y + 20), (self.x + -10, self.y + 20), (self.x + -10, self.y + 10), (self.x + -20, self.y + 10), (self.x + -20, self.y + -10), (self.x + -10, self.y + -10), (self.x + -10, self.y + -20)), blend(fade_rate, self.game.background, self.color_front))
def blend_color(self, color): return blend(self.fade_tick / 30, self.game.background, color)
def blend_color(self, color): blend_rate = self.fade_tick / self.max_fade_tick return blend(blend_rate, color, self.background)