Why doesn't this play my click.wav every 444ms? it just seems to play it at random intervals.
import pygame
pygame.init()
size = (700, 500)
screen = pygame.display.set_mode(size)
pygame.display.set_caption("444ms click")
done = False
clock = pygame.time.Clock()
noise = pygame.mixer.Sound("click.wav")
pygame.time.set_timer(1, 444)
while not done:
for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True
if event.type == 1:
noise.play()
clock.tick(60)
pygame.quit()
and if anyone knows how I could do this more easily that would be good.
Thank You!
@JFSebeastian: Here's the output for the code:
447
436
443
430
449
431
448
432
910
7
407
447
442
432
446
431
448
432
450
432
446
472
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…