first attempt to implement GameObject

This commit is contained in:
Jeena 2013-12-19 15:16:15 +01:00
parent aa30a23ca1
commit fe0d4a66e2
14 changed files with 328 additions and 129 deletions

View file

@ -0,0 +1,31 @@
define([
"Game/Core/GameObjects/GameObject"
],
function(Parent) {
function GameObject(physicsEngine, view) {
this.view = view;
Parent.call(this, physicsEngine);
this.createMesh();
this.render();
}
GameObject.prototype = Object.create(Parent.prototype);
GameObject.prototype.destroy = function() {
// view ...
Parent.prototype.destroy.call(this);
};
GameObject.prototype.render = function() {
throw new Exception('Abstract method GameObject.render not overwritten');
}
GameObject.prototype.createMesh = function() {
throw new Exception('Abstract method GameObject.getMesh not overwritten');
};
return GameObject;
});