Like Andrew Aylett's answer, and assuming an object-oriented language, perhaps you could do something like:
Interface IState { void init(); void update(); void draw(); } class GameplayScene implements IState { void init() {
You also need to think about how to handle the transition between scenes. You can have a member variable in each scene class, called the same as nextScene, and the main function queries it at the beginning of the loop to switch to the corresponding scene.
Unless you have the luxury of using an object-oriented programming language (e.g. C ++, Java, C #, Python, etc.), Colin and Nick D's Answers can help, although I would try to include the switch statement in one place ( let's say one big function game_update) to add new states by making changes in one place. Alternatively, you could build a regular Colin apparatus to do something more general, and this clearly does not require a hard-coded switch statement. (although, to be honest, I can't think of a good way to do this at the moment)
source share