Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm developing a little simon-like game and I'd like to know what the best approach is when it comes down to game states.

What would be the best approach?

  • Creating different states/screens for 1-player and 2-player game sessions.
  • Creating just one state/screen with validation from a variable that holds the selection made by the player on the title screen.
share|improve this question

closed as primarily opinion-based by Anko, Seth Battin, Byte56 Jun 9 '15 at 22:26

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

Is the single player the same game but against the computer or does the actual game differ? – Bart van Heukelom Jul 28 '10 at 20:07
I viewed this question just to find out what a "one half player game" is. I'm still wondering. – AShelly Aug 6 '10 at 21:31
Well, it was intended to be 1 or 2. =) – pctroll Aug 15 '10 at 13:12
up vote 4 down vote accepted

You want your 1 player and 2 player game to be the same class with a 1/2 player toggle. Otherwise your code base is going to be unnecessarily forked.

share|improve this answer
He could inherit the same objects for both states, I guess. – zaratustra Jul 22 '10 at 18:47
@zarawesome if he did inherit both from a base class he might well find himself adding functionality in one subclass that he later needs in the other, leading to lots of refactoring. – Iain Jul 26 '10 at 21:28

Generally the game is only "multiplayer" when the game is in the actual gameplay mode--ie state 3. It is fairly common to just allow one player to "drive" in all other states. This is why you are often asked to "Press [button] to continue": to determine which controller/player is "driving". Then, when the main gameplay state is reached, the screen is split based on how many controller or players are actually connected.

share|improve this answer
In addition, this is one reason it's very common to have an intermediate "choose your profile" (or sometimes "choose your character") screen - so the game can figure out which controllers are "live" and which are merely connected but unused. – ZorbaTHut Jul 18 '10 at 15:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.