Pygame programs hanging on exit

前端 未结 5 1515
野趣味
野趣味 2021-01-02 07:11

I\'m tinkering around with pygame right now, and it seems like all the little programs that I make with it hang when I try to close them.

Take the following code, fo

5条回答
  •  盖世英雄少女心
    2021-01-02 07:47

    Where do you exit the outer loop?

     while True: # outer loop
         for event in pygame.event.get(): # inner loop
             if event.type == QUIT:
                break # <- break inner loop
    

提交回复
热议问题