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.
6 replies to this topic
Sponsor:
#2 Crossbones+ - Reputation: 1373
Posted 29 October 2012 - 07:38 PM
Well, have an enum that keeps the gamestate:
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
!
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 photo editor.
Here's Breakout:
Breakout!
If you need some photo editing done, contact me:
superman3275@gmail.com
if you want some programming help, or are recruiting for a game development team, either PM me on here or email me up there
!
Here's Breakout:
Breakout!
If you need some photo editing done, contact me:
superman3275@gmail.com
if you want some programming help, or are recruiting for a game development team, either PM me on here or email me up there
#4 Crossbones+ - Reputation: 1373
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 photo editor.
Here's Breakout:
Breakout!
If you need some photo editing done, contact me:
superman3275@gmail.com
if you want some programming help, or are recruiting for a game development team, either PM me on here or email me up there
!
Here's Breakout:
Breakout!
If you need some photo editing done, contact me:
superman3275@gmail.com
if you want some programming help, or are recruiting for a game development team, either PM me on here or email me up there
#6 Crossbones+ - Reputation: 1373
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 photo editor.
Here's Breakout:
Breakout!
If you need some photo editing done, contact me:
superman3275@gmail.com
if you want some programming help, or are recruiting for a game development team, either PM me on here or email me up there
!
Here's Breakout:
Breakout!
If you need some photo editing done, contact me:
superman3275@gmail.com
if you want some programming help, or are recruiting for a game development team, either PM me on here or email me up there
#7 GDNet+ - Reputation: 521
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;






