Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
def start():
    def func(x):
        return [
            (255, 0),
            (0, 0),
            (255, 33),
            (7, 0),
        ][x]
    dev = Sgm7Game(func, 4)
    MainGame(dev).run_game()
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
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()
Exemplo n.º 5
0
 def run_game(self):
     if self.vcd:
         self.vcd.start()
     MainGame.run_game(self)
Exemplo n.º 6
0
 def run_game(self):
     if self.vcd:
         self.vcd.start()
     MainGame.run_game(self)
Exemplo n.º 7
0
def start():
    def func(i):
        return (i > 1, i > 2)

    dev = LedRowGame(func, disp_size=4, labels=['x', 'y', 'z'])
    MainGame(dev).run_game()
Exemplo n.º 8
0
def start():
    def char_func(x, y):
        return chr(ord('a') + x + y)

    lcd = LcdGame(char_func, (11, 4))
    MainGame(lcd).run_game()