Wikifang:Telefang 1 Translation Patch/State Machine
Jump to navigation
Jump to search
Telefang's primary game loop is structured as a state machine. Each iteration of the game loop executes a handful of predefined tasks, and then indexes a jump table to load other screens' code. This indexing can be recursive, with individual states running their own predefined tasks before jumping into sub-states. This is known to recurse to at least fourth-order state machines.
State machines are indexed through four primary SystemState variables, and two secondary state variables. The secondary state variables are used in certain states for various reasons - usually to prevent overwriting the state of another screen. (Why they didn't set up a proper state stack for this sort of thing is beyond me...)