Sign in to follow this  

Handling different game modes?

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

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