working layers - still needs parallax support

This commit is contained in:
logsol 2014-08-31 17:50:55 +02:00
parent 222fd09f3f
commit a70ca6d8fb
8 changed files with 77 additions and 32 deletions

View file

@ -89,13 +89,14 @@ function (Parent, Settings, Nc, PIXI, AbstractLayer) {
};
Level.prototype.createItems = function(options) {
options.layer = AbstractLayer.ID.ITEM;
Nc.trigger(Nc.ns.client.view.layer.createAndInsert, options.layer, 1, AbstractLayer.ID.SPAWN, true);
options.layerId = AbstractLayer.ID.ITEM;
Nc.trigger(Nc.ns.client.view.layer.createAndInsert, options.layerId, 1, AbstractLayer.ID.SPAWN, true);
Parent.prototype.createItems.call(this, options);
};
Level.prototype.createTiles = function(options) {
console.log('client level createTiles');
options.layerId = AbstractLayer.ID.TILE;
Nc.trigger(Nc.ns.client.view.layer.createAndInsert, options.layerId, 1, AbstractLayer.ID.SPAWN, true);
@ -106,7 +107,7 @@ function (Parent, Settings, Nc, PIXI, AbstractLayer) {
options.layerId = AbstractLayer.ID.SPAWN;
Nc.trigger(Nc.ns.client.view.layer.createAndInsert, options.layerId, 1);
Parent.prototype.createTiles.call(this, options);
Parent.prototype.createSpawnPoints.call(this, options);
};
return Level;

View file

@ -6,8 +6,8 @@ define([
function (Parent, Settings) {
function TiledLevel(uid, engine, gameObjects) {
Parent.call(this, uid, engine, gameObjects);
this.layerId = "background";
Parent.call(this, uid, engine, gameObjects);
}
TiledLevel.prototype = Object.create(Parent.prototype);