2
« on: October 02, 2019, 11:05:35 pm »
Hi, I am currently developing a game. The game has an event loop in which all the events related to the game itself are handled (keyboard input, mostly). I would like to add a start menu, with possibly multiple levels of menus where the user can select preferences (avatar, etc.). The game is not running while this is happening and no event for the game should be processed. Additionally, while the game is running, the menu will not be active and events for it should not be processed.
I was thinking about adding a dedicated event loop for the menu, and progressing to the game loop when the user has started the game.
Is this bad practice? If so, what should I do instead? Adding if statements everywhere to poll the state of the program (menu/game) doesn't seem like a very good solution to me.
Thanks!
I'm very sorry if this is the wrong forum, I'm not very familiar with the layout.