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:
Karl Pannek 2025-07-16 12:51:31 +02:00
parent e6089687ed
commit 244dc50037
8 changed files with 336 additions and 6 deletions

View file

@ -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);
}
};
/*