Reposition joystick (thx @TabascoEye)
This commit is contained in:
parent
c3230bc2b3
commit
e713120434
@ -428,6 +428,12 @@ export class GameScene extends ResizableScene implements CenterListener {
|
||||
mediaManager.setUserInputManager(this.userInputManager);
|
||||
this.userInputManager = new UserInputManager(this, this.virtualJoystick);
|
||||
|
||||
// Listener event to reposition virtual joystick
|
||||
// whatever place you click in game area
|
||||
this.input.on('pointerdown', (pointer: { x: number; y: number; }) => {
|
||||
this.virtualJoystick.x = pointer.x;
|
||||
this.virtualJoystick.y = pointer.y;
|
||||
});
|
||||
//notify game manager can to create currentUser in map
|
||||
this.createCurrentPlayer();
|
||||
this.removeAllRemotePlayers(); //cleanup the list of remote players in case the scene was rebooted
|
||||
|
Loading…
Reference in New Issue
Block a user