From 31947711c175d42db00172a41c97028b31fc0d0c Mon Sep 17 00:00:00 2001 From: yukirij Date: Thu, 5 Sep 2024 11:22:43 -0700 Subject: [PATCH] Add pool mirroring. --- www/js/interface.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/www/js/interface.js b/www/js/interface.js index dcc1eeb..487cddf 100644 --- a/www/js/interface.js +++ b/www/js/interface.js @@ -481,6 +481,7 @@ const INTERFACE = { basis_y - (9 * gui_scale), 7, player_identity ^ 1, + INTERFACE_DATA.mirror && ((INTERFACE_DATA.player & 1) ^ INTERFACE_DATA.rotate) == 0 ); // Draw informational text @@ -803,7 +804,7 @@ const INTERFACE = { this.ctx.restore(); } - pool(x, y, basis, player) { + pool(x, y, basis, player, mirror=false) { let radius = INTERFACE.Radius * this.scale; let icon_radius = 0.69 * radius; @@ -861,6 +862,10 @@ const INTERFACE = { this.ctx.beginPath(); this.hex(0.94); this.ctx.fill(); + + if(mirror) { + this.ctx.rotate(Math.PI); + } // Draw image this.ctx.drawImage(GAME_ASSET.Image.Piece[i][player], -icon_radius * 0.55, -icon_radius * 0.8, icon_radius * 1.6, icon_radius * 1.6); @@ -1412,6 +1417,8 @@ const INTERFACE = { let result = determine_play(GAME_DATA, GAME_DATA.turn & 1, 1); if(result !== null) { INTERFACE.process(result.play); + } else { + console.log("warn: autoplay move was null."); } },