In the project I'm working on in Pygame, there are a lot of variables that need to be decremented to 0 over time (momentum of an object, charge level of a battery, etc.). Instead of creating a seperate USEREVENT+X for each variable, I figured it would be useful to create a decrementvariable() function which takes a variable and a time in milliseconds, and brings the variable to zero over that time. Multiple variables may be reducing to zero at any given time.
However, the only way I know to create USEREVENTS is to hard code them, which brings me to my question:
Is there a way to dynamically create USEREVENTS so that my goal can be met? Or would I have to go about this in some other way?