Working on fixing enemy identification

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-14 21:06:31 +01:00
parent 12e2e7e3a8
commit 1ec891d9a0
18 changed files with 293 additions and 292 deletions

View File

@@ -1,7 +1,6 @@
import 'dart:convert';
import 'dart:typed_data';
import 'package:wolf_3d_data/wolf_3d_data.dart';
import 'package:wolf_dart/features/entities/map_objects.dart';
import 'package:wolf_dart/features/map/wolf_level.dart';
@@ -40,10 +39,6 @@ abstract class WolfMapParser {
int plane0Length = gameMaps.getUint16(mapOffset + 12, Endian.little);
int plane1Length = gameMaps.getUint16(mapOffset + 14, Endian.little);
// Dimensions (Always 64x64, but we read it anyway for accuracy)
int width = gameMaps.getUint16(mapOffset + 18, Endian.little);
int height = gameMaps.getUint16(mapOffset + 20, Endian.little);
// Map Name (16 bytes of ASCII text)
List<int> nameBytes = [];
for (int n = 0; n < 16; n++) {
@@ -86,25 +81,23 @@ abstract class WolfMapParser {
}
}
Sprite wallGrid = [];
Sprite objectGrid = []; // NEW
List<List<int>> wallGrid = [];
List<List<int>> objectGrid = [];
for (int y = 0; y < height; y++) {
for (int y = 0; y < 64; y++) {
List<int> wallRow = [];
List<int> objectRow = []; // NEW
for (int x = 0; x < width; x++) {
wallRow.add(flatWallGrid[y * width + x]);
objectRow.add(flatObjectGrid[y * width + x]); // NEW
List<int> objectRow = [];
for (int x = 0; x < 64; x++) {
wallRow.add(flatWallGrid[y * 64 + x]);
objectRow.add(flatObjectGrid[y * 64 + x]);
}
wallGrid.add(wallRow);
objectGrid.add(objectRow); // NEW
objectGrid.add(objectRow);
}
levels.add(
WolfLevel(
name: name,
width: width,
height: height,
wallGrid: wallGrid,
objectGrid: objectGrid,
),