changed 'collision' to 'tiles' layer name in levels

This commit is contained in:
Jeena 2014-11-15 13:17:41 +01:00
parent a70ca6d8fb
commit 522b5092f5
4 changed files with 20 additions and 5 deletions

View file

@ -17,7 +17,7 @@ define([
this.layerMapping = { this.layerMapping = {
tiles: this.createTiles.bind(this), tiles: this.createTiles.bind(this),
collision: this.createTiles.bind(this), //collision: this.createTiles.bind(this), collision renamed to tiles
items: this.createItems.bind(this), items: this.createItems.bind(this),
spawnpoints: this.createSpawnPoints.bind(this) spawnpoints: this.createSpawnPoints.bind(this)
}; };
@ -32,7 +32,7 @@ define([
TiledLevel.prototype.setup = function(levelData) { TiledLevel.prototype.setup = function(levelData) {
this.levelData = levelData; this.levelData = levelData;
// Make sure spawnpoints layer is created first // Make sure spawnpoints layer is created first because of add before and behind
var layers = levelData.layers.sort(function(a, b) { var layers = levelData.layers.sort(function(a, b) {
return a.name == "spawnpoints" ? -1 : b.name == "spawnpoints" ? 1 : 0; return a.name == "spawnpoints" ? -1 : b.name == "spawnpoints" ? 1 : 0;
}); });
@ -50,6 +50,21 @@ define([
Parent.prototype.setup.call(this, levelData); Parent.prototype.setup.call(this, levelData);
}; };
/*
TiledLevel.prototype.addBackground = function(path) {
var texturePath = Settings.GRAPHICS_PATH + "Backgrounds/starnight.png";
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.createTiles = function(options) { TiledLevel.prototype.createTiles = function(options) {
console.log('core tiledlevel createTiles'); console.log('core tiledlevel createTiles');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long