Skip to main content
2 of 2
edited title
user avatar
user avatar

One global game loop vs multiple local game loops

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?

user154928