Skip to content

KingOfDog/Tetris.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tetris.js

Another Tetris clone made in a Html5 canvas and native JavaScript ECMA6

Basics - What is Tetris?

Tetris is an old classic arcade game from Russia. The first version ever released was published on 6th June, 1984 by Alexei Paschitnow who is also the inventor of this cult game. Although, he got inspiration by the puzzle game Pentomino To date, over 100 million copies were sold and there exist over 65 ports for different plattforms.

The game consists of seven different blocks called Tetrominos (I, J, L, O, S, T). The letters represent the forms of the Tetrominos, which all possess four squares as the building material.

These are the existing, default Tetrominos

My clone of this game principle is made up by one HTML5 file containing a canvas element and a JavaScript file using ECMA script 6. It has a minimalistic look and keeps the focus on the actual tiles, not on anything else. I hope you have at least somewhat fun playing this game - or browsing my source code. Feel free to critize it - at least I want to learn from projects like this one.

Setup

Tetris.js is very intuitive and easy to set up. Just download the repository or the most recent release of this project and extract the downloaded file into a new folder. Now you just have to start the index.html-file or the TetrisJS.exe of the release version.

ToDo

Currently, Tetris.js is a very minimalistic game with the smallest possible amount of features. There are many things I want to implement into the game in the future. A few of them are listed here:

  • Detect slow hardware to optimize performance
  • Multiplayer (network connection)
  • Display highscore
  • Global highscore ranking
  • Game Over Screen
  • Add more languages
  • Add pause button in order to allow mobile users to pause the game
  • Implement different color schemes
  • Implement light/dark mode
  • Display the upcoming tile(s)
  • Distribute content of tetris.js to multiple classes
  • Hold one tile and swap them with the current one
  • Mobile optimization
  • Cooler graphics of the tiles
  • Multiple themes?
  • Improve performance
  • Better layout of texts
  • Highscore saving
  • Title screen
  • Multi-language support
  • Better controls (WASD + Arrow keys for moving?, Q+E for rotating?, F for swapping with the currently holded tile?)
  • Pause the game
  • Menu to reset a running game
  • Show the grid of the little blocks
  • much more...

About

Another Tetris clone made in a Html5 canvas and native JavaScript ECMA6

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published