Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - willem640

Pages: [1]
1
General / Re: Having multiple event loops in a single program
« on: October 03, 2019, 08:52:46 am »
Thanks! I'll try that

2
General / Having multiple event loops in a single program
« 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.

Pages: [1]
anything