Propagating customized sprites all over the game
This commit is contained in:
parent
6d0bccc0e1
commit
84529d6e99
14 changed files with 99 additions and 73 deletions
|
@ -3,6 +3,6 @@ import {PointInterface} from "../../Connection";
|
|||
export interface AddPlayerInterface {
|
||||
userId: string;
|
||||
name: string;
|
||||
character: string;
|
||||
characterLayers: string[];
|
||||
position: PointInterface;
|
||||
}
|
||||
|
|
|
@ -42,8 +42,8 @@ export class GameManager {
|
|||
return this.playerName;
|
||||
}
|
||||
|
||||
getCharacterSelected(): string {
|
||||
return this.characterLayers[0];
|
||||
getCharacterSelected(): string[] {
|
||||
return this.characterLayers;
|
||||
}
|
||||
|
||||
loadMap(mapUrl: string, scene: Phaser.Scenes.ScenePlugin, instance: string): string {
|
||||
|
|
|
@ -166,7 +166,7 @@ export class GameScene extends Phaser.Scene {
|
|||
connection.onUserJoins((message: MessageUserJoined) => {
|
||||
const userMessage: AddPlayerInterface = {
|
||||
userId: message.userId,
|
||||
character: message.character,
|
||||
characterLayers: message.characterLayers,
|
||||
name: message.name,
|
||||
position: message.position
|
||||
}
|
||||
|
@ -704,7 +704,7 @@ export class GameScene extends Phaser.Scene {
|
|||
addPlayerData.position.x,
|
||||
addPlayerData.position.y,
|
||||
addPlayerData.name,
|
||||
addPlayerData.character,
|
||||
addPlayerData.characterLayers,
|
||||
addPlayerData.position.direction,
|
||||
addPlayerData.position.moving
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue