HTML and CSS Reference
Figure 20-2. The player decides which button or combination of buttons is used for the jump action
Chords are another virtualized input type. A chord is active when multiple event states occur simultaneously, such as
when the analog stick is held up and the A button is pressed (see Figure 20-3 ). A chord may or may not be triggerable
when other buttons are pressed. Chords can be detected by tracking the state of the individual inputs involved in the
chord over time and checking if the chord is active after each input event.
Figure 20-3. The analog stick is held up and the A button is pressed
Sequences are active when multiple event states occur in a specific order and within a certain amount of time.
A famous example is the Konami code: UP, UP, DOWN, DOWN, LEFT, RIGHT, LEFT, RIGHT, A, B, A, B, START. A
directed graph state machine can model sequences. The sequence starts off in the READY state, and as each input
event is processed, the sequence can move forward to the next state or back to the READY state if an invalid input is
encountered (see Figure 20-4 ).
Figure 20-4. A sequence starts off in the READY state, processes each input event, and can move forward to the next
state or back to the READY state