Timer for actions
Posted: Thu Oct 08, 2020 10:17 pm
Hello, guys.
I am trying to animate a death animation and here is what I am currently doing: when a collision is detected, I remove the dying element from the table I inserted it before, and when I do it, I'd like it to change it's image to a death one, and then be removed from the table. My problem is that the animation won't appear for too long, because when it changes its image, it's already gone. So I think I need some form of timer to not let it die while the game continues and to the animation stays on screen for a while.
Also, this "timer" system would be used for shooting intervals.
Thank you a lot, guys.
I am trying to animate a death animation and here is what I am currently doing: when a collision is detected, I remove the dying element from the table I inserted it before, and when I do it, I'd like it to change it's image to a death one, and then be removed from the table. My problem is that the animation won't appear for too long, because when it changes its image, it's already gone. So I think I need some form of timer to not let it die while the game continues and to the animation stays on screen for a while.
Also, this "timer" system would be used for shooting intervals.
Thank you a lot, guys.