MVC pattern and (Game) State pattern
- by topright
Game States separate I/O processing, game logic and rendering into different classes:
while (game_loop)
{
game->state->io_events(this);
game->state->logic(this);
game->state->rendering();
}
You can easily change a game state in this approach.
MVC separation works in more complex way:
while (game_loop)
{
game->cotroller->io_events(this);
game->model->logic(this);
game->view->rendering();
}
So changing Game States becomes error prone task (switch 3 classes, not 1).
What are practical ways of combining these 2 concepts?