Skip to content

Commit

Permalink
fix: drop display position
Browse files Browse the repository at this point in the history
  • Loading branch information
andretchen0 committed Jul 19, 2023
1 parent 3c41d55 commit 588adff
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/drop.ts
Original file line number Diff line number Diff line change
@@ -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';

/**
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 588adff

Please sign in to comment.