fix boosters with rotations

This commit is contained in:
Olivier Gagnon 2021-10-17 00:35:50 -04:00
parent e49c1725b5
commit 75b3d9b126
4 changed files with 19 additions and 19 deletions

26
dist/vendor.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -56,10 +56,10 @@ export class Fragment {
if (candidates.some((coord) => coord[0] === x && coord[1] === y)) return; if (candidates.some((coord) => coord[0] === x && coord[1] === y)) return;
candidates.push([x, y]); candidates.push([x, y]);
}; };
for (let y = 0; y < this.shape.length; y++) { for (let y = 0; y < this.height(rotation); y++) {
for (let x = 0; x < this.shape[y].length; x++) { for (let x = 0; x < this.width(rotation); x++) {
// This cell is full, add all it's neighboors. // This cell is full, add all it's neighboors.
if (!this.shape[y][x]) continue; if (!this.fullAt(x, y, rotation)) continue;
add(x - 1, y); add(x - 1, y);
add(x + 1, y); add(x + 1, y);
add(x, y - 1); add(x, y - 1);