Skip to content

Commit

Permalink
add color to cardboard sprite path if active creature is Dark Priest
Browse files Browse the repository at this point in the history
  • Loading branch information
gg447062 committed Apr 19, 2024
1 parent 6022bac commit c819b48
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/utility/hexgrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1609,15 +1609,19 @@ export class HexGrid {
previewCreature(pos, creatureData, player) {
const game = this.game;
const hex = this.hexes[pos.y][pos.x - (creatureData.size - 1)];
const cardboard =
creatureData.type == '--'
? creatureData.name + game.activePlayer.color + '_cardboard'
: creatureData.name + '_cardboard';

if (!this.materialize_overlay) {
// If sprite does not exists
// Adding sprite
this.materialize_overlay = this.creatureGroup.create(0, 0, creatureData.name + '_cardboard');
this.materialize_overlay = this.creatureGroup.create(0, 0, cardboard);
this.materialize_overlay.anchor.setTo(0.5, 1);
this.materialize_overlay.posy = pos.y;
} else {
this.materialize_overlay.loadTexture(creatureData.name + '_cardboard');
this.materialize_overlay.loadTexture(cardboard);
if (this.materialize_overlay.posy != pos.y) {
this.materialize_overlay.posy = pos.y;
this.orderCreatureZ();
Expand Down

0 comments on commit c819b48

Please sign in to comment.