Ejemplo n.º 1
0
def main():
    pygame.init()
    pygame.font.init()
    screen = pygame.display.set_mode(DISPLAY, FLAGS, DEPTH)
    pygame.display.set_caption("Use arrows to move!")
    timer = pygame.time.Clock()

    up = down = left = right = running = False
    bg = Surface((16,16))
    bg.convert()
    bg.fill(Color("#FFFFFF"))
    entities = pygame.sprite.Group()

    x = y = 0
    start_level = Level(30, 30)
    controls = Controls(start_level)

    while 1:
        timer.tick(60)
        for e in pygame.event.get():
            if e.type == QUIT: raise SystemExit, "QUIT"
            controls.process_event(e)
        start_level.update(screen)
        pygame.display.update()