Defining a state
While it is a bit difficult to define correctly what a state actually is, and because that also depends on the implementation we choose to go with, we will try to pass our own idea of what states are and how they should behave.
We can look at a state as an independent screen in the gaming software, an object that encapsulates the logic and graphics of a determined group of functionality and information.
Nothing stops us from creating a state that behaves in any way we'd like; however, there are some usual guidelines into what belongs to the same state. Let's try to prove this shallowly by looking at the commercial games of our time. We will often see most games showing introduction videos, from the trailer of the game to company brand logos. We can look at each of these screens as states. In fact, having a VideoState
that would simply playback a video and proceed to the next state would fit this model perfectly!
Then, we usually see a title screen, which is all about fancy...