Lets say I have a character with a shooting animation that plays every time I hit the space key. I need to block input to assure that the animation finishes before another action is taken. What is a common approach to doing this? Right now, I'm using a variable that is a set to the total number of seconds the animation is. When the variable is zero player input is allowed again. Is there a better way? I'm using Python and Pygame for a 2D game.
↧