Skip to main content
gamedev.net
🔒 Locked

Menu Coding

Started by moonshine 0 replies 300+ views
Original Post
moonshine
moonshine
Ive always wondered how the most efficient way to code menus (main menu, options etc). Like how for example all of it is divided up so that when you pause it takes you to a menu then straight back to the game when you come out of it. Anyone know how pro's do it? Thanks
jbadams
jbadams
Often an FSM (Finite State Machine) is used to control the state of the game, and to show a menu, the game is simply set to a Menu State, during which game logic is not updated, and the menu is displayed on screen. Any menu logic is handled as required, and once the menu is closed again, the game is taken out of the Menu State, and put back into a Play State, where the logic is updated again, and the game is of course, rendered to the screen.

I seem to remember there being a good article on this at Flipcode once, but I dont have a link to it anymore, perhaps you could find it yourself however.
- Jason Astle-Adams

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.