Re-added the sprite screen. Made some adjustments to enemy AI.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-15 18:08:00 +01:00
parent 2892984e4e
commit 25c08dfe99
12 changed files with 163 additions and 117 deletions

View File

@@ -18,16 +18,24 @@ class SpriteGallery extends StatelessWidget {
backgroundColor: Colors.black,
body: GridView.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 8, // 8 sprites per row
crossAxisCount: 8,
),
itemCount: sprites.length,
itemBuilder: (context, index) {
// --- Check which enemy owns this sprite ---
String label = "Idx: $index";
String label = "Sprite Index: $index";
for (final enemy in EnemyType.values) {
if (enemy.claimsSpriteIndex(index)) {
final EnemyAnimation? animation = enemy.getAnimationFromSprite(
index,
);
// Appends the enum name (e.g., "guard", "dog")
label += "\n${enemy.name}";
// Appends the animation name
if (animation != null) {
label += "\n${animation.name}";
}
break;
}
}