Live Demo → https://zrozik-cmd.github.io/2048-web-application/
Fully functional implementation of the classic 2048 puzzle game built with pure vanilla JavaScript (ES6+) and DOM manipulation — no frameworks, no libraries.
- Tile movement with arrow keys (↑ ↓ ← →)
- Merging of identical tiles (2 + 2 → 4 → 8 → …)
- Random spawning of new tiles (2 or 4) after every move
- Score tracking and display
- Win condition (reach 2048 tile)
- Game Over detection (no valid moves left)
- “New Game / Restart” button
- Smooth tile appearance animations
- Fully responsive design (desktop + mobile)
- HTML5
- CSS3 (Flexbox, Grid, CSS variables, animations)
- Vanilla JavaScript (ES6+): classes, arrow functions, destructuring
- DOM manipulation & Keyboard events
- OOP approach using
Game2048class - Optimized move/merge logic (single pass per column/row)
- Clean UI update via dedicated
updateUI()method - Random tile generation only on empty cells
- Game state checks after every move
git clone https://github.com/Zrozik-cmd/js_2048_game.git cd js_2048_game open index.html
- Tymofii Vasylenko
- GitHub: @Zrozik-cmd
