I have my game running in a while True loop and I would like to be able to ask the user to "Play again?" I already have the code for a rect to pop up with the text but I need a way for the user to click on the rect or hit y for yes and the code run its self again.
To tell if the user clicked on the rect, just set a 1 by 1 rect at the mouse position then when they click, check if the rects are colliding. Then, just call the loop again by having it be its own function, like DeadChex said.
Pygame restart?