A simple, browser-based 2048 game built with vanilla JavaScript. Use your arrow keys to slide tiles, combine matching numbers, and try to reach the 2048 tile!
https://annaskobara.github.io/js_game_2048/
This is an educational project I built to practice writing game logic from scratch. I focused on handling grid movements, merging identical tiles, and updating the UI dynamically when the game state changes.
- HTML5 – structure of the game and interface layout.
- SCSS – clean and responsive styling using the BEM methodology.
- JavaScript – core game mechanics, tile movement grid logic, and score tracking.
- Gulp / Parcel – asset bundling and development workflow automation.
- Arrow key controls — easily slide tiles up, down, left, or right.
- Score System — your score updates in real-time as tiles merge.
- Responsive Design — fully playable on both desktop and mobile devices.
- Dynamic Generation — random tile generation (2 or 4) after every valid move.
- Clone repository:
git clone https://github.com/annaskobara/js_game_2048.git - Navigate into the project directory:
cd js_game_2048 - Install the dependencies:
npm install - Run the app:
npm start