mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
Add working debug level with grass and soil tiles
- Created DebugLevel class that bypasses complex TiledLevel loader - Simple platform with grass tiles (10.gif) on top, soil tiles (10.gif) underneath - Fixed tile texture paths to work with MAPS_PATH - Fixed null check in User.js to prevent server crashes - Working physics collision with Box2D - Clean test environment for physics engine migration
This commit is contained in:
parent
e6089687ed
commit
244dc50037
8 changed files with 336 additions and 6 deletions
|
|
@ -1,6 +1,7 @@
|
|||
define([
|
||||
"Game/" + GLOBALS.context + "/Physics/Engine",
|
||||
"Game/" + GLOBALS.context + "/Loader/TiledLevel",
|
||||
"Game/" + GLOBALS.context + "/Loader/DebugLevel",
|
||||
"Game/" + GLOBALS.context + "/Player",
|
||||
"Lib/Utilities/NotificationCenter",
|
||||
"Game/" + GLOBALS.context + "/GameObjects/Doll",
|
||||
|
|
@ -9,7 +10,7 @@ define([
|
|||
"Lib/Utilities/Assert",
|
||||
],
|
||||
|
||||
function (PhysicsEngine, TiledLevel, Player, nc, Doll, GameObject, Item, Assert) {
|
||||
function (PhysicsEngine, TiledLevel, DebugLevel, Player, nc, Doll, GameObject, Item, Assert) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
@ -61,7 +62,14 @@ function (PhysicsEngine, TiledLevel, Player, nc, Doll, GameObject, Item, Assert)
|
|||
this.worldUpdateObjects = {};
|
||||
}
|
||||
|
||||
this.level = new TiledLevel(levelUid, this.physicsEngine);
|
||||
// Use DebugLevel for debug mode, otherwise use TiledLevel
|
||||
if (levelUid === "debug") {
|
||||
console.log("Loading debug level (simple platform)");
|
||||
this.level = new DebugLevel(levelUid, this.physicsEngine);
|
||||
} else {
|
||||
console.log("Loading tiled level: " + levelUid);
|
||||
this.level = new TiledLevel(levelUid, this.physicsEngine);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue