mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
layer bugfixing
This commit is contained in:
parent
d29c64385d
commit
1d3ad16a07
9 changed files with 56 additions and 9 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ define([
|
|||
};
|
||||
|
||||
Level.prototype.createItem = function(uid, options) {
|
||||
|
||||
switch(options.type) {
|
||||
//case 'skateboard':
|
||||
// return new Skateboard(this.engine, uid, options);
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue