work in progress... worked on channel attributes and game goal. fixes #45 and references #48

This commit is contained in:
logsol 2014-03-30 00:12:04 +01:00
parent 039213cf50
commit 55256ada95
23 changed files with 409 additions and 110 deletions

View file

@ -3,10 +3,11 @@ define([
"Lib/Vendor/Box2D",
"Lib/Utilities/Options",
"Game/Config/Settings",
"Lib/Utilities/Exception"
"Lib/Utilities/Exception",
"Lib/Utilities/NotificationCenter"
],
function (Parent, Box2D, Options, Settings, Exception) {
function (Parent, Box2D, Options, Settings, Exception, Nc) {
function Item(physicsEngine, uid, options) {
@ -33,6 +34,8 @@ function (Parent, Box2D, Options, Settings, Exception) {
this.createFixture();
this.body.ResetMassData();
this.flipDirection = 1;
Nc.trigger(Nc.ns.core.game.gameObject.add, 'animated', this);
}
Item.prototype = Object.create(Parent.prototype);
@ -136,6 +139,11 @@ function (Parent, Box2D, Options, Settings, Exception) {
body.SetAngularVelocity(Settings.MAX_THROW_ANGULAR_VELOCITY * x);
};
Item.prototype.destroy = function() {
Nc.trigger(Nc.ns.core.game.gameObject.remove, 'animated', this);
Parent.prototype.destroy.call(this);
};
return Item;