0

I'm actually trying to make a game with Pygame. I was wondering if I could run an animation outside the main loop to make the animation easier. For example something like this :

On the main file :

while running:
    #draw the player
    pygame.display.update()
    pygame.time.Clock().tick(75)

On another file :

#draw an image during 1 second
#draw another image during 2 second

I tried to use multiprocessing but I've got a black screen at every try. I'm a beginner with programming so don't be too mean and sorry for my bad english.

  • IN most cases, all of your drawing must be done in the main thread. Multiprocessing clearly won't work; only the main process has access to the graphics screen. The better way is to design your main loop so that you are doing your timed tasks as part of the loop. – Tim Roberts Apr 19 '22 at 06:28

0 Answers0