pve and pvp back

This commit is contained in:
ntr
2018-11-21 16:32:39 +11:00
parent 4d648c8fe7
commit 41c7c790f2
5 changed files with 52 additions and 49 deletions
+6 -2
View File
@@ -17,6 +17,8 @@ class Lobbies extends Phaser.GameObjects.Group {
super(list);
this.keyboard = list.input.keyboard;
const ws = list.registry.get('ws');
const X_POS = ROW_WIDTH + 50;
const pvp = list.add
@@ -36,11 +38,13 @@ class Lobbies extends Phaser.GameObjects.Group {
.add(list.add.text(pve.getCenter().x, pve.getCenter().y, 'PVE', TEXT.HEADER));
pvp.on('pointerdown', () => {
console.log(cryps.filter(c => c.active));
const team = cryps.filter(c => c.active).map(c => c.id);
return ws.sendGamePvp(team);
});
pve.on('pointerdown', () => {
console.log(cryps.filter(c => c.active));
const team = cryps.filter(c => c.active).map(c => c.id);
return ws.sendGamePve(team);
});
this.add(pve);