2048 is a 4x4 tile-based sliding game where the goal is to reach the number 2048 on one of the tiles. Pressing a corresponding button, such as "w," moves all the tiles in that direction. If two tiles with the same number are adjacent, they merge into one. However, explaining it is not the best way to play a game, so let's get started!
Ensure you have Python installed on your local machine for the game to work.
Clone the repository:
git clone https://github.com/Zilonis123/2048.py && cd 2048.py
Afterwards, install the dependencies:
pip install -r requirements.txt
Now, you have successfully installed the "2048 GUI version." To run it, type:
python 2048.py
Use the controls "w," "d," "a," and "s" to merge tiles until you reach the 2048 tile.
w
- Push the tiles upd
- Push the tiles rights
- Push the tiles downa
- Push the tiles leftctrl+z
- Undo the previous movectrl+r
- Reload the configuration filectrl+p
- Restart the gamectrl+i
- An "AI" makes a move for you. Note that the "AI" is not very advanced and averages around 1000 points per game without using your brain.
To customize the game, open config.json
. Change options like tile colors and more.
NOTE: Some options in the configuration file shouldn't be reloaded with the ctrl+r
shortcut, for example, the WIDTH
and HEIGHT
of the screen. It will cause visual bugs.
Your contributions are welcome! If you have suggestions to enhance the project, feel free to fork the repository and create a pull request. Alternatively, you can open an issue with the tag "enhancement". Don't forget to star the project if you find it useful!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request