Sections/Screens/Pages in Games and Other Programs
I've got a question about design.
Most games, and other programs for that matter, have different "sections" to them. For example:
Start/Title Screen; Level Select; Actual Game Screen; Game Over Screen; etc etc.
How do people typically handle the design of setting up/flowing between these different sections? I realize there are probably many many ways to do it, but are there any that are considered particularly good practice or even standard in game/program design?
I've previously programmed up a text-based Rubik's Cube in C++ that runs in the windows console. Right now I'm reorganizing and refactoring all the code to be more organized, and I've come to realize it can be organized into 4 separate "pages": Start Page, Help Page, Enter Command Page, and Enter Algorithm Page.
Right now I'm considering 2 options for how to organize this:
1) In my "main" class, which contains the main() method, have different methods for Initializing the Page, Drawing The Page, and Getting Input/Performing Actions on the page, which behave differently depending on which page the program is on.
2) In my "main" class, have a separate method for "opening" each page (eg, openStartPage(), openPlayPage(), openHelpPage()...), and each of these contains the code or method calls necessary for initializing, drawing, getting input, and performing actions based on the input.
I hope those explanations were clear enough...
Anyway, the question: How do you go about organizing and designing different physical "sections" in a program?