Commit 400ae908 authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix: duplicate wrap variable + remove roundRect (browser compat)

Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 8922b607
......@@ -61,8 +61,8 @@ export function mountGame(el, params) {
el.querySelector('#roll-btn').addEventListener('click', () => handleRoll(el));
// Emotes
const wrap = el.querySelector('#ludo-wrap');
emoteSystem.create(wrap, (emote) => {
const emoteWrap = el.querySelector('#ludo-wrap');
emoteSystem.create(emoteWrap, (emote) => {
audio.play('notification');
emoteSystem.showReceived(wrap, emote.emoji);
});
......@@ -150,23 +150,18 @@ function drawBoard() {
ctx.fillStyle = '#FAFAFA';
ctx.fillRect(0, 0, boardSize, boardSize);
// Home zones — with inner white area and colored border
// Home zones — with inner white area
[[0,0,0],[1,9,0],[2,9,9],[3,0,9]].forEach(([p,c,r]) => {
ctx.fillStyle = COLORS[p];
ctx.fillRect(c*cs, r*cs, 6*cs, 6*cs);
// Inner white rounded area
// Inner white area
ctx.fillStyle = '#FAFAFA';
const ins = cs*0.9;
const w = 6*cs-ins*2;
ctx.beginPath();
ctx.roundRect(c*cs+ins, r*cs+ins, w, w, cs*0.4);
ctx.fill();
// Inner colored border ring
const ins = cs*0.85;
ctx.fillRect(c*cs+ins, r*cs+ins, 6*cs-ins*2, 6*cs-ins*2);
// Inner colored border
ctx.strokeStyle = COLORS[p];
ctx.lineWidth = 2;
ctx.beginPath();
ctx.roundRect(c*cs+ins+4, r*cs+ins+4, w-8, w-8, cs*0.3);
ctx.stroke();
ctx.lineWidth = 2.5;
ctx.strokeRect(c*cs+ins+3, r*cs+ins+3, 6*cs-ins*2-6, 6*cs-ins*2-6);
});
// Cross paths (white)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment