Fixed player set
This commit is contained in:
parent
8c89bd6841
commit
8abe18b0f1
@ -66,6 +66,8 @@ function registerEvents(registry, events, tutorial) {
|
|||||||
registry.set('crypStatusUpdate', { id, skill, target });
|
registry.set('crypStatusUpdate', { id, skill, target });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
events.on('SET_PLAYER', setPlayer);
|
||||||
|
|
||||||
events.on('SEND_SKILL', function skillActive(gameId, crypId, targetCrypId, skill) {
|
events.on('SEND_SKILL', function skillActive(gameId, crypId, targetCrypId, skill) {
|
||||||
const ws = registry.get('ws');
|
const ws = registry.get('ws');
|
||||||
ws.sendGameSkill(gameId, crypId, targetCrypId, skill);
|
ws.sendGameSkill(gameId, crypId, targetCrypId, skill);
|
||||||
|
|||||||
@ -104,9 +104,7 @@ class HomeCrypList extends Phaser.Scene {
|
|||||||
.setInteractive()
|
.setInteractive()
|
||||||
.setOrigin(0)
|
.setOrigin(0)
|
||||||
.on('pointerdown', () => {
|
.on('pointerdown', () => {
|
||||||
const playerCryps = [];
|
this.game.events.emit('SET_PLAYER', player);
|
||||||
this.activeCryps.forEach(obj => playerCryps.push(obj.cryp.id));
|
|
||||||
ws.sendPlayerCrypsSet(player.instance, playerCryps);
|
|
||||||
});
|
});
|
||||||
this.add
|
this.add
|
||||||
.text(joinNormal.getCenter().x, joinNormal.getCenter().y, `${player.instance}`, TEXT.NORMAL)
|
.text(joinNormal.getCenter().x, joinNormal.getCenter().y, `${player.instance}`, TEXT.NORMAL)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user