mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
fixed #91 crash after round end
This commit is contained in:
parent
b92cce88f2
commit
4f3a53ca53
6 changed files with 15 additions and 18 deletions
|
|
@ -25,8 +25,8 @@ function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioPlayer.prototype.stop = function() {
|
AudioPlayer.prototype.stop = function() {
|
||||||
this.audio.stop();
|
//this.audio.stop();
|
||||||
this.doPlay = false;
|
//this.doPlay = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
AudioPlayer.prototype.destroy = function() {
|
AudioPlayer.prototype.destroy = function() {
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Networker.prototype.onEndRound = function() {
|
Networker.prototype.onEndRound = function() {
|
||||||
this.gameController.toggleInfo(true);
|
this.gameController.toggleGameStats(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
return Networker;
|
return Networker;
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ function (Abstract) {
|
||||||
current: { x: 0, y: 0},
|
current: { x: 0, y: 0},
|
||||||
target: { x: 0, y: 0}
|
target: { x: 0, y: 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.ncTokens = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.defineProperty(Layer, 'ID', {
|
Object.defineProperty(Layer, 'ID', {
|
||||||
|
|
@ -49,5 +51,9 @@ function (Abstract) {
|
||||||
this.zoom.target = z;
|
this.zoom.target = z;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Layer.prototype.destroy = function() {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
return Layer;
|
return Layer;
|
||||||
});
|
});
|
||||||
|
|
@ -161,6 +161,10 @@ function (Nc, Exception, Layer) {
|
||||||
for (var i = 0; i < this.ncTokens.length; i++) {
|
for (var i = 0; i < this.ncTokens.length; i++) {
|
||||||
Nc.off(this.ncTokens[i]);
|
Nc.off(this.ncTokens[i]);
|
||||||
};
|
};
|
||||||
|
for (var i = this.layers.length - 1; i >= 0; i--) {
|
||||||
|
var layer = this.layers[i];
|
||||||
|
layer.destroy();
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
return LayerManager;
|
return LayerManager;
|
||||||
|
|
|
||||||
|
|
@ -179,14 +179,4 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return Layer;
|
return Layer;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
1 = this.zoom.current ? -1
|
|
||||||
|
|
||||||
1 = this.zoom.current * (-1) * (-1)
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
@ -168,11 +168,8 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer
|
||||||
|
|
||||||
PixiView.prototype.destroy = function() {
|
PixiView.prototype.destroy = function() {
|
||||||
|
|
||||||
this.layerManager.destroy();
|
this.layerManager.destroy(); // also calls all layers destroy
|
||||||
|
|
||||||
this.ghostLayer.destroy();
|
|
||||||
this.swiperLayer.destroy();
|
|
||||||
|
|
||||||
for (var i = 0; i < this.stage.children.length; i++) {
|
for (var i = 0; i < this.stage.children.length; i++) {
|
||||||
this.stage.removeChild(this.stage.children[i]);
|
this.stage.removeChild(this.stage.children[i]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue