Welcome to 2048, a classic puzzle game built using Python's pygame library. The objective of the game is to slide numbered tiles on a 4x4 grid to combine them and create a tile with the number 2048.
Prerequisite: Install pygame
Before running the code, you need to install the pygame library by running the following command:
pip install pygame- Use the arrow keys (←, →, ↑, ↓) to slide the tiles.
- Tiles with the same number will merge into one when they collide.
- After each move, a new tile (2 or 4) will randomly appear on the grid.
- Your goal is to combine the tiles to form the 2048 tile.
- The game ends if no more moves are possible (Game Over) or if you successfully form the 2048 tile (You Win!).
-
Clone the repository and navigate to the project folder:
git clone <repository-url> cd <project-folder>
-
Run the program:
python3 2048.py
-
Enjoy playing the 2048 game!
- Dynamic 4x4 grid with colorful tiles.
- Game Over detection when no moves remain.
- Winning condition when the player reaches 2048.
- Smooth sliding animations and random tile generation.
🎉 Have Fun! Try to achieve the elusive 2048 tile and challenge yourself to beat the game!