From e093f44e5409f2e717d4f1a49188891effc8113f Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Tue, 30 Jan 2024 17:02:41 -0500 Subject: [PATCH] [pongwars]: add territory claim --- pongwars/index.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pongwars/index.html b/pongwars/index.html index 3b8782c..198b5b0 100644 --- a/pongwars/index.html +++ b/pongwars/index.html @@ -263,6 +263,15 @@ if (i >= 0 && i < numSquaresX && j >= 0 && j < numSquaresY) { if (squares[i][j] !== color) { + const foreign = squares[i][j]; + if (state[foreign].elim) { + for (let ai = 0; ai < numSquaresX; ai++) { + for (let aj = 0; aj < numSquaresY; aj++) { + if (squares[ai][aj] == foreign) squares[ai][aj] = color; + } + } + } + squares[i][j] = color; // Determine bounce direction based on the angle