Skip to content

Latest commit

 

History

History
69 lines (49 loc) · 1.65 KB

File metadata and controls

69 lines (49 loc) · 1.65 KB

Tetris Game - Pure JavaScript Implementation

A complete implementation of the classic Tetris game built with vanilla HTML5, CSS3, and JavaScript. No external libraries or frameworks required. This project demonstrates game development fundamentals, object-oriented programming, and modern JavaScript concepts.

Live Demo

🎮 Play Tetris Online

Features

  • Pure vanilla JavaScript implementation
  • Classic Tetris gameplay mechanics
  • Responsive controls
  • Score tracking system
  • Pause/Resume functionality
  • No dependencies or build process required

How to Play

Play Online

Visit the live demo link above to play directly in your browser.

Play Locally

  1. Clone the repository:

    git clone https://github.com/hoffhannisyan/javascript-tetris.git
    cd javascript-tetris
  2. Open index.html in your web browser

No installation or build process required!

Game Controls

Key Action
Enter Start game / Restart after game over
Space Pause / Resume game
Arrow Left (←) Move tetromino left
Arrow Right (→) Move tetromino right
Arrow Up (↑) Rotate tetromino clockwise
Arrow Down (↓) Soft drop (faster descent)

Technology Stack

  • HTML5 Canvas
  • CSS3
  • Vanilla JavaScript (ES6+)

Learning Objectives

This project demonstrates:

  • Game loop implementation
  • Collision detection
  • Object-oriented programming in JavaScript
  • DOM manipulation
  • Event handling
  • Canvas API usage

Browser Compatibility

Works on all modern browsers that support HTML5 Canvas:

  • Chrome
  • Firefox
  • Safari
  • Edge