added callback on playermove - gets quite delayed after walking for a few seconds

This commit is contained in:
jonny 2021-05-10 21:27:17 +02:00
parent ce0c7ea3eb
commit 8e136cebe8
8 changed files with 104 additions and 44 deletions

View file

@ -1,4 +1,4 @@
import {gameManager, HasMovedEvent} from "./GameManager";
import { gameManager } from "./GameManager";
import {
GroupCreatedUpdatedMessageInterface,
MessageUserJoined,
@ -91,7 +91,8 @@ import {touchScreenManager} from "../../Touch/TouchScreenManager";
import {PinchManager} from "../UserInput/PinchManager";
import {joystickBaseImg, joystickBaseKey, joystickThumbImg, joystickThumbKey} from "../Components/MobileJoystick";
import { PlayerStateObject } from '../../Api/Events/ApiGameStateEvent';
import {waScaleManager} from "../Services/WaScaleManager";
import { waScaleManager } from "../Services/WaScaleManager";
import { HasMovedEvent } from '../../Api/Events/HasMovedEvent';
export interface GameSceneInitInterface {
initPosition: PointInterface|null,
@ -631,6 +632,9 @@ export class GameScene extends DirtyScene implements CenterListener {
//listen event to share position of user
this.CurrentPlayer.on(hasMovedEventName, this.pushPlayerPosition.bind(this))
this.CurrentPlayer.on(hasMovedEventName, (event: HasMovedEvent) => {
iframeListener.hasMovedEvent(event)
})
this.CurrentPlayer.on(hasMovedEventName, this.outlineItem.bind(this))
this.CurrentPlayer.on(hasMovedEventName, (event: HasMovedEvent) => {
this.gameMap.setPosition(event.x, event.y);