Add pool mirroring.

This commit is contained in:
yukirij 2024-09-05 11:22:43 -07:00
parent 36173bf422
commit 31947711c1

View File

@ -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.");
}
},