Skip to content

Commit

Permalink
Fix color and size when flagging same cell multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
Zikoat committed Aug 13, 2024
1 parent 72d10ca commit 3df798d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/CellSprite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { getTextures } from "./Textures";
import { CellWidth } from "./CoordTypes";

export const CELL_WIDTH = 16 as CellWidth;
const frontScale = 0.85;

type MyTexture = PIXI.Texture;

Expand Down Expand Up @@ -44,7 +45,7 @@ export class CellSprite {
this.front.width = CELL_WIDTH;
this.front.height = CELL_WIDTH;
this.front.anchor.set(0.5);
this.front.scale = 0.85;
this.front.scale.set(frontScale);
this.back.anchor.set(0.5);

// todo this should use cell-space to world space helpers
Expand Down Expand Up @@ -83,6 +84,9 @@ export class CellSprite {
private playUpdateAnimation() {
const animationTime = 0.2;

this.front.scale.set(frontScale);
this.back.alpha = 1;

TweenMax.from(this.front.scale, animationTime, {
x: 0,
y: 0,
Expand Down

0 comments on commit 3df798d

Please sign in to comment.