implemented level restart

This commit is contained in:
Jeena 2014-01-12 04:33:08 +01:00
parent 81611050d2
commit 3edd664412
12 changed files with 104 additions and 47 deletions

View file

@ -1,9 +1,10 @@
define([
"Game/Core/GameObjects/GameObject",
"Lib/Utilities/Exception"
"Lib/Utilities/Exception",
"Lib/Utilities/NotificationCenter"
],
function (Parent, Exception) {
function (Parent, Exception, NotificationCenter) {
function GameObject(physicsEngine, uid) {
Parent.call(this, physicsEngine, uid);
@ -14,7 +15,6 @@ function (Parent, Exception) {
GameObject.prototype = Object.create(Parent.prototype);
GameObject.prototype.destroy = function() {
// view ...
Parent.prototype.destroy.call(this);
};

View file

@ -36,6 +36,11 @@ function (Parent, Settings, NotificationCenter) {
);
};
Item.prototype.destroy = function() {
NotificationCenter.trigger("view/removeMesh", this.mesh);
Parent.prototype.destroy.call(this);
};
Item.prototype.render = function() {
NotificationCenter.trigger("view/updateMesh",

View file

@ -37,6 +37,11 @@ function (Parent, Settings, NotificationCenter) {
);
};
Tile.prototype.destroy = function() {
NotificationCenter.trigger("view/removeMesh", this.mesh);
Parent.prototype.destroy.call(this);
};
Tile.prototype.render = function() {
NotificationCenter.trigger("view/updateMesh",