I remade the classic game Tetris from the ground up using only JavaScript and HTML5/Canvas. The project had many technical challenges, including implementing rotation near the edges, speeding up the game after each "level" (which required using a tweaked version of setInterval), and causing isolated pieces to continue falling after a row disappeared (which required doing a depth-first search for each square after each row deletion to determine whether they were connected to the ground or isolated). The result is a highly-addictive implementation you can try here: wzeller.github.io/Tetris.
wzeller / tetris Goto Github PK
View Code? Open in Web Editor NEWA browser-based implementation of the classic game Tetris using only JavaScript and HTML5.
Home Page: wzeller.github.io/Tetris