Sign in to follow this  

[.net] creating a splash screen

This topic is 4203 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
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

This topic is 4203 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this