workadventure/front/src/types.ts

24 lines
506 B
TypeScript
Raw Normal View History

import type Phaser from "phaser";
2021-02-03 23:28:46 +01:00
export type CursorKey = {
isDown: boolean;
};
2021-02-03 23:28:46 +01:00
export type Direction = "left" | "right" | "up" | "down";
2021-02-03 23:28:46 +01:00
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;
forceX: number;
forceY: number;
2021-02-03 23:28:46 +01:00
visible: boolean;
createCursorKeys: () => CursorKeys;
}