Berk Uras Logo

Berk Uras

Tetris Game

A classic arcade game recreated with modern web technologies.

Tetris Game Hero Image

About The Project

This project is a complete, playable implementation of the classic Tetris game, built from scratch using pure (vanilla) JavaScript, HTML, and CSS. The primary goal was to demonstrate core programming logic, state management, and rendering skills by recreating a well-known game. All game mechanics, from piece rotation to collision detection and scoring, are handled on the client-side.

Tech Stack

HTML5 CSS3 JavaScript (ES6+) HTML Canvas API

Key Features

Challenges & Solutions

The main challenge was to create an efficient, non-blocking game loop to handle piece movement, user input, and screen re-draws continuously without performance issues. This was solved by using `requestAnimationFrame` for the main game loop, which ensures that rendering is synchronized with the browser's refresh rate. The game state (board, current piece, score) is managed in a central set of variables, and the canvas is cleared and redrawn on every frame, providing a smooth gameplay experience.