https://github.com/parzibyte/tetris-javascript
Nearly perfect port of Tetris in pure JavaScript / Port casi perfecto del juego de tetris en JavaScript puro
https://github.com/parzibyte/tetris-javascript
canvas game javascript port tetris tetris-game
Last synced: 6 months ago
JSON representation
Nearly perfect port of Tetris in pure JavaScript / Port casi perfecto del juego de tetris en JavaScript puro
- Host: GitHub
- URL: https://github.com/parzibyte/tetris-javascript
- Owner: parzibyte
- License: mit
- Created: 2020-10-03T23:54:28.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-19T23:47:59.000Z (almost 5 years ago)
- Last Synced: 2025-03-26T07:11:16.775Z (6 months ago)
- Topics: canvas, game, javascript, port, tetris, tetris-game
- Language: JavaScript
- Homepage: https://parzibyte.me/blog/2020/11/02/tetris-javascript-open-source/
- Size: 4.13 MB
- Stars: 23
- Watchers: 1
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tetris-javascript
Tetris escrito con JavaScript. Se usa canvas para dibujar el tablero.

**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:
```javascript
return !tablero[y][x].ocupado;
```
Se prefiere:
```javascript
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)