You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to gate systems by a global enum game state
#2121
What's the idiomatic way to gate systems based on a global enum game state? For example, if my game has states Ready, Running, Paused, etc., how do I make systems conditional on the game state? There may be use cases where a system should run in multiple game states e.g. Running | Paused.
There are a few options I'm aware of, but not sure which is the best/most performant method.
A couple of options on how to represent the game state:
Manually check the GameState at the start of each system. Seems inefficient
Enable/disable systems based on GameState. Not sure where this function should go – in a per-tick system itself? – in an outer loop such as during the world.progress() ticks?.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
What's the idiomatic way to gate systems based on a global enum game state? For example, if my game has states
Ready,Running,Paused, etc., how do I make systems conditional on the game state? There may be use cases where a system should run in multiple game states e.g.Running | Paused.There are a few options I'm aware of, but not sure which is the best/most performant method.
A couple of options on how to represent the game state:
And a couple of options on how to gate systems:
world.progress()ticks?.Are there other ways? Any recommendations?
All reactions