23 lines
460 B
TypeScript
23 lines
460 B
TypeScript
|
import Phaser from "phaser";
|
||
|
|
||
|
export type CursorKey = {
|
||
|
isDown: boolean
|
||
|
}
|
||
|
|
||
|
export type Direction = 'left' | 'right' | 'up' | 'down'
|
||
|
|
||
|
export interface CursorKeys extends Record<Direction, CursorKey> {
|
||
|
left: CursorKey;
|
||
|
right: CursorKey;
|
||
|
up: CursorKey;
|
||
|
down: CursorKey;
|
||
|
}
|
||
|
|
||
|
export interface IVirtualJoystick extends Phaser.GameObjects.GameObject {
|
||
|
y: number;
|
||
|
x: number;
|
||
|
visible: boolean;
|
||
|
createCursorKeys: () => CursorKeys;
|
||
|
}
|
||
|
|