Sep-20-2018, 03:34 PM
Having a hard time figuring out how to make timeloops.
The goal is having a text flicker on screen every even number of seconds (2,4,6 etc..)
This is the code i have so far:
I tried also setting time.sleep(1) after the loop, not working and even if so it kinda ruins the other code.
* Text is appearing on screen, and blit deletes everything off the screen EXCEPT "Keys".
Help will be much appreciated :)
The goal is having a text flicker on screen every even number of seconds (2,4,6 etc..)
This is the code i have so far:
intro = True x = time.time() while intro: y = int(time.time() - x) if y % 2 == 0: message_to_screen(font2,"Keys",white,(width/4,height/2)) else: x = time.time() win.blit(background,(0,0))The problem is that the screen is just freezing when running this.
I tried also setting time.sleep(1) after the loop, not working and even if so it kinda ruins the other code.
* Text is appearing on screen, and blit deletes everything off the screen EXCEPT "Keys".
Help will be much appreciated :)