Fixed player set

This commit is contained in:
Mashy 2019-02-28 20:51:45 +10:00
parent 8c89bd6841
commit 8abe18b0f1
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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)