FEATURE: clicking on another player show a contact card when possible

This commit is contained in:
kharhamel 2021-06-01 15:35:25 +02:00
parent fffd36267d
commit c5f3cfe87c
14 changed files with 183 additions and 9 deletions

View file

@ -3,6 +3,8 @@ import type {PointInterface} from "../../Connexion/ConnexionModels";
import {Character} from "../Entity/Character";
import type {PlayerAnimationDirections} from "../Player/Animation";
export const playerClickedEvent = 'playerClickedEvent';
/**
* Class representing the sprite of a remote player (a player that plays on another computer)
*/
@ -25,6 +27,10 @@ export class RemotePlayer extends Character {
//set data
this.userId = userId;
this.on('pointerdown', () => {
this.emit(playerClickedEvent, this.userId);
})
}
updatePosition(position: PointInterface): void {
@ -40,6 +46,6 @@ export class RemotePlayer extends Character {
}
isClickable(): boolean {
return false; //todo: make remote players clickable if they are logged in.
return true; //todo: make remote players clickable if they are logged in.
}
}