This repository contains a Python implementation of the popular puzzle game 2048, with a graphical user interface (GUI) built using the Tkinter library. The game allows players to slide numbered tiles on a grid to combine them and create larger tiles. The objective is to reach the 2048 tile by strategically merging tiles and maximizing the score.
Features:
- Simple and intuitive gameplay: Use arrow keys or 'WASD' keys to move the tiles in four directions.
- Visual feedback: The GUI displays the current state of the grid with colorful tiles and updates in real-time.
- Score tracking: The game keeps track of the current score, which increases as tiles are merged.
- Game termination: The game ends when the grid is full and no more moves are possible or when the player reaches the 2048 tile.
- Continue playing: After reaching the 2048 tile, players have the option to continue playing and aim for higher scores.
- Game over notification: If the grid is full and no more moves are possible, the game notifies the player that it is over.
To run the game, you need to have Python installed on your machine. Simply execute the Python script 2048_game.py in a Python environment with Tkinter support, such as IDLE or Jupyter Notebook.
This implementation of 2048 provides a basic version of the game with a GUI, focusing on core gameplay mechanics and a responsive user interface. It can serve as a starting point for further enhancements, such as saving and loading game states, implementing AI players, or adding additional features to the GUI. Feel free to fork, modify, and build upon this code to create your own version of the 2048 game.