Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

This is the sketch I've made so far:

alt text

  1. Title screen (here you select single player or 2 players).
  2. Instructions screen.
  3. Main game screen.
  4. Credits screen.
  5. Demo screen (an automatic version of main game with the words "DEMO MODE").
  6. Program termination.
share|improve this 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

2 Answers 2

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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