[pongwars]: add territory claim
This commit is contained in:
parent
2b6e9ec330
commit
e093f44e54
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user