Wikifang:Telefang 1 Translation Patch/State Machine: Difference between revisions

From Wikifang, a definitive guide to Telefang, Dino Device and Bugsite
Jump to navigation Jump to search
(Created page with "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 ot...")
(No difference)

Revision as of 10:25, 22 July 2017

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...)