pve and pvp back
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user