From fe5ce949f0ff2f849ee188ad328254149a871363 Mon Sep 17 00:00:00 2001 From: darcy Date: Sat, 20 Jun 2026 03:12:25 +0800 Subject: [PATCH] Add brick destruction score feedback --- src/game.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/game.js b/src/game.js index cec16a7..f6ae17a 100644 --- a/src/game.js +++ b/src/game.js @@ -363,8 +363,13 @@ const wallIndex = walls.findIndex((wall) => intersects(bullet, wall)); if (wallIndex !== -1) { const wall = walls[wallIndex]; - spark(bullet.x, bullet.y, wall.destructible ? "#b86d3d" : "#c4c8bd"); - if (wall.destructible) walls.splice(wallIndex, 1); + if (wall.destructible) { + spark(bullet.x, bullet.y, "#e0913a"); + walls.splice(wallIndex, 1); + if (bullet.owner === "player") score += 5; + } else { + spark(bullet.x, bullet.y, "#c4c8bd"); + } continue; } if (bullet.owner === "player") {