A simple state machine for games and what not.