From 2711d39d0a071de72449a89923cdda8ec3676656 Mon Sep 17 00:00:00 2001 From: Kurtis Melby Date: Sun, 18 Aug 2024 18:06:54 -0400 Subject: [PATCH] fix: world loading order bug (#53) --- packages/leap/lib/src/entities/mixins/has_animation_group.dart | 2 +- packages/leap/lib/src/entities/mixins/has_death_animation.dart | 2 +- packages/leap/lib/src/leap_game.dart | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/leap/lib/src/entities/mixins/has_animation_group.dart b/packages/leap/lib/src/entities/mixins/has_animation_group.dart index 122f50d..b361c9d 100644 --- a/packages/leap/lib/src/entities/mixins/has_animation_group.dart +++ b/packages/leap/lib/src/entities/mixins/has_animation_group.dart @@ -4,5 +4,5 @@ import 'package:leap/src/entities/physical_entity.dart'; mixin HasAnimationGroup on PhysicalEntity { AnchoredAnimationGroup get animationGroup; - bool get animationFacesLeft => false; + bool animationFacesLeft = false; } diff --git a/packages/leap/lib/src/entities/mixins/has_death_animation.dart b/packages/leap/lib/src/entities/mixins/has_death_animation.dart index 9c52946..e1fe13f 100644 --- a/packages/leap/lib/src/entities/mixins/has_death_animation.dart +++ b/packages/leap/lib/src/entities/mixins/has_death_animation.dart @@ -1,7 +1,7 @@ import 'package:flame_behaviors/flame_behaviors.dart'; import 'package:leap/leap.dart'; -mixin HasDeathAnimation on Entity { +mixin HasDeathAnimation on PositionedEntity { bool get isDead; AnchoredAnimationGroup get animationGroup; } diff --git a/packages/leap/lib/src/leap_game.dart b/packages/leap/lib/src/leap_game.dart index 5a4b951..074aacd 100644 --- a/packages/leap/lib/src/leap_game.dart +++ b/packages/leap/lib/src/leap_game.dart @@ -104,9 +104,8 @@ class LeapGame extends FlameGame { tiledObjectHandlers: tiledObjectHandlers, groundTileHandlers: groundTileHandlers, ); - onMapLoaded(_leapMap!); - await world.add(leapMap); + onMapLoaded(_leapMap!); if (mapTransition != null) { mapTransition.outro();