Skip to content

Commit

Permalink
Merge pull request FreezingMoon#2439 from andretchen0/drop-fix
Browse files Browse the repository at this point in the history
fix: drop display position, closes FreezingMoon#2437
  • Loading branch information
DreadKnight authored Jul 19, 2023
2 parents 3c41d55 + 588adff commit e13801e
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 e13801e

Please sign in to comment.