splash screen

Started by
5 comments, last by phil67rpg 11 years, 5 months ago
I am making a pong game using dx9 and c++.I want to implement a simple splash screen that gives instructions on how to play the game. I am perplexed as to how to start this section of the game.
Advertisement
Well, have an enum that keeps the gamestate:

enum GameState
{
InSplashScreen,
InMainMenu,
Playing,
InGameOver,
Exiting
};

Then, create a gamestate and when they start the game set it equal to InSplashScreen. Have an if statement inside your game loop:

if (MyGameState == InSplashScreen)
{
//render splashscreen
//check for the input you need to get out of the splash screen
//if ^ the input is true, set MyGameState to Playing
}

else if (MyGameState == Playing)
{
//Logic
//Render
}


There is a lot of ways to do it. Look into state machines (Great Article in C++, Even though he uses SDL his techniques can be applied to all games)
I hope I helped you. If you have any questions ask away :)!

I'm a game programmer and computer science ninja !

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here !

cool I have been doing some research and might use something like WM_CREATE or WM_TIMER windows messages. I have some books on win32.I will look up state machines.
For Timers the same basic principle applies, however instead of checking for input every loop just check to see if the timer is up.

I'm a game programmer and computer science ninja !

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here !

so I am on the right track?
Yes, I believe you are. Really however, making a working system is on the right track. You'll improve your code with every project and I see no point in trying to make a completely "proper" (By someone else's standards) State Machine or Splash Screen manager if you won't even use it. Feel free to message me your Splash Screen / State Machine code if you want and I'll (try to) reply tomorrow and give you some tips learned through development.

I'm a game programmer and computer science ninja !

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here !

I have this much code so far, I am still stuck on the understanding the function of the WM_TIMER windows message. case WM_CREATE:
SetTimer (hWnd,ID_TIMER,5000,NULL);
return 0;
case WM_TIMER:
MessageBeep(5000);
return 0;

case WM_DESTROY:
KillTimer(hWnd,ID_TIMER);
Cleanup();
PostQuitMessage(0);
return 0;
break;

This topic is closed to new replies.

Advertisement