Python跳动的爱心代码
class Heart: def __init__(self, generate_frame=20): self._points = set() #原始爱心坐标集合self._edge_diffusion_points = set() #边缘扩散效果点坐标集合self._center_diffusion_points = set() #中心扩散效果点坐标集合self.all_points = {} #每帧动态点坐标self.build(2000) self.random_halo = 1000 self.generate_frame = generate_frame for frame in range(generate_frame): self.calc(frame) def build(self, number): for _ in range(number):
用户评论