|
|
|
@ -363,8 +363,13 @@
|
|
|
|
const wallIndex = walls.findIndex((wall) => intersects(bullet, wall));
|
|
|
|
const wallIndex = walls.findIndex((wall) => intersects(bullet, wall));
|
|
|
|
if (wallIndex !== -1) {
|
|
|
|
if (wallIndex !== -1) {
|
|
|
|
const wall = walls[wallIndex];
|
|
|
|
const wall = walls[wallIndex];
|
|
|
|
spark(bullet.x, bullet.y, wall.destructible ? "#b86d3d" : "#c4c8bd");
|
|
|
|
if (wall.destructible) {
|
|
|
|
if (wall.destructible) walls.splice(wallIndex, 1);
|
|
|
|
spark(bullet.x, bullet.y, "#e0913a");
|
|
|
|
|
|
|
|
walls.splice(wallIndex, 1);
|
|
|
|
|
|
|
|
if (bullet.owner === "player") score += 5;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
spark(bullet.x, bullet.y, "#c4c8bd");
|
|
|
|
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (bullet.owner === "player") {
|
|
|
|
if (bullet.owner === "player") {
|
|
|
|
|