From 70573a8dddc168934a53275f75f72c426bb80e0c Mon Sep 17 00:00:00 2001 From: Brian Fertig Date: Sun, 17 May 2026 11:23:07 -0600 Subject: [PATCH] feat: deselect card on empty space click in SkipBo - Add pointerdown listener to clear selectedSource and highlights when clicking empty space. - Improves UX by allowing players to easily cancel card selection. --- public/src/games/skipbo/SkipBoGame.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/public/src/games/skipbo/SkipBoGame.js b/public/src/games/skipbo/SkipBoGame.js index 55b9688..481854e 100644 --- a/public/src/games/skipbo/SkipBoGame.js +++ b/public/src/games/skipbo/SkipBoGame.js @@ -287,6 +287,16 @@ export default class SkipBoGame extends Phaser.Scene { new Button(this, 110, GAME_HEIGHT - 100, 'Leave', () => this.scene.start('GameMenu'), { variant: 'ghost', width: 110, height: 40, fontSize: 18, }).setDepth(D.ui); + + // Clicking empty space deselects the current card + this.input.on('pointerdown', (pointer) => { + if (!this.selectedSource) return; + if (this.input.hitTestPointer(pointer).length === 0) { + this.selectedSource = null; + this.clearHighlights(); + this.setStatus('Your turn'); + } + }); } // ── Game start ───────────────────────────────────────────────────────────