Skip to content

Commit

Permalink
Merge pull request #2642 from RShnitser/flicker
Browse files Browse the repository at this point in the history
feature: materialization cardboard flicker, fixes #2538
  • Loading branch information
DreadKnight authored Oct 27, 2024
2 parents e7523f1 + df1bfb6 commit 69452f6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/utility/hexgrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export class HexGrid {
materialize_overlay: any;
secondary_overlay: any;
lastQueryOpt: any;
_flickerTween: any;

get allhexes(): Hex[] {
return this.hexes.flat(1);
Expand Down Expand Up @@ -873,6 +874,10 @@ export class HexGrid {
this.secondary_overlay.alpha = 0;
}

if(this._flickerTween){
this._flickerTween.stop(true);
}

if (!o.ownCreatureHexShade) {
if (o.id instanceof Array) {
o.id.forEach((id) => {
Expand Down Expand Up @@ -1671,6 +1676,18 @@ export class HexGrid {
preview.scale.setTo(1, 1);
}

this._flickerTween = game.Phaser.add
.tween(preview).to(
{
alpha: 0.1,
},
500,
Phaser.Easing.Linear.None,
)
.yoyo(true)
.repeat(-1)
.start();

for (let i = 0, size = creatureData.size; i < size; i++) {
const hexInstance = this.hexes[pos.y][pos.x - i];
this.cleanHex(hexInstance);
Expand Down

0 comments on commit 69452f6

Please sign in to comment.