Skip to content

1681-engine / index / LockBody

Interface: LockBody ​

Defined in: src/input/TargetLock.ts:10

Picking and holding a target on a touch screen, kept pure so it can be tested. Dragging an attack button points: the body lying closest to that direction is picked (and of two about as close to it, the nearer). A target button picks the nearest. The lock then holds — every attack, skill and the facing goes at it, even while a stick walks the body elsewhere — until that body is gone or leaves keepRange; a later drag that points at nothing keeps it.

Bodies come from a callback as { id, x, y }: the game decides what may be locked (monsters, a duel's opponent).

Properties ​

id ​

ts
id: number;

Defined in: src/input/TargetLock.ts:11


x ​

ts
x: number;

Defined in: src/input/TargetLock.ts:12


y ​

ts
y: number;

Defined in: src/input/TargetLock.ts:13

Released under the MIT License.