Jump to content
  • Advertisement
Sign in to follow this  
Smit

Handling different game modes?

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

I’ve finished my basic pong clone but now I want to add some variation and add separate “gamemodes” it. So there would be basic pong, pong with power ups and whatever else I mange to think of. What I’m trying to decide what is a good way of handling all of these different modes. I could use a big switch statement or I could even load each from a dll and have each one respond to one Update() function (as I plan on having the actual engine is separate from the “game”), How do these sound or do you know of a better solution? Thanks!”

Share this post


Link to post
Share on other sites
Advertisement
Well, this refers to the term of "game state".
Just think about having a game loop for each game state, and switching game states becomes simply ending one loop and starting up another.

This can be done in several ways, like with function pointers, derived classes, a decorator pattern...

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!