While coding a little scroller, a question popped into my mind.
If I consolidate all the necessary movement scripts for the player sprite into one forever loop, would it:
1) Respond quicker than having several scripts running simultaneously?
2) Cause less lag than having several scripts running simultaneously?
Offline
It will reduce lag. Whether that will make them respond quicker isn't certain, as it depends on what is in your loops. Remember, if they're all in the same loop, each instruction has to wait for the ones before it to activate before it can run. If you have a long script (e.g. with a "wait (0.1) secs" or a loop), all the other scripts will have to wait longer to be actiavted.
Offline
MoreGamesNow wrote:
It will reduce lag. Whether that will make them respond quicker isn't certain, as it depends on what is in your loops. Remember, if they're all in the same loop, each instruction has to wait for the ones before it to activate before it can run. If you have a long script (e.g. with a "wait (0.1) secs" or a loop), all the other scripts will have to wait longer to be actiavted.
Thank you; that's the answer I needed. :3
Offline