Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


splash screen


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 29 October 2012 - 06:49 PM

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.

Sponsor:

#2 superman3275   Crossbones+   -  Reputation: 2061

Like
0Likes
Like

Posted 29 October 2012 - 07:38 PM

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 ph34r.png!

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 smile.png!


#3 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 29 October 2012 - 07:44 PM

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.

#4 superman3275   Crossbones+   -  Reputation: 2061

Like
0Likes
Like

Posted 29 October 2012 - 07:49 PM

For Timers the same basic principle applies, however instead of checking for input every loop just check to see if the timer is up.

Edited by superman3275, 29 October 2012 - 07:49 PM.

I'm a game programmer and computer science ninja ph34r.png!

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 smile.png!


#5 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 29 October 2012 - 07:51 PM

so I am on the right track?

#6 superman3275   Crossbones+   -  Reputation: 2061

Like
0Likes
Like

Posted 29 October 2012 - 08:27 PM

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.

Edited by superman3275, 29 October 2012 - 08:28 PM.

I'm a game programmer and computer science ninja ph34r.png!

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 smile.png!


#7 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 29 October 2012 - 08:44 PM

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;






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS