Game states?

Started by
10 comments, last by Nausea 11 years, 4 months ago
The answer to your first question is to use one state.

That state can load any level. Just pass a number to that state so that it knows which level to load.
I have outlined how states work here: General Game/Engine Structure
And how to pass data to them: Passing Data Between Game States



I got another question now.
When I leave a state, for example a stage in the game, should I release the assets for the stage from my asset manager even if I would enter the stage again later?

Generally yes. If you know you are revisiting the same stage again, that usually only happens in special-case circumstances such as via the “Restart” pause-menu option. These cases can be handled by simply not leaving the current game state etc., so the general policy is to catch the most common cases that cause the same stage to be played again and handle them separately, while otherwise just unloading and loading on any other stage-change.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Advertisement

The answer to your first question is to use one state.

That state can load any level. Just pass a number to that state so that it knows which level to load.
I have outlined how states work here: General Game/Engine Structure
And how to pass data to them: Passing Data Between Game States


[quote name='Nausea' timestamp='1354309463' post='5005843']
I got another question now.
When I leave a state, for example a stage in the game, should I release the assets for the stage from my asset manager even if I would enter the stage again later?

Generally yes. If you know you are revisiting the same stage again, that usually only happens in special-case circumstances such as via the “Restart” pause-menu option. These cases can be handled by simply not leaving the current game state etc., so the general policy is to catch the most common cases that cause the same stage to be played again and handle them separately, while otherwise just unloading and loading on any other stage-change.


L. Spiro
[/quote]

Thank you for the advice, been reading some of those blog posts. :)

This topic is closed to new replies.

Advertisement