more zone stuff

This commit is contained in:
ntr
2018-12-29 23:38:42 +11:00
parent eb543fffb6
commit 28bda483f1
6 changed files with 136 additions and 33 deletions
+1 -1
View File
@@ -124,7 +124,7 @@ class MenuGameList extends Phaser.Scene {
zones.on('pointerdown', () => {
this.scene.add('Missions', Missions, true);
return ws.sendZoneCreate();
return ws.sendAccountZone();
});
+6 -2
View File
@@ -16,16 +16,20 @@ class Missions extends Phaser.Scene {
}
create() {
const zone = this.registry.get('zone');
if (!zone) return false;
this.scene.manager.add('MissionControls', MissionControls, true);
this.graphics = this.add.graphics();
const nodeData = this.registry.get('zone').nodes;
this.edgeData = this.registry.get('zone').edges.map(x => x.map(y => nodeData[y]));
const nodeData = zone.graph.nodes;
this.edgeData = zone.graph.edges.map(x => x.map(y => nodeData[y]));
this.cameras.main.setViewport(COMBAT.width() * 0.2, COMBAT.y(),
COMBAT.width() * 0.8, COMBAT.height());
this.addNodes(nodeData);
this.drawEdges(nodeData);
this.addCameraControl();
this.addEvents();
return this;
}
addNodes(nodeData) {
+5
View File
@@ -48,6 +48,10 @@ function createSocket(events) {
send({ method: 'account_items', params: {} });
}
function sendAccountZone() {
send({ method: 'account_zone', params: {} });
}
function sendCrypSpawn(name) {
send({ method: 'cryp_spawn', params: { name } });
}
@@ -233,6 +237,7 @@ function createSocket(events) {
sendAccountDemo,
sendAccountCryps,
sendAccountItems,
sendAccountZone,
sendGameState,
sendGamePve,
sendGamePvp,