Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to manage different screens???  (Read 2003 times)

0 Members and 1 Guest are viewing this topic.

JoWack

  • Newbie
  • *
  • Posts: 1
    • View Profile
How to manage different screens???
« on: May 05, 2013, 09:27:10 pm »
Hi, I'm relatively new to programming, but I've created a simple remake of the game "Pong" and it works really well. As of now, it goes straight to the game screen while running, but I would like for it to display a splash screen for around 5 seconds then go to a title screen, which has two buttons for single player or multiplayer (right now I have a console window set up to choose either single or multiplayer). I have absolutely no idea on how to create and manage these different screens, and I've read a couple of tutorials on it but they are extremely confusing to me. If anybody could help me out here, what is the absolute easiest way to create and manage multiple screens in an SFML project?

Thanks, Joe

The Terminator

  • Full Member
  • ***
  • Posts: 224
  • Windows and Mac C++ Developer
    • View Profile
Re: How to manage different screens???
« Reply #1 on: May 05, 2013, 09:48:46 pm »
What you're looking for is a state manager. If you are unfamiliar of what that is, ask google. If you're not comfortable writing your own, you can take a look at my project here: https://github.com/TheTerminator1337/Technoport
Current Projects:
Technoport

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: How to manage different screens???
« Reply #2 on: May 05, 2013, 09:54:01 pm »
A start would also be the forum search. About the same question has been asked a few days ago and many times before that.
Another possible implementation would be my SmallGameEngine, which is kind of connected to a tutorial on states. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: How to manage different screens???
« Reply #3 on: May 05, 2013, 11:44:03 pm »
You can see my Man source code for example of pretty braindead and easy to use menu/scores/pause etc. states. You may want to use some smart pointers for it though, just to be sure there are no leaks. ;)
http://en.sfml-dev.org/forums/index.php?topic=11260.0
« Last Edit: May 05, 2013, 11:49:34 pm by FRex »
Back to C++ gamedev with SFML in May 2023