title: Using The State Pattern in games
body: <p>Recently, I've tried to create Snake game in SFML. However, I also wanted to use some design pattern to make some good habits for future programming - it was The State Pattern. But - there is some problem that I am unable to solve.</p>
  <p>To make everything clear, I've tried to make several Menus - one main menu, and others, like &quot;Options&quot;, or something like this. The first option of the main menu would take the player to the &quot;Playing State&quot;. But then, the problem appears - I think the whole game should be an independent module implemented to program. So, what should I do with the actual state which program is in? (for example, let's call this state &quot;MainMenu&quot;).</p>
  <p>Should I make an additional state called &quot;PlayingState&quot;, which would represent the whole game? How would I do it? How is it possible to add new functionality to a single state? Do you have any ideas?</p>