So with pygame you have a while loop that loops continuously, then your event handlers in a for loop, then the code you want to execute continuously.
I need to handle an event after i execute a line of code inside the while loop though beacuse they impact each other, but I also need to handle a different event before the line.
How, inside my main while loop, handle a set of events, execute some code, and then handle another set of events?
Solved.
I set a variable equal to 1 in the user event handler, and then down where i needed to execute the code, i check if the variable was equal to 1, and if it was, i executed my code and set the variable back to 0.
Good stuff.
Here is my code if anyone wants to help me find a better solution 😉 (kinda long):