コード例 #1
0
ファイル: entity_test.py プロジェクト: andipanic/canvas
def main():
    """Set up a screen for a good entity named a
    to walk around randomly on.  Until we tell him
    what moves are valid (because we have electro-
    shock boarders on right now (and always)) 
    he will die always!"""
    c = Canvas()
    a = Entity(15,15,c)

    c.start()
    screen = c()
    for i in range(10000):
        a.move()
        screen.addch(a.y,a.x,a.char())
        screen.refresh()
        if c is ord('q'):
            c.stop()