Fixed sprite lookups

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-13 18:56:43 +01:00
parent bf8d9d7eb1
commit 827d858f0f
10 changed files with 51 additions and 35 deletions

View File

@@ -18,7 +18,7 @@ class WolfMap {
);
/// Asynchronously loads the map files and parses them into a new WolfMap instance.
static Future<WolfMap> load() async {
static Future<WolfMap> loadDemo() async {
// 1. Load the binary data
final mapHead = await rootBundle.load("assets/MAPHEAD.WL1");
final gameMaps = await rootBundle.load("assets/GAMEMAPS.WL1");
@@ -36,4 +36,24 @@ class WolfMap {
parsedSprites,
);
}
/// Asynchronously loads the map files and parses them into a new WolfMap instance.
static Future<WolfMap> load() async {
// 1. Load the binary data
final mapHead = await rootBundle.load("assets/MAPHEAD.WL6");
final gameMaps = await rootBundle.load("assets/GAMEMAPS.WL6");
final vswap = await rootBundle.load("assets/VSWAP.WL6");
// 2. Parse the data using the parser we just built
final parsedLevels = WolfMapParser.parseMaps(mapHead, gameMaps);
final parsedTextures = VswapParser.parseWalls(vswap);
final parsedSprites = VswapParser.parseSprites(vswap);
// 3. Return the populated instance!
return WolfMap._(
parsedLevels,
parsedTextures,
parsedSprites,
);
}
}