diff --git a/app/Game/Client/Loader/Level.js b/app/Game/Client/Loader/Level.js index c50dc33..5e4315d 100755 --- a/app/Game/Client/Loader/Level.js +++ b/app/Game/Client/Loader/Level.js @@ -90,37 +90,8 @@ function (Parent, Settings, Nc, PIXI, AbstractLayer) { Level.prototype.setupLayer = function(options, behind, referenceId) { Parent.prototype.setupLayer.call(this, options, behind, referenceId); - console.log(options.layerId, behind, referenceId); Nc.trigger(Nc.ns.client.view.layer.createAndInsert, options.layerId, 1, behind, referenceId); }; -/* - Level.prototype.createItems = function(options) { - 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); - - Parent.prototype.createTiles.call(this, options); - }; - - Level.prototype.createSpawnPoints = function(options) { - options.layerId = AbstractLayer.ID.SPAWN; - Nc.trigger(Nc.ns.client.view.layer.createAndInsert, options.layerId, 1); - - Parent.prototype.createSpawnPoints.call(this, options); - }; - - Level.prototype.createContainer = function(options) { - - Parent.prototype.createContainer.call(this, options); - }; -*/ return Level; }); \ No newline at end of file diff --git a/app/Game/Client/Loader/TiledLevel.js b/app/Game/Client/Loader/TiledLevel.js index c4560e1..56224da 100644 --- a/app/Game/Client/Loader/TiledLevel.js +++ b/app/Game/Client/Loader/TiledLevel.js @@ -74,36 +74,25 @@ function (Parent, Settings, Nc) { var callback = function(mesh) { Nc.trigger(Nc.ns.client.view.mesh.add, options.layerId, mesh); + Nc.trigger(Nc.ns.client.view.mesh.update, options.layerId, mesh, { + x: Settings.STAGE_WIDTH / 2, + y: Settings.STAGE_HEIGHT / 2, + pivot: { + x: mesh.texture.width / 2, + y: mesh.texture.height / 2 + } + }); } Nc.trigger(Nc.ns.client.view.mesh.create, options.layerId, texturePath, - callback, - { - x: 200 - } + callback ); } }; - TiledLevel.prototype.addBackground = function(options) { - var texturePath = Settings.GRAPHICS_PATH + options.image; - -/* - var callback = function (mesh) { - Nc.trigger(Nc.ns.client.view.mesh.add, mesh, 0); // FIXME: add at z layer -1 or so - } - Nc.trigger(Nc.ns.client.view.mesh.create, texturePath, callback, { - width: 4000, - height: 2959, - x: -(4000 - Settings.STAGE_WIDTH) / 2, - y: -(2959 + Settings.STAGE_HEIGHT + 700) / 2 - }); -*/ - } - TiledLevel.prototype.getLayer = function(levelData, name) { for (var i = 0; i < levelData.layers.length; i++) { if(levelData.layers[i].name === name) { diff --git a/app/Game/Client/View/LayerManager.js b/app/Game/Client/View/LayerManager.js index 06c1dc9..02996c7 100644 --- a/app/Game/Client/View/LayerManager.js +++ b/app/Game/Client/View/LayerManager.js @@ -53,8 +53,6 @@ function (Nc, Exception, Layer) { this.layers.splice(layerIndex, 0, layer); this.rearrangeLayers(); - - console.log(this.layers.map(function(o) {return o.name})) }; LayerManager.prototype.rearrangeLayers = function() { diff --git a/app/Game/Core/Loader/TiledLevel.js b/app/Game/Core/Loader/TiledLevel.js index 2a97f60..bd31115 100755 --- a/app/Game/Core/Loader/TiledLevel.js +++ b/app/Game/Core/Loader/TiledLevel.js @@ -56,7 +56,7 @@ define([ } var spawnpointsFound = false, - lastLayerId; + lastLayerId = null; // from spawnpoints to background for (var i = levelData.layers.length - 1; i >= 0; i--) {