-
-
Save melcor76/baa0ce851148b5135f88e0f4c7667fd3 to your computer and use it in GitHub Desktop.
js-tetris - draw board
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drawBoard() { | |
this.grid.forEach((row, y) => { | |
row.forEach((value, x) => { | |
if (value > 0) { | |
this.ctx.fillStyle = COLORS[value]; | |
this.ctx.fillRect(x, y, 1, 1); | |
} | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment