How eugeny11/tetris-game works
This is a browser-based Tetris game. The player’s keyboard or touch input enters the controller, which invokes game rules and redraws the board; timed drops continue until game over. The engine handles piece movement, collisions, ghost position, row clearing, and spawning, while shared utilities provide piece data and grid helpers. The README also documents responsive styling and Hammer.js touch gestures. Source excerpts show controller-to-engine and rendering behavior; the HTML/CSS presentation details are represented by their repository paths, not inspected implementation.
Main entry points: script.js Game controller · tetris.js Game engine · utilities.js Pieces and helpers · index.html Game board
Components 7
Input and display
- Game controller
script.js - Game board
index.html - Responsive styling
style.css
Tetris rules
- Game engine
tetris.js
Game data and helpers
- Pieces and helpers
utilities.js
Other components
- Player
- Hammer.js gestures
Connections 6
- Player → Game controller: controls
README.md - Game controller → Game engine: calls game rules
script.js - Game engine → Pieces and helpers: uses piece data
tetris.js - Game controller → Pieces and helpers: uses grid helpers
script.js - Game controller → Game board: draws cells
script.js - Game controller → Hammer.js gestures: registers gestures
script.js