   Game Entry Screen
  Hi I have put together my 1st 3d game and would now like to make the entry and 'game over' screens. that is the screen where i would have maybe three options: START, INSTRUCTIONS and EXIT and when the game would get over there would be a screen with GAME OVER written. I know this isn't directx programming and is more like windows programming. Could some one give me a few pointers (simple code samples on the net would be great) on how I can incorporate the screens. I understand that the three options would be basically menu items which when selected would get the next screen. Correct me if I am wrong. Thanks.   
  HI there I'am not a master at programming but it seems like a simple switch case menu would be a good ideaint choice;switch(choice){case:1 startbreak;case:2 instructionsbreak;case:3 exitbreak;}hope this helps   ;  What you say is correct, but I would like to see some actual code in action. Thanks.   ;  Hi mate here is some basic code#include <iostream>#include <string>#include <conio.h>void startFunction();void instructionFunction();void exitFunction();using namespace std;int main(){int number = 0;cout << "Please make a selection: ";cout << "Enter 1 to start game.";cout << "Enter 2 for instructions.";cout << "Enter 3 to exit.";switch(number){case '1': startFunction();break;case '2': instructionFunction();break;case '3': exitFunction();break;}return 0;}void startFunction(){cout << "Game has started.";}void instructionFunction(){cout << "Please read instructions.";}void exitFunction(){cout << "Programm exiting.";}   ;  sorry mate here is the correct code this is all in c++#include <iostream>#include <string>#include <conio.h>void startFunction();void instructionFunction();void exitFunction();using namespace std;int main(){char number = 0;cout << "Please make a selection: \n";cout << "Enter 1 to start game.\n";cout << "Enter 2 for instructions.\n";cout << "Enter 3 to exit.\n";cin >> number;switch(number){case '1': startFunction();break;case '2': instructionFunction();break;case '3': exitFunction();break;}return 0;}void startFunction(){cout << "Game has started.";_getch();}void instructionFunction(){cout << "Please read instructions.";_getch();}void exitFunction(){cout << "Programm exiting.";_getch();}   ;  Most people nowadays write classes for their screens and keep track of the current active screen. The idea is the same - you're implementing a finite state machine - but the implementation details are different. Basically, using classes allows you some more freedom, in that each state can actually have it's own (private) variables (so it's also actually a state, with state information, rather than only functionality). That also makes things easier to manage.Some quick code:// Screen base class, the base for all screen classesclass Screen{public:Screen() { }// Destructor is virtual, read up on abstract base-classes to understand whyvirtual ~Screen() { }// Update and Render functions, all screens will have their own version of thesevirtual void Update() = 0;virtual void Render() = 0;}// The main menuclass MainMenu : Screen{public:// Empty constructor/destructor, fill in with whatever your main menu needsMainMenu() { }~MainMenu() { }void Update(){// Do some stuff here}void Render(){// Draw main menu stuff here}}// The game screenclass GameScreen : Screen{public:// Empty constructor/destructor, fill in with whatever your game needsGameScreen() { }~GameScreen() { }void Update(){// Perform game logic here}void Render(){// Draw game stuff here}}// Our pointer to the current screenScreen* activeScreen = NULLint main(){// Create a new MainMenu and set it as the active screenSetScreen(new MainMenu());bool running = true;while(running){// Call Update and Render on the active screen,// whether that's a MainMenu instance or a Game instance doesn't// matter, the correct functions will be called.currentScreen->Update();currentScreen->Render();}// Clear up the screen once we're done runningdelete activeScreen;}// Set a new screen, clear up old onevoid SetScreen(Screen* newScreen){// Calling delete on a NULL-pointer is safedelete activeScreen;activeScreen = newScreen;}Of course, you should divide these classes in files of their own, so you keep can your screens manageable (I usually find files of 1500+ lines too unwieldy).In the end, they're all finite state machines and sometimes a switch-case statement indeed suffices. But for something like game states, you'll usually want to store some state-specific information as well, and keeping everything global quickly ends up messy.   ;  very true   ;  Moved to For Beginners.   