I'm trying to perform something for 4 seconds. How would that work?
yes = True
while True:
if yes:
print('yes')
if [4 seconds pass]:
yes = False
elif not yes:
print('No')
I tried
seconds = pygame.time.get_ticks()
yes = input('True or False: ')
while True:
if yes:
print('yes')
time = int((pygame.time.get_ticks - seconds)/ 1000)
if time == 4:
yes = False
elif not yes:
print('no')
But it didn't work