2021-02-03 23:28:46 +01:00
|
|
|
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;
|
2021-01-23 02:21:16 +01:00
|
|
|
forceX: number;
|
|
|
|
forceY: number;
|
2021-02-03 23:28:46 +01:00
|
|
|
visible: boolean;
|
|
|
|
createCursorKeys: () => CursorKeys;
|
|
|
|
}
|
|
|
|
|