Skip to content

Instantly share code, notes, and snippets.

@melcor76
Created November 19, 2019 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melcor76/2bb8193b939a2f62e2a426196a43b9e3 to your computer and use it in GitHub Desktop.
Save melcor76/2bb8193b939a2f62e2a426196a43b9e3 to your computer and use it in GitHub Desktop.
js-tetris - freeze
freeze() {
this.piece.shape.forEach((row, y) => {
row.forEach((value, x) => {
if (value > 0) {
this.grid[y + this.piece.y][x + this.piece.x] = value;
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment