mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +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
|
|
@ -12,7 +12,6 @@ function (PhysicsEngine, Level, Player) {
|
|||
animated: [],
|
||||
fixed: []
|
||||
};
|
||||
this.levelPath = null;
|
||||
|
||||
this.physicsEngine = new PhysicsEngine();
|
||||
this.physicsEngine.setCollisionDetector();
|
||||
|
|
@ -28,8 +27,7 @@ function (PhysicsEngine, Level, Player) {
|
|||
return this.physicsEngine;
|
||||
}
|
||||
|
||||
GameController.prototype.loadLevel = function (path) {
|
||||
this.levelPath = path;
|
||||
GameController.prototype.loadLevel = function (levelUid) {
|
||||
|
||||
if (this.level) {
|
||||
this.level.destroy();
|
||||
|
|
@ -39,12 +37,11 @@ function (PhysicsEngine, Level, Player) {
|
|||
};
|
||||
}
|
||||
|
||||
this.level = new Level(path, this.physicsEngine, this.gameObjects);
|
||||
this.level.loadLevelInToEngine();
|
||||
this.level = new Level(levelUid, this.physicsEngine, this.gameObjects);
|
||||
}
|
||||
|
||||
GameController.prototype.onResetLevel = function() {
|
||||
this.loadLevel(this.levelPath);
|
||||
this.loadLevel(this.level.uid);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue