mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
implemented clientReady and changed loading of assets, fixed unique ragdoll id
This commit is contained in:
parent
f578b92734
commit
695008afd8
278 changed files with 306 additions and 287 deletions
|
|
@ -1,9 +1,50 @@
|
|||
define([
|
||||
"Game/Core/Loader/TiledLevel"
|
||||
"Game/Core/Loader/TiledLevel",
|
||||
"Game/Config/Settings"
|
||||
],
|
||||
|
||||
function (Parent) {
|
||||
function (Parent, Settings) {
|
||||
|
||||
function TiledLevel(uid, engine, gameObjects) {
|
||||
Parent.call(this, uid, engine, gameObjects);
|
||||
}
|
||||
|
||||
return Parent;
|
||||
TiledLevel.prototype = Object.create(Parent.prototype);
|
||||
|
||||
TiledLevel.prototype.getAssetPaths = function(levelData) {
|
||||
var paths = Parent.prototype.getAssetPaths.call(this, levelData);
|
||||
|
||||
// Get tiles images
|
||||
for (var i = 0; i < levelData.tilesets.length; i++) {
|
||||
var tileset = levelData.tilesets[i];
|
||||
for (var key in tileset.tiles) {
|
||||
var imagePpath = tileset.tiles[key].image;
|
||||
if(imagePpath) {
|
||||
paths.push(Settings.MAPS_PATH + imagePpath);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Get items images
|
||||
var objects = this.getLayer(levelData, "items").objects;
|
||||
for (var i = 0; i < objects.length; i++) {
|
||||
var object = objects[i];
|
||||
var options = object.properties;
|
||||
|
||||
var texturePath = Settings.GRAPHICS_PATH
|
||||
+ Settings.GRAPHICS_SUBPATH_ITEMS
|
||||
+ options.category + '/'
|
||||
+ options.image;
|
||||
|
||||
paths.push(texturePath);
|
||||
};
|
||||
|
||||
// FIXME: Get background image
|
||||
|
||||
return paths;
|
||||
|
||||
}
|
||||
|
||||
return TiledLevel;
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue