Add pool mirroring.
This commit is contained in:
parent
36173bf422
commit
31947711c1
@ -481,6 +481,7 @@ const INTERFACE = {
|
|||||||
basis_y - (9 * gui_scale),
|
basis_y - (9 * gui_scale),
|
||||||
7,
|
7,
|
||||||
player_identity ^ 1,
|
player_identity ^ 1,
|
||||||
|
INTERFACE_DATA.mirror && ((INTERFACE_DATA.player & 1) ^ INTERFACE_DATA.rotate) == 0
|
||||||
);
|
);
|
||||||
|
|
||||||
// Draw informational text
|
// Draw informational text
|
||||||
@ -803,7 +804,7 @@ const INTERFACE = {
|
|||||||
this.ctx.restore();
|
this.ctx.restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
pool(x, y, basis, player) {
|
pool(x, y, basis, player, mirror=false) {
|
||||||
let radius = INTERFACE.Radius * this.scale;
|
let radius = INTERFACE.Radius * this.scale;
|
||||||
let icon_radius = 0.69 * radius;
|
let icon_radius = 0.69 * radius;
|
||||||
|
|
||||||
@ -861,6 +862,10 @@ const INTERFACE = {
|
|||||||
this.ctx.beginPath();
|
this.ctx.beginPath();
|
||||||
this.hex(0.94);
|
this.hex(0.94);
|
||||||
this.ctx.fill();
|
this.ctx.fill();
|
||||||
|
|
||||||
|
if(mirror) {
|
||||||
|
this.ctx.rotate(Math.PI);
|
||||||
|
}
|
||||||
|
|
||||||
// Draw image
|
// 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);
|
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);
|
let result = determine_play(GAME_DATA, GAME_DATA.turn & 1, 1);
|
||||||
if(result !== null) {
|
if(result !== null) {
|
||||||
INTERFACE.process(result.play);
|
INTERFACE.process(result.play);
|
||||||
|
} else {
|
||||||
|
console.log("warn: autoplay move was null.");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user