Just wondering if its worth it to make a monolithic loop function or just add loops were they're needed.
The big loop option would just be a loop of callbacks that are added dynamically with an add function.
adding a function would look like this
setLoop(function(){
alert('hahaha! I\'m a really annoying loop that bugs you every tenth of a second');
});
setLoop would add the function to the monolithic loop.
so is the is worth anything in performance or should I just stick to lots of little loops using setInterval?
heres the game
http://thinktankdesign.ca/metropolis/
and all of its libraries
http://thinktankdesign.ca/metropolis/scripts/base.js
http://thinktankdesign.ca/metropolis/scripts/menu.js
http://thinktankdesign.ca/metropolis/scripts/grid.js
http://thinktankdesign.ca/metropolis/scripts/cursor.js
http://thinktankdesign.ca/metropolis/scripts/game_logic/controls.js
http://thinktankdesign.ca/metropolis/scripts/game_logic/automata.js
if I stick to individual loops there will be thousands of them because of the number of animation loops.
The game is a tower builder and complicated things like elevators and cars/peds. Not to mention loops for the automata, controlling events such as VIPs and fires and such. When functional (a year or two) it will be a lot like Sim Tower but iso-metric instead of a side scroller.