no more scene restarts monkaS
This commit is contained in:
parent
d4bcaa244c
commit
7c74018dbf
@ -9,16 +9,14 @@ class CrypList extends Phaser.Scene {
|
|||||||
|
|
||||||
create() {
|
create() {
|
||||||
this.registry.events.on('changedata', this.updateData, this);
|
this.registry.events.on('changedata', this.updateData, this);
|
||||||
|
|
||||||
const cryps = this.registry.get('cryps');
|
|
||||||
this.graphics = this.add.graphics();
|
this.graphics = this.add.graphics();
|
||||||
this.renderCryps(cryps);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateData(parent, key, data) {
|
updateData(parent, key, data) {
|
||||||
if (key === 'cryps') {
|
if (key === 'cryps') {
|
||||||
return this.scene.restart();
|
this.renderCryps(data);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -32,14 +30,14 @@ class CrypList extends Phaser.Scene {
|
|||||||
this.destroyText();
|
this.destroyText();
|
||||||
this.graphics.clear();
|
this.graphics.clear();
|
||||||
|
|
||||||
const crypRows = cryps.forEach((cryp, i) => {
|
cryps.forEach((cryp, i) => {
|
||||||
crypRow(this, cryp, i);
|
crypRow(this, cryp, i);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.input.on('gameobjectup', this.clickHandler, this);
|
this.input.on('gameobjectup', this.clickHandler, this);
|
||||||
|
|
||||||
// seal the boxes in and stop rerendering them
|
// seal the boxes in and stop rerendering them
|
||||||
// this.graphics.generateTexture();
|
this.graphics.generateTexture();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user