mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
implemented level load, more to do see #1
This commit is contained in:
parent
b02036a019
commit
953159e6bd
12 changed files with 333 additions and 409 deletions
|
|
@ -1,23 +1,23 @@
|
|||
define([
|
||||
"Game/Core/Loader/Level",
|
||||
"Game/Config/Settings"
|
||||
"Game/Config/Settings",
|
||||
"fs"
|
||||
],
|
||||
|
||||
function (Parent, Fs) {
|
||||
function (Parent, Settings, fs) {
|
||||
|
||||
function Level () {
|
||||
Parent.call(this);
|
||||
function Level (uid, engine, gameObjects) {
|
||||
Parent.call(this, uid, engine, gameObjects);
|
||||
}
|
||||
|
||||
Level.prototype = Object.create(Parent.prototype);
|
||||
|
||||
Level.prototype.loadLevelObjectFromPath = function (path, callback) {
|
||||
Level.prototype.loadLevelDataFromPath = function (path, callback) {
|
||||
// overwriting parent
|
||||
|
||||
fs.readFile( + path, function (err, data) {
|
||||
fs.readFile(path, "utf8", function (err, data) {
|
||||
if (err) throw err;
|
||||
callback(data);
|
||||
callback(JSON.parse(data));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue