mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
fixed #53
This commit is contained in:
parent
695008afd8
commit
aa4535cb0c
10 changed files with 73 additions and 32 deletions
|
|
@ -68,6 +68,25 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Notificat
|
|||
this.onWorldUpdate(options.worldUpdate);
|
||||
}
|
||||
|
||||
if (options.runtimeItems) {
|
||||
for (var i = 0; i < options.runtimeItems.length; i++) {
|
||||
var itemDef = options.runtimeItems[i];
|
||||
|
||||
var alreadyExists = false;
|
||||
for (var i = 0; i < this.gameObjects.animated.length; i++) {
|
||||
if(this.gameObjects.animated[i].uid == itemDef.uid) {
|
||||
alreadyExists = true;
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
if(!alreadyExists) {
|
||||
var item = this.level.createItem(itemDef.uid, itemDef.options);
|
||||
this.onGameObjectAdd("animated", item);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
this.createMe(options.userId);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue