mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
This commit is contained in:
parent
039213cf50
commit
55256ada95
23 changed files with 409 additions and 110 deletions
|
|
@ -10,11 +10,10 @@ define([
|
|||
|
||||
], function (Settings, Box2D, Nc, CollisionDetector, Tile, Item, Skateboard, RagDoll) {
|
||||
|
||||
function Level (uid, engine, gameObjects) {
|
||||
function Level (uid, engine) {
|
||||
this.uid = uid;
|
||||
this.engine = engine;
|
||||
this.levelObject = null;
|
||||
this.gameObjects = gameObjects;
|
||||
this.isLoaded = false;
|
||||
this.load(this.uid);
|
||||
}
|
||||
|
|
@ -32,11 +31,13 @@ define([
|
|||
}
|
||||
|
||||
Level.prototype.destroy = function () {
|
||||
/*
|
||||
for (var key in this.gameObjects) {
|
||||
for (var i = 0; i < this.gameObjects[key].length; i++) {
|
||||
this.gameObjects[key][i].destroy();
|
||||
}
|
||||
}
|
||||
*/
|
||||
this.isLoaded = false;
|
||||
}
|
||||
|
||||
|
|
@ -52,7 +53,9 @@ define([
|
|||
var options = tiles[i];
|
||||
//options.m = this.tileAtPositionExists(options.x, options.y - 1) ? "Soil" : "GrassSoil";
|
||||
options.m = "Soil";
|
||||
this.gameObjects.fixed.push(new Tile(this.engine, "tile-" + i, options));
|
||||
//this.gameObjects.fixed.push(
|
||||
new Tile(this.engine, "tile-" + i, options);
|
||||
//);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -66,7 +69,7 @@ define([
|
|||
var options = items[i];
|
||||
var uid = "item-" + i;
|
||||
var item = this.createItem(uid, options);
|
||||
this.gameObjects.animated.push(item); // FIXME: use Nc
|
||||
//this.gameObjects.animated.push(item);
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ define([
|
|||
], function (Parent, Settings, ItemSettings, Box2D, Options, Exception, CollisionDetector, Tile, Item, Skateboard) {
|
||||
|
||||
// Public
|
||||
function TiledLevel (path, engine, gameObjects) {
|
||||
function TiledLevel (path, engine) {
|
||||
|
||||
this.levelData = null;
|
||||
Parent.call(this, path, engine, gameObjects);
|
||||
Parent.call(this, path, engine);
|
||||
}
|
||||
|
||||
TiledLevel.prototype = Object.create(Parent.prototype);
|
||||
|
|
@ -51,7 +51,9 @@ define([
|
|||
y: parseInt(i / collisionLayer.height , 10)
|
||||
}
|
||||
|
||||
this.gameObjects.fixed.push(new Tile(this.engine, "tile-" + i, options));
|
||||
//this.gameObjects.fixed.push(
|
||||
new Tile(this.engine, "tile-" + i, options);
|
||||
//);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
@ -69,7 +71,7 @@ define([
|
|||
|
||||
var uid = "item-" + i;
|
||||
var item = this.createItem(uid, options);
|
||||
this.gameObjects.animated.push(item);
|
||||
//this.gameObjects.animated.push(item);
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue