Jump to content
  • Advertisement
Sign in to follow this  
p997

[.net] creating a splash screen

This topic is 4507 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, my vertical scroller game in C# is near its completion, however i still have not figured out a way to create a splash screen at the beginning of the game to introduce the rules and key functions. here is my Run() method: public void Run() { Initialize(); InitializeResources(); while (m_GameRunning) { m_StopWatch.Reset(); m_StopWatch.Start(); Application.DoEvents(); KeyBoard.Update(); InternalUpdate(); Render(); m_StopWatch.Stop(); m_CurrentFrameTime = (double)m_StopWatch.ElapsedTicks; double delta = m_FrameTime - m_CurrentFrameTime; if (delta > 0) { m_StopWatch.Reset(); m_StopWatch.Start(); while ((double)m_StopWatch.ElapsedTicks < delta) ; m_StopWatch.Stop(); m_CurrentFrameTime += m_StopWatch.ElapsedTicks; } } } where would the splash screen code fit in? also, i would like the game to go into a splash screen whenever the player clears a stage, to calculate bonus points. Could someone pls tell me how to create a splash screen where the player needs to press a key(any key) to resume the game. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
One of the big things of game development is game state management. If you want the player to choose "New Game" before the game actually starts, that's a game state. The main menu, the actual game, the splash screen, those are all different game states.

You would implement an abstract GameState class which would have both Update and Draw methods along with a globally available instance of it. For each game state you want, you would implement a derived class for it, implementing the Update and Draw functions. Whenever your application needs to draw, just call the globally available instance of the GameState object's Draw method. Whenever you need to update, just call its Update method.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!