From 588adfff9a3f935636d6899ec7faffe8d38d7056 Mon Sep 17 00:00:00 2001 From: Peter Date: Wed, 19 Jul 2023 11:30:15 +0200 Subject: [PATCH] fix: drop display position --- src/drop.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/drop.ts b/src/drop.ts index e1ae7af7c..53ac3aee8 100644 --- a/src/drop.ts +++ b/src/drop.ts @@ -1,6 +1,6 @@ import { Creature } from './creature'; import Game from './game'; -import { offsetCoordsToPx } from './utility/const'; +import { HEX_HEIGHT_PX, HEX_WIDTH_PX, offsetCoordsToPx } from './utility/const'; import { Point, getPointFacade } from './utility/pointfacade'; /** @@ -71,11 +71,15 @@ export class Drop { .forEach((drop) => drop.destroy()); this.game.drops.push(this); - const px = offsetCoordsToPx({ x: x + 1, y: y - 0.5 }); - this.display = game.grid.dropGroup.create(px.x, px.y, 'drop_' + this.name); + this.display = game.grid.dropGroup.create( + this.hex.displayPos.x + 54, + this.hex.displayPos.y + 15, + 'drop_' + this.name, + ); this.display.alpha = 0; this.display.anchor.setTo(0.5, 0.5); this.display.scale.setTo(1.5, 1.5); + game.Phaser.add .tween(this.display) .to(