GameState is now save in cache

HasPlayerMoved is send when the player is actually moving on the map every 200ms.
This commit is contained in:
GRL 2021-05-18 11:33:16 +02:00
parent 8cef4f6e90
commit 3edfd5b285
13 changed files with 404 additions and 100 deletions

View file

@ -0,0 +1,19 @@
import * as tg from "generic-type-guard";
export const isHasPlayerMovedEvent =
new tg.IsInterface().withProperties({
direction: tg.isString,
moving: tg.isBoolean,
x: tg.isNumber,
y: tg.isNumber
}).get();
/**
* A message sent from the game to the iFrame when the player move after the iFrame send a message to the game that it want to listen to the position of the player
*/
export type HasPlayerMovedEvent = tg.GuardedType<typeof isHasPlayerMovedEvent>;
export type HasPlayerMovedEventCallback = (event: HasPlayerMovedEvent) => void