diff options
| author | Maks Jopek <maksymilian.jopek@prym-soft.pl> | 2021-04-26 14:43:25 +0200 |
|---|---|---|
| committer | Maks Jopek <maksymilian.jopek@prym-soft.pl> | 2021-04-26 14:43:25 +0200 |
| commit | 6baaa14bde032afa363dbdd50119a20e9f47df1c (patch) | |
| tree | 82e7ba81f36e725e282eadd5c8c61f4304b1bf85 /frontend/ts/ghost.ts | |
| parent | 013319d7a4651d1708280f556e39c2f03839426a (diff) | |
| download | fia-6baaa14bde032afa363dbdd50119a20e9f47df1c.tar.gz fia-6baaa14bde032afa363dbdd50119a20e9f47df1c.tar.zst fia-6baaa14bde032afa363dbdd50119a20e9f47df1c.zip | |
Bugfixes: to home, [40] -> [1], not destroying old chequer
Diffstat (limited to 'frontend/ts/ghost.ts')
| -rw-r--r-- | frontend/ts/ghost.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/frontend/ts/ghost.ts b/frontend/ts/ghost.ts index e7b4cb0..208127d 100644 --- a/frontend/ts/ghost.ts +++ b/frontend/ts/ghost.ts @@ -11,7 +11,7 @@ export default class ghost { chequer.ghost?.coords === undefined ? console.log("showShost::chequer.ghost.coords === undefined", chequer.ghost?.coords === undefined) : ''; return; } - gameBoardClass.showChequer(chequer.ghost.coords, color) + gameBoardClass.showChequer(chequer.ghost.coords, 4) } static hideGhost(chequer: Chequer | HoBSquare): void { if (chequer.ghost === undefined || chequer.ghost.coords === undefined) { @@ -52,7 +52,7 @@ export default class ghost { } static allBlink(gameBoard: GameBoard, color: tColors) { for (let square of gameBoard.map) { - if (square.chequers.some(el => el.ghost !== undefined)) + if (square.chequers.some(el => el.ghost !== undefined) === true) ghost.blink(square); } for (let chequer of gameBoard.bases[color as keyof HomesOrBases]) { @@ -66,7 +66,7 @@ export default class ghost { } static blink(chequer: Square | HoBSquare) { if (ghost.interval === undefined) - ghost.interval = setInterval(ghost.blinking, 1000); + ghost.interval = setInterval(ghost.blinking, 700); let td = gameTable.getTd({ x: chequer.x, y: chequer.y }); ghost.ghostsTds.push({ td, class: td.className }); } @@ -78,6 +78,7 @@ export default class ghost { } static allStopBlink() { clearInterval(ghost.interval); + ghost.interval = undefined; ghost.hide = true; for (let td of ghost.ghostsTds) { td.td.className = td.class; |
