Page 1 of 1

Timer for actions

Posted: Thu Oct 08, 2020 10:17 pm
by ProfB
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.

Re: Timer for actions

Posted: Fri Oct 09, 2020 10:33 am
by pgimeno
Please don't open support requests in the Games and Creations forum. Use the Support and Development forum.

There are timer libraries readily available, or you can make your own.

The most popular is probably hump.timer from the hump suite: https://github.com/vrld/hump