Skip to content

Nearly perfect port of Tetris in pure JavaScript / Port casi perfecto del juego de tetris en JavaScript puro

License

Notifications You must be signed in to change notification settings

parzibyte/tetris-javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tetris-javascript

Tetris escrito con JavaScript. Se usa canvas para dibujar el tablero.

Parzibyte jugando Tetris programado con JavaScript

By parzibyte

Tutorial: https://parzibyte.me/blog/2020/11/02/tetris-javascript-open-source/

Demo: https://parzibyte.github.io/tetris-javascript/

Documentación del estilo de código

Preferimos algo legible a algo "optimizado". Por ejemplo, en lugar de:

return !tablero[y][x].ocupado;

Se prefiere:

if (tablero[y][x].ocupado){
    return false
}else {
    return true;
}

Docs

Absolute point: A point with x and y that is absolute to the game board

Relative point: A point with inner x and y; for example, a point that conforms a figure

Files

script.js: just a legacy code file. It is not necessary at all, it's just to remember the early development of this port

tetris.js: the main file. It contains 3 classes. If you want, you can separate all of them; they are independent.

About

Proudly brought to you by parzibyte (https://parzibyte.me/blog)

About

Nearly perfect port of Tetris in pure JavaScript / Port casi perfecto del juego de tetris en JavaScript puro

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published