a state machine that emulates a pinball machine