Classic Tetris with Leaderboard
A fully functional browser-based recreation of the classic Tetris game featuring real-time score tracking and a PHP-powered leaderboard system.
Overview
This project is a modern implementation of the arcade classic, Tetris, built using vanilla HTML, CSS, and JavaScript. Beyond the standard gameplay mechanics, this version integrates a backend component to manage a persistent "Hall of Fame" leaderboard, adding a competitive edge to the retro experience.
Key Features
- Core Gameplay: Authentic tetromino physics, including rotation (Up Arrow) and directional movement (Left/Right/Down Arrows).
- Collision & Line Clearing: Implemented robust logic for collision detection and automatic line clearing, ensuring a smooth and bug-free gaming loop.
- Leaderboard System: Features a backend integration using PHP to read and write high scores to a server-side file (
scores.txt), allowing players to save their legacy. - Responsive UI: Clean and simple interface that focuses on the gameplay area while displaying live stats.
Tech Stack
- Frontend: HTML5, CSS3, JavaScript
- Backend: PHP (for leaderboard API)
- Data Storage: Flat-file storage (
scores.txt)
Acknowledgments
This project uses the javascript-tetris repository by jakesgordon as a structural blueprint, with significant updates and custom implementations added for the leaderboard functionality.