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);
+2 -2
View File
@@ -128,8 +128,8 @@ function createSocket(store) {
send({ method: 'game_state', params: { id } });
}
function sendGamePve(id) {
send({ method: 'game_pve', params: { id } });
function sendGamePve(crypIds) {
send({ method: 'game_pve', params: { cryp_ids: crypIds } });
}
function sendGamePvp(crypIds) {