Input · interface
AnalogAction
Move, look: a direction rather than a state.
Explained in Moving things.
interface AnalogActionimport type { AnalogAction } from '@driftengine/core';In depth
The reason this cannot be a button-only design. A stick is not a key, and a game that treated one as four keys would throw away the magnitude the player is actually controlling.
Key directions follow the stick's convention, which is the specification's: up is negative. The alternative was to flip one of them, and an engine that silently disagrees with the API it wraps is one a consumer cannot reason about.
Properties
| Name | Type | Description |
|---|---|---|
stickreadonly | 'left' | 'right' | |
upreadonlyoptional | string | readonly string[] | One code or several, per direction.MoreSeveral, because |
downreadonlyoptional | string | readonly string[] | |
leftreadonlyoptional | string | readonly string[] | |
rightreadonlyoptional | string | readonly string[] |