About the solution of pygame running unresponsive

About the solution of pygame running unresponsive

I just started to learn pygame recently and encountered a lot of pits, record and share here.
Insert picture description here
The reason was found later because:pygame must respond to pygame.event.get() in the loop body, otherwise the system will think that the window is not responding, the mouse will keep turning and waiting for the response, and after clicking, the window will display no response.
Add the response to the event in the while loop
, The modified code is as follows

Insert picture description here

Guess you like

Origin blog.csdn.net/ws306173697/article/details/106594001