partey_workadventure/front/src/Phaser/Entity/RemotePlayer.ts
Gregoire Parant dbaf44e814 Change report flag
- Add icon on video
- Permit to have a modal with comment
2020-10-13 19:56:42 +02:00

35 lines
931 B
TypeScript

import {GameScene} from "../Game/GameScene";
import {PointInterface} from "../../Connexion/ConnexionModels";
import {Character} from "../Entity/Character";
import {Sprite} from "./Sprite";
/**
* Class representing the sprite of a remote player (a player that plays on another computer)
*/
export class RemotePlayer extends Character {
userId: number;
constructor(
userId: number,
Scene: GameScene,
x: number,
y: number,
name: string,
PlayerTextures: string[],
direction: string,
moving: boolean
) {
super(Scene, x, y, PlayerTextures, name, direction, moving, 1);
//set data
this.userId = userId;
}
updatePosition(position: PointInterface): void {
this.playAnimation(position.direction, position.moving);
this.setX(position.x);
this.setY(position.y);
this.setDepth(position.y);
}
}