Exemplo n.º 1
0
    def step(self):
        for thing in self.items.itervalues():
            thing.act()

        for pos, thing in self.items.iteritems():
            gridpy.plot(thing.color(), pos)

        gridpy.update()
Exemplo n.º 2
0
 def main_loop(self):
     while True:
         self.game.tick()
         #print "--- Game Matrix ---"
         #print self.game
         for cell, position in self.game.cells():  
             gridpy.plot(GUI.CELL_COLOR, position)
         gridpy.update()
         gridpy.clear()
Exemplo n.º 3
0
#gridpy.set_style(gridpy.NONE)

gridpy.title("A simple demo")
gridpy.show()

def cycle(list):
    while True:
        for item in list:
            yield item

rainbow = cycle([
    gridpy.CYAN,
    gridpy.YELLOW,
    gridpy.MAGENTA,
    gridpy.RED,
    gridpy.GREEN,
    gridpy.BLUE,
    gridpy.WHITE,
    gridpy.GREY,
])

while True:
    for c in xrange(gridpy.cols()):
        color = rainbow.next()
        for r in xrange(gridpy.rows()):
            location = (c, r)
            gridpy.plot(color, location)
            gridpy.update()
            gridpy.remove(location)
    #gridpy.clear()