def __init__(self, avr, dev, vcd, timeout=None, visible=1, speed=1, fps=20, scrshot_by_exit=None): log.debug('visible=%s timeout=%s speed=%s' % (visible, timeout, speed)) self.avr = avr self.vcd = vcd self.speed = speed self.timeout = timeout MainGame.__init__(self, dev, fps=fps, visible=visible, scrshot_by_exit=scrshot_by_exit)
def start(): def func(x): return [ (255, 0), (0, 0), (255, 33), (7, 0), ][x] dev = Sgm7Game(func, 4) MainGame(dev).run_game()
def start(): def func_on(): return (1, 0) def func_off(): return (0, 0) def func_pulse(): return (1, 1) dev1 = LedGame(func_on, 'on') dev2 = LedGame(func_off, 'off') dev3 = LedGame(func_pulse, 'pulse') dev = CompositeGame([dev1, dev2, dev3]) MainGame(dev).run_game()
def run_game(self): if self.vcd: self.vcd.start() MainGame.run_game(self)
def start(): def func(i): return (i > 1, i > 2) dev = LedRowGame(func, disp_size=4, labels=['x', 'y', 'z']) MainGame(dev).run_game()
def start(): def char_func(x, y): return chr(ord('a') + x + y) lcd = LcdGame(char_func, (11, 4)) MainGame(lcd).run_game()