Skip to main content
edited title
Link
user154928
user154928

One global game loop vs onemultiple local game looploops

Source Link
user154928
user154928

One global game loop vs one local game loop

What are the advantages of using multiple game loops instead of one?

Assume Level1, Level2, Level3. These levels may bring totally different problems and needs and they may also be completely separate, perhaps like a classic Mario game. One level needs multiple frame counters yet the others need none. Would it make sense to structure a game like that, with many loops?

I've written an implementation of this, which was actually my first loop design for my game, and memory management looks like few necessary global with many local variables, at the cost of less automated code (meaning more writing).

Is this done at all and if so, is this common?