new system for synchronizing game objects. fixes #74

This commit is contained in:
logsol 2015-06-22 00:14:17 +02:00
parent 3ef3a6abf9
commit 07dad646cf
19 changed files with 194 additions and 162 deletions

View file

@ -27,7 +27,7 @@ function (Parent, Exception, Nc) {
GameObject.prototype.createMesh = function() {
throw new Exception('Abstract method GameObject.createMesh not overwritten');
};
return GameObject;
});

View file

@ -12,6 +12,8 @@ function (Parent, Settings, Nc, Layer) {
function Item(physicsEngine, uid, options) {
this.layerId = Layer.ID.ITEM;
Parent.call(this, physicsEngine, uid, options);
Nc.on(Nc.ns.client.game.events.render, this.render, this);
}
Item.prototype = Object.create(Parent.prototype);

View file

@ -189,8 +189,6 @@ function (Parent, Layer, Settings, Nc) {
RubeDoll.prototype.flip = function(direction) {
Parent.prototype.flip.call(this, direction);
console.log("last", this.lastFlipDirection, "now", direction);
// flipping depth of right body side arm/leg images with left
if (this.lastFlipDirection != direction) { // FIXME : this is a bit broken.