mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
During first worldUpdate set doll positions after spawning players
Otherwise we get a warning.
This commit is contained in:
parent
a5f828a861
commit
016c48ec3b
2 changed files with 5 additions and 5 deletions
|
|
@ -78,10 +78,6 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
|
||||||
GameController.prototype.onClientReadyResponse = function(options) {
|
GameController.prototype.onClientReadyResponse = function(options) {
|
||||||
var i;
|
var i;
|
||||||
|
|
||||||
if (options.worldUpdate) {
|
|
||||||
this.onWorldUpdate(options.worldUpdate);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.runtimeItems) {
|
if (options.runtimeItems) {
|
||||||
for (i = 0; i < options.runtimeItems.length; i++) {
|
for (i = 0; i < options.runtimeItems.length; i++) {
|
||||||
|
|
||||||
|
|
@ -107,6 +103,10 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Nc, reque
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.worldUpdate) { // needs to stay after onSpawnPlayer otherwise others doll will not be there
|
||||||
|
this.onWorldUpdate(options.worldUpdate);
|
||||||
|
}
|
||||||
|
|
||||||
//this.audioPlayer = new AudioPlayer(Settings.AUDIO_PATH + "city.mp3");
|
//this.audioPlayer = new AudioPlayer(Settings.AUDIO_PATH + "city.mp3");
|
||||||
//this.audioPlayer.play();
|
//this.audioPlayer.play();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ function (PhysicsEngine, TiledLevel, Player, Nc, Doll, GameObject, Item, Assert)
|
||||||
var gameObject = this.worldUpdateObjects[uid];
|
var gameObject = this.worldUpdateObjects[uid];
|
||||||
|
|
||||||
if (!(gameObject instanceof GameObject)) {
|
if (!(gameObject instanceof GameObject)) {
|
||||||
console.warn('Cant find object ' + uid + ' in worldUpdateObjects pool');
|
console.warn('Can\'t find object ' + uid + ' in worldUpdateObjects pool:', Object.keys(this.worldUpdateObjects));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue