sql stuff

This commit is contained in:
ntr
2018-11-22 12:11:16 +11:00
parent 421987c53b
commit 992b6ecd7d
6 changed files with 129 additions and 11 deletions
+16 -6
View File
@@ -22,26 +22,34 @@ class GameList extends Phaser.GameObjects.Group {
const WIDTH = GAME_LIST.width();
const HEIGHT = GAME_LIST.height();
console.log(GAME_LIST.y(0))
const pvp = list.add
.rectangle(X, GAME_LIST.y(0), WIDTH, HEIGHT, 0x440000)
.setInteractive()
.setOrigin(0);
this
.add(list.add.text(pvp.getCenter().x, pvp.getCenter().y, 'PVP', TEXT.HEADER));
.add(list.add.text(pvp.getCenter().x, pvp.getCenter().y, 'NEW', TEXT.HEADER));
const pve = list.add
.rectangle(X, GAME_LIST.y(1), WIDTH, HEIGHT, 0x004400)
.rectangle(X, GAME_LIST.y(1), Math.floor(WIDTH / 2), HEIGHT, 0x004400)
.setInteractive()
.setOrigin(0);
this
.add(list.add.text(pve.getCenter().x, pve.getCenter().y, 'PVE', TEXT.HEADER));
const refresh = list.add
.rectangle(X + Math.floor(WIDTH / 2), GAME_LIST.y(1), Math.floor(WIDTH / 2), HEIGHT, 0x000044)
.setInteractive()
.setOrigin(0);
this
.add(list.add.text(refresh.getCenter().x, refresh.getCenter().y, 'REFRESH', TEXT.HEADER));
pvp.on('pointerdown', () => {
const team = cryps.filter(c => c.active).map(c => c.id);
list.scene.switch('Combat');
return ws.sendGamePvp(team);
});
@@ -51,8 +59,10 @@ class GameList extends Phaser.GameObjects.Group {
return ws.sendGamePve(team);
});
this.add(pve);
this.add(pvp);
refresh.on('pointerdown', () => {
return ws.sendGameJoinableList();
});
return true;
}