diff --git a/src/ui/pokemon-info-container.ts b/src/ui/pokemon-info-container.ts index 337236756..9eb53fcc3 100644 --- a/src/ui/pokemon-info-container.ts +++ b/src/ui/pokemon-info-container.ts @@ -22,6 +22,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { private pokemonMoveLabels: Phaser.GameObjects.Text[]; private initialX: number; + private movesContainerInitialX: number; public statsContainer: StatsContainer; @@ -38,6 +39,8 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { this.pokemonMovesContainer = this.scene.add.container(6, 14); + this.movesContainerInitialX = this.pokemonMovesContainer.x; + this.pokemonMovesContainers = []; this.pokemonMoveBgs = []; this.pokemonMoveLabels = []; @@ -142,7 +145,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { targets: this.pokemonMovesContainer, duration: Utils.fixedInt(325), ease: 'Cubic.easeInOut', - x: '-=57', + x: this.movesContainerInitialX - 57, onComplete: () => resolve() }); } @@ -168,7 +171,7 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container { targets: this.pokemonMovesContainer, duration: Utils.fixedInt(750), ease: 'Cubic.easeInOut', - x: '+=57' + x: this.movesContainerInitialX }); this.scene.tweens.add({