Best Practice for Timers
quinn221
Member Posts: 280
Hey Guys,
I have been reading a bunch of posts about timers and how they can cause performance issues. Most of these posts are a few years old, so I am wondering is this still an issue or has something changed.
Also I have a question about loading a scene...right now it takes about 4 seconds to load, is there a way to put in a preloaded so the user can see the game is loading?
Comments
2 question i wonder about that too.
It matters how you use timers. They are great if used efficiently! For the load scene you could make a Loading animation that spawns at the end of the level. So, when guy collides
with the exit door spawn an actor that centers itself on the screen and have it playing a Loading animation.
Edit: I forgot that you could do this. Make a game integer attribute game.Finished or something, or use an already made one.
Make the LOADING actor on the non-scrollable layer. When the player finishes and does everything he needs to change attribute game.Finished to 1. Then in the LOADING actor have a constrain that says: constrain self.color.alpha to game.Finished. Then in every level you might want to add a manager actor that changes the game.Finished to 0 when the level starts. Hope this helps!
Those are old threads back many version of GS ago. I use timers alot. Timers are a vital part of coding. I never have issues.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS