- Home /
Timed actions
I want to create levels for my sidescroller, enemies show up and leave after a specific time (if not all killed). Is there any best practice for doing that ? Wonder why I don't find anything, Im sure others also do things like that - or am I on a complete wrong way?
Answer by Ben-Stoneman · Sep 12, 2014 at 08:41 PM
No there is no best practice for doing this.
The design of the system you implement into your game to manage such a thing will highly depend on other design factors of your game.
To hopefully answer this you should consider instantiating enemies and having a timer on each of them, once the time is over they will be destroyed. Also consider refreshing the timer if a player comes near them or how ever you want to do it.
All my Enemies are instatiated on level load and disabled then. When I need them they are activated. I thought about something the same with the timers. If there is no other way I have to play aroud with that and try to create something useful for me.