Skip to content

This is 2D game in which we add numbers and if you got 2048 number then you win, and if all the tiles are filled and there is no space for new tile then you lose!

Notifications You must be signed in to change notification settings

vaibhav1713109/2048-Game

Repository files navigation

2048-Game

2048 is often played on a gray 4×4 grid, with numbered tiles that slide when a player moves them using the four arrow keys. Every turn, a new tile will randomly appear in an empty spot on the board with a value of either 2. Tiles slide as far as possible in the chosen direction until they are stopped by either another tile or the edge of the grid. If two tiles of the same number collide while moving, they will merge into a tile with the total value of the two tiles that collided. The resulting tile cannot merge with another tile again in the same move. If a move causes three consecutive tiles of the same value to slide together, only the two tiles farthest along the direction of motion will combine. If all four spaces in a row or column are filled with tiles of the same value, a move parallel to that row/column will combine the first two and last two. The game is won when a tile with a value of 2048 appears on the board, hence the name of the game. After reaching the 2048 tile, players can continue to play (beyond the 2048 tile) to reach higher scores. When the player has no legal moves (there are no empty spaces and no adjacent tiles with the same value), the game ends.

Snapshots

2048

you_lose

About

This is 2D game in which we add numbers and if you got 2048 number then you win, and if all the tiles are filled and there is no space for new tile then you lose!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages