diff --git a/src/features/game/animations/GameAnimationManager.ts b/src/features/game/animations/GameAnimationManager.ts index 45a670cb9b..91a2d17a62 100644 --- a/src/features/game/animations/GameAnimationManager.ts +++ b/src/features/game/animations/GameAnimationManager.ts @@ -67,7 +67,7 @@ export default class GameAnimationManager { GameGlobalAPI.getInstance().addItem(GameItemType.objects, currLoc, image.key); break; case AnimType.Background: - GameGlobalAPI.getInstance().renderBackgroundLayerContainer(image.path); + GameGlobalAPI.getInstance().renderBackgroundLayerContainer(image.key); break; } } @@ -114,7 +114,9 @@ export default class GameAnimationManager { */ public startAnimation(image: ImageAsset) { if (this.isSprite(image)) { - this.getAnimation(image).play(image.path); + const sprite = this.getAnimation(image); + sprite.play(image.path, false); + this.game.add.existing(sprite); } } diff --git a/src/features/game/sound/GameSoundManager.ts b/src/features/game/sound/GameSoundManager.ts index 3e6c6e0c2f..894aa81b69 100644 --- a/src/features/game/sound/GameSoundManager.ts +++ b/src/features/game/sound/GameSoundManager.ts @@ -187,6 +187,8 @@ class GameSoundManager { duration: fadeDuration }); + // TODO: fix `TypeError: Cannot read property 'disconnect' of null` error + // when user navigates away from game scene before fadeDuration * 2 setTimeout(() => sound.destroy(), fadeDuration * 2); }