# Simon

The four-lamp memory game as a handheld made of kit parts. Watch the lamps, then repeat them on the keys; each round adds one and the lamps get quicker.

Object · With a Pass · https://tactileui.dev/objects/simon

> The code and styling for this object come with the Pass. Sign in if you have one. Sign in: https://tactileui.dev/auth/sign-in The price: https://tactileui.dev/pricing

## Anatomy

Shared handheld case, Pointerdown keys, Lamp sequence, Segment lcd digits, Concentric corners, Scale as an object

## Usage notes

A game you could hold, drawn from the kit's own parts: a moulded case with an LCD, four lamps set in as lenses, four raised keys, a Start key, a sound switch and a speaker grille. Press Start and watch the lamps; repeat the sequence on the keys. Each round adds one lamp, the lamps shorten every four rounds, and one mistake ends the run. The best round is kept on the visitor's device. It is also a plain demonstration of the case the library's other handheld games share.

## Options

| Option | Type | Description |
| - | - | - |
| sound | boolean | The switch on the case. On, each lamp has its own tone once you have pressed a key (a browser allows sound only after a press). The visitor’s own setting is kept on their device. |
| label | text | What a screen reader calls the case. |

## Methods

- update
- destroy

## States

1. **How to play**: Press Start (or Space). Round 1 lights one lamp; repeat it on the keys. Every round adds one more, chosen at random, and a wrong key ends the run.
2. **Keys**: 1, 2, 3 and 4 press the green, amber, red and blue keys, and hold them down while held. Space starts a run, or starts again after a miss. Sound begins with the first press.
3. **Made of**: The kit's Panel (the case), LCD (round and best in seven segments), Lamp (four lenses and a state lamp), Key (four raised keys and the primary Start key), Tray, Switch (sound) and Grille.
4. **Idle**: 
5. **Showing**: The LCD says Watch and the lamps light one at a time.
6. **Your turn**: The LCD says Your turn and the keys are live. A right key lights its lamp; the last of the round says Good and the next round begins.
7. **Game over**: A wrong key lights its own lamp briefly, then all four. The round you reached stays on the counter; a new best is kept on this device.
8. **Sound**: One tone per lamp, and a low buzz on a miss. The switch turns it off; the choice is remembered.
9. **Reduced motion**: A held key shades but does not move; the lamps still light.
10. **Twelve finishes, two volumes**: The case reads the finish and volume tokens only: aluminium, graphite and the other ten finishes, Tactile or Quiet.

## How it works

Original. The case is the library's shared handheld (originals/components/shared/handheld), drawn from the kit's parts at one size and scaled as an object. It needs the Tactile UI Kit's stylesheets on the page; the Code tab's example links them from ./kit/.
