> For the complete documentation index, see [llms.txt](https://sbscripts.gitbook.io/sb-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sbscripts.gitbook.io/sb-scripts/sb-minigames/games-dexterity.md).

# Games: Dexterity

### GhostTap

Tiles light up one after another and fade. Click each tile **while it's lit**. Missing a tile, or clicking a dark one, costs a life.

**Controls:** mouse

```lua
exports['sbminigames']:GhostTap({ tiles = 7, showTime = 500, lives = 2 }, cb)
```

Positional: `GhostTap(tiles, showTime, time, callback)`

| Option     | Type | Default | Range       | What it does                            |
| ---------- | ---- | ------- | ----------- | --------------------------------------- |
| `tiles`    | int  | `5`     | 3 to 9      | Tiles that light up                     |
| `showTime` | int  | `600`   | 300 to 1200 | Milliseconds a tile stays lit           |
| `lives`    | int  | `2`     | 1 to 5      | Mistakes allowed                        |
| `time`     | int  | `0`     | 0 to 600    | Seconds before failing (`0` = no limit) |

### Targets

Targets drift around the board and slowly shrink. Click them to score. Clicking empty space, or letting a target escape, costs a life. Score enough hits before the timer runs out.

**Controls:** mouse

```lua
exports['sbminigames']:Targets({ count = 12, life = 2000, speed = 1.4 }, cb)
```

Positional: `Targets(count, time, callback)`

| Option  | Type  | Default | Range        | What it does                            |
| ------- | ----- | ------- | ------------ | --------------------------------------- |
| `count` | int   | `10`    | 5 to 25      | Hits needed                             |
| `life`  | int   | `2500`  | 1000 to 5000 | Milliseconds before a target escapes    |
| `speed` | float | `1`     | 0.5 to 3     | Target movement speed                   |
| `lives` | int   | `3`     | 1 to 6       | Misses allowed                          |
| `time`  | int   | `15`    | 0 to 600     | Seconds before failing (`0` = no limit) |

### TypeRace

A phrase of random hacker words is shown. Type it exactly. Correct characters turn light, and wrong ones turn red. Pasting is disabled.

**Controls:** keyboard

```lua
exports['sbminigames']:TypeRace({ words = 5, time = 25 }, cb)
```

Positional: `TypeRace(words, time, callback)`

| Option  | Type | Default | Range   | What it does        |
| ------- | ---- | ------- | ------- | ------------------- |
| `words` | int  | `4`     | 2 to 8  | Words in the phrase |
| `time`  | int  | `20`    | 5 to 60 | Seconds to type it  |
