예제 #1
0
def func():
    clock = pygame.time.Clock()
    running = True
    ani = TimedAnimation([0.2, 0.2, 0.2, 0.2])
    ani.loadFromDir(os.path.join("noise2/"))
    while running:
        dt = clock.tick(30)/1000.
        screen.fill((255, 0, 0))
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                running = False
        image = ani.next(dt)
        for y in range(0, 480, 64):
            for x in range(0, 640, 64):
                screen.blit(image, (x, y))
        pygame.display.update()
예제 #2
0
i = -1
# v-----------------------------------------------------------------v
# ^-----------------------------------------------------------------^
clock = pygame.time.Clock()
Truth = True
time = 0.0
tm = 0.0
x = 50
while Truth:
    dt = clock.tick(30) / 1000.0
    time += dt
    tm += dt
    screen.fill((0, 0, 0))
    redsurf.fill((0, 0, 0, 0))
    yy = -size[1] + (size[1] * time) / secs
    if yy > 0:
        yy = -size[1]
        time = 0.0
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            Truth = False
    image = ani.next(dt).convert_alpha()
    for y in range(0, 600, 64):
        for x in range(0, 800, 64):
            redsurf.blit(image, (x, y))
    screen.blit(whitesurf, (100, 100))
    screen.blit(redsurf, (0, yy))
    pygame.display.update()
pygame.quit()
quit()