layer bugfixing

This commit is contained in:
logsol 2014-08-30 10:29:58 +02:00
parent d29c64385d
commit 1d3ad16a07
9 changed files with 56 additions and 9 deletions

View file

@ -27,7 +27,7 @@ function (Parent, Box2D, Options, Settings, Exception, Nc) {
if(!this.options.category) {
// FIXME add more validation
console.warn('item category empty (' + this.options.name + ')' );
//console.warn('item category empty (' + this.options.name + ')' );
}
Parent.call(this, physicsEngine, uid);

View file

@ -42,6 +42,7 @@ define([
};
Level.prototype.createItem = function(uid, options) {
switch(options.type) {
//case 'skateboard':
// return new Skateboard(this.engine, uid, options);

View file

@ -17,6 +17,7 @@ define([
this.layerMapping = {
tiles: this.createTiles.bind(this),
collision: this.createTiles.bind(this),
items: this.createItems.bind(this),
spawnpoints: this.createSpawnPoints.bind(this)
};
@ -34,7 +35,10 @@ define([
var layerOptions = levelData.layers[i];
layerOptions.z = i;
if(this.layerMapping[layerOptions.name]) {
this.layerMapping[layerOptions.name](layerOptions);
} else {
console.warn('No layerMapping for level file layer: ' + layerOptions.name);
}
};
@ -87,7 +91,7 @@ define([
return { x: o.x, y: o.y };
});
Parent.prototype.createSpawnPoints(this, points);
Parent.prototype.createSpawnPoints.call(this, points);
};
TiledLevel.prototype.gatherOptions = function(tiledObject) {