Javascript Tetris

The playing field consists of a grid and slowly falling polygons. The goal is to arrange these polygons in a way that it fills all the squares in the grid.
At the start of the game, the grid is empty. An oddly shaped polygon appears and starts falling, a row at a time. \The player can choose to rotate it left or right or move it horizontally left or right, a square at a time. When the polygon reaches the bottom of the grid, it permanently stays put and another polygon appears at the top and begins its fall.\

Aim

Build the game of tetris by providing a grid, polygons and six buttons for Start, Pause, Rotate Left, Rotate Right, Move Left and Move Right.

Technologies Used

  • HTML
  • CSS
  • Javascript

Game Features

  • Start/Pause Button: toggles between start and pause during the game
  • Reset: reloads the page to start a new game
  • Score counter: Counter increases when the player clears lines
  • Tetrominos: can be moved left-right-down with arrow keys respectively and can be rotated with up-down arrow keys
  • Up Next: shows the next tetromino in the sequence -Audio button: on/off background music

Preview

alt text