Skip to content

Tetris game recreated using pure JavaScript and the HTML5 Canvas API, featuring smooth gameplay, intuitive controls, and dynamic rendering.

Notifications You must be signed in to change notification settings

alaurentinoofficial/tetris

Repository files navigation

Tetris

CI Version Project




Link to Play

https://thetetris.herokuapp.com





How to play

The Pieces

Name Representation
I I
O O
S S
Z Z
L L
J J
T T



Scoring at game

  1. To get score it's necessary fill a entire line with any piece or position. Like the image represented below:

Previous score


  1. After fill the line it blow up and all pieces above came down:

Scored

  1. And adds 100 to the score:

Scored




Movements

You can control new pieces that appear on the top and choise where the piece goes to fix, when the piece colide below of the ground or another piece, the actual piece gets rooted and new piece appear in the top


  • Rotate the piece it's easy using the up arrow (↑)

Scored Scored


  • Move the piece it's easy using the left arrow (←) to go left or right arrow (→) to go right

Scored


  • Accelerate the peice start to fall more fast

Scored




Game Over

The game over after to fill any collumns, being impossible to put another piece on the map

Scored




E2E Tests using Cypress

1. Start the local server

> npm install

> npm start

2. Run the tests using the command bellow:

> npx cypress run

Description:

  • should open the site: Test if the site server is available
  • should start: The game should start right after click on play button, to pass the game state need to be "gaming"
  • should pause: The game should pause right after click on pause button, to pass the game state need to be "pause"
  • should reset: The game should pause right after click on reset button, to pass the game state need to be "stoped"
  • should change game volume: Check if is possible change the value of music volume in game
  • should game over: Test if the game ends after all pieces fall for some time, to pass the game over model should pop up and the model have the class "active"



Developed by

About

Tetris game recreated using pure JavaScript and the HTML5 Canvas API, featuring smooth gameplay, intuitive controls, and dynamic rendering.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •