This commit is contained in:
logsol 2014-03-17 21:58:54 +01:00
commit f7ca9d2393
23 changed files with 69 additions and 67 deletions

View file

@ -16,10 +16,10 @@ function (PhysicsEngine, TiledLevel, Player, Nc) {
this.physicsEngine = new PhysicsEngine();
this.physicsEngine.setCollisionDetector();
Nc.on("game/level/loaded", this.onLevelLoaded, this);
Nc.on(Nc.ns.core.game.events.level.loaded, this.onLevelLoaded, this);
Nc.on("game/object/add", this.onGameObjectAdd, this);
Nc.on("game/object/remove", this.onGameObjectRemove, this);
Nc.on(Nc.ns.core.game.gameObject.add, this.onGameObjectAdd, this);
Nc.on(Nc.ns.core.game.gameObject.remove, this.onGameObjectRemove, this);
this.update();
}

View file

@ -163,7 +163,7 @@ function (Parent, Box2D, Settings, Nc) {
);
Nc.trigger("game/object/add", 'animated', this);
Nc.trigger(Nc.ns.core.game.gameObject.add, 'animated', this);
}
RagDoll.prototype = Object.create(Parent.prototype);
@ -362,7 +362,7 @@ function (Parent, Box2D, Settings, Nc) {
};
RagDoll.prototype.destroy = function() {
Nc.trigger("game/object/remove", 'animated', this);
Nc.trigger(Nc.ns.core.game.gameObject.remove, 'animated', this);
var world = this.body.GetWorld();
Parent.prototype.destroy.call(this);

View file

@ -28,7 +28,7 @@ define([
self.createTiles();
self.createItems();
self.isLoaded = true;
Nc.trigger("game/level/loaded");
Nc.trigger(Nc.ns.core.game.events.level.loaded);
});
}

View file

@ -40,7 +40,7 @@ function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) {
this.doll = new Doll(this.physicsEngine, "doll-" + this.id, this);
this.doll.spawn(x, y);
this.isSpawned = true;
Nc.trigger("game/object/add", 'animated', this.doll);
Nc.trigger(Nc.ns.core.game.gameObject.add, 'animated', this.doll);
}
Player.prototype.getPosition = function () {
@ -120,7 +120,7 @@ function (Doll, Settings, Nc, Exception, SpectatorDoll, RagDoll) {
this.isSpawned = false;
Nc.trigger("game/object/remove", 'animated', this.doll);
Nc.trigger(Nc.ns.core.game.gameObject.remove, 'animated', this.doll);
this.doll.destroy();
this.doll = null;