How to create timers in pygame efficiently?
How to create timers in pygame efficiently? Question: I want to spawn an enemy every (some number) seconds, say 5. I could do: start_time = pygame.time.get_ticks() if pygame.time.get_ticks() – start_time >= (some number): spawn_enemy() But there’s one problem with that: when I change the FPS (clock.tick()) from 120 to say 60 then the enemy spawn …