transmit companion to remote players
This commit is contained in:
@@ -71,8 +71,8 @@ export abstract class Character extends Container {
|
||||
this.playAnimation(direction, moving);
|
||||
}
|
||||
|
||||
public addCompanion(): void {
|
||||
this.companion = new Companion(this.scene, this.x, this.y);
|
||||
public addCompanion(name: string): void {
|
||||
this.companion = new Companion(this.scene, this.x, this.y, name);
|
||||
}
|
||||
|
||||
public addTextures(textures: string[], frame?: string | number): void {
|
||||
|
||||
@@ -17,12 +17,17 @@ export class RemotePlayer extends Character {
|
||||
name: string,
|
||||
texturesPromise: Promise<string[]>,
|
||||
direction: PlayerAnimationDirections,
|
||||
moving: boolean
|
||||
moving: boolean,
|
||||
companion: string|null
|
||||
) {
|
||||
super(Scene, x, y, texturesPromise, name, direction, moving, 1);
|
||||
|
||||
|
||||
//set data
|
||||
this.userId = userId;
|
||||
|
||||
if (typeof companion === 'string') {
|
||||
this.addCompanion(companion);
|
||||
}
|
||||
}
|
||||
|
||||
updatePosition(position: PointInterface): void {
|
||||
|
||||
Reference in New Issue
Block a user