Module I final project - Ironhack's Fullstack Web Development Bootcamp.
By Gilad Tsabar
Tetris is a tile-matching video game created by Russian software engineer Alexey Pajitnov in 1984. It has been published by several companies, most prominently during a dispute over the appropriation of the game's rights in the late 1980s.
Initial release date: June 6, 1984.
Designer: Alexey Pajitnov
source: Wikipedia
Since Tetris was my ultimate childhood game, I've had the urge to build my own tribute version.
-
This game was written in vanilla ES6 Javascript. CSS3 for formatting and HTML as entry point.
-
All elements in this projects have been created using DOM manipulation in javascript.
-
For testing I've used Jest.
Run class method holds the game logic. this is where the magic happens. At first is the startScreen function is being called. startScreen initialize the stage, and sets a welcome message for the user, encouraging to start a game. startGame removes the message and reveals the board. then is the game is initialized (initGame) and start to drop the
Holds functions related to the scene. The background, app header and the board, and score elements.
Consists of a grid of DIV's. A div with the class 'row' for each row in the grid containing div childrens with the class 'col'. If a Tetromino is being placed on the board, the div get a block-cell class and the color style in the appropriate position. Respectively it get cleared if the block is not longer in place. Here are also the movement and colision checks functions
In here there is a header and 2 paragraph elements which get updated whenever the the score or the level is changed.
Some thing planned to do at some point in the future:
- Change the score system to award multiline cleanup.
- Add mobile support
- Add multiplayer support
Background images:
Casey Horner (@mischievous_penguins) Unsplash
Jonathan Rados (@jonathanrados) Unsplash
Smit Patel (@mesmitpatel) Unsplash