I made a rock-paper-scissors game using the pygame module in python. It runs perfectly well in the IDE(PyCharm) and the command prompt and everything works (including the cross button), but when I press the cross-button of the GUI window when the code is running in IDLE, the game crashes.
I don’t get any error messages, but the game freezes after I press the cross button once; then I cant give any more inputs to the window, but the cross button glows red when you hover over it, but if u press it again (2nd time), then the cross button stops glowing red when you hover over it and the game remains frozen.
This portion of the code isn’t working in IDLE:-
#Game-loop running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False #this doesnt seem to work in python IDLE but works perfectly in cmd and PyCharm
If you want to see the full code, here’s the GitHub repository.