def render(self, strike): if self.solved: return self.get_image('#0f0'), 'render.png' led = '#f00' if strike else '#fff' if self.cycle is None: return self.get_image('#f00' if strike else '#fff'), 'render.png' with Image() as im: for column in self.cycle: first = True for _ in range(6): modules.gif_append(im, self.get_image(led), 200 if first else 100) first = False self.positions[column] = (self.positions[column] + 1) % 6 return modules.gif_output(im)
def add(frame, units): modules.gif_append(im, frame, units * DOT_LENGTH)
def add(color, delay): modules.gif_append(im, SimonSays.get_image(color, led), delay)