The pygame window is not responding after a put a loop in the game loop

After I wrote this code the program was not responding:

level_1 = True
while level_1:
    screen.blit(smallspaceship1, [960, 300])

This is my repl link: https://replit.com/@TasosKhatzes/Space-game-2?v=1

the loop runs infinitely so it doesn’t get to flip and update the display. Use a thread to make the loop run alongside the rest of your code

from threading import Thread

def spawn_ship():
    ... # loop here

Thread(target=spawn_ship).start()
3 Likes

If the level 1 loop can be end the program will display the images on the screen?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.