Trying to figure out issue with sprites loading improperly. Broken, still.
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -2,12 +2,7 @@ import 'package:wolf_dart/features/difficulty/difficulty.dart';
|
||||
import 'package:wolf_dart/features/entities/collectible.dart';
|
||||
import 'package:wolf_dart/features/entities/decorative.dart';
|
||||
import 'package:wolf_dart/features/entities/enemies/bosses/hans_grosse.dart';
|
||||
import 'package:wolf_dart/features/entities/enemies/dog.dart';
|
||||
import 'package:wolf_dart/features/entities/enemies/enemy.dart';
|
||||
import 'package:wolf_dart/features/entities/enemies/guard.dart';
|
||||
import 'package:wolf_dart/features/entities/enemies/mutant.dart';
|
||||
import 'package:wolf_dart/features/entities/enemies/officer.dart';
|
||||
import 'package:wolf_dart/features/entities/enemies/ss.dart';
|
||||
import 'package:wolf_dart/features/entities/entity.dart';
|
||||
import 'package:wolf_dart/features/entities/map_objects.dart';
|
||||
|
||||
@@ -16,17 +11,14 @@ typedef EntitySpawner =
|
||||
int objId,
|
||||
double x,
|
||||
double y,
|
||||
Difficulty difficulty,
|
||||
);
|
||||
Difficulty difficulty, {
|
||||
bool isSharewareMode,
|
||||
});
|
||||
|
||||
abstract class EntityRegistry {
|
||||
static final List<EntitySpawner> _spawners = [
|
||||
// Enemies need to try to spawn first
|
||||
Guard.trySpawn,
|
||||
Officer.trySpawn,
|
||||
SS.trySpawn,
|
||||
Mutant.trySpawn,
|
||||
Dog.trySpawn,
|
||||
Enemy.spawn,
|
||||
|
||||
// Bosses
|
||||
HansGrosse.trySpawn,
|
||||
@@ -41,11 +33,15 @@ abstract class EntityRegistry {
|
||||
double x,
|
||||
double y,
|
||||
Difficulty difficulty,
|
||||
int maxSprites,
|
||||
) {
|
||||
int maxSprites, {
|
||||
bool isSharewareMode = false,
|
||||
}) {
|
||||
// 1. Difficulty check before even looking for a spawner
|
||||
if (!MapObject.shouldSpawn(objId, difficulty)) return null;
|
||||
|
||||
// If the checkbox is checked, block non-Shareware enemies
|
||||
if (isSharewareMode && !MapObject.isSharewareCompatible(objId)) return null;
|
||||
|
||||
if (objId == 0) return null;
|
||||
|
||||
for (final spawner in _spawners) {
|
||||
|
||||
Reference in New Issue
Block a user