Game Features:
- Colorful display of tiles based on their value.
- Being able to pickup where you left the game at anytime
- Keep track of your top scores
- Nice sound effects
- Clear screen functionality for a better playing experience.
- User-friendly input handling and guidance.
- Fast input mode
- Setting menu to edit yout preferences
This code provides a fun and challenging 2048 game experience. Enjoy playing!
How to Play:
- Run the 2048 Download the
.exe
file from releases in github and run it.(if you are using linux or mac follow the instruction for runing the code your self) - Choose Grid Size: You'll be prompted to enter a number (3, 4, or 5) to choose the grid size or a letter "X" to load 3x3, "C" to load 4x4 and "V" to load 5x5 saved game for that size. or you can enter setting menu to edit yout preferences.
- Make Moves: Use the following keys to move the tiles:
- W: Move Up
- A: Move Left
- S: Move Down
- D: Move Right
- Win the Game: Reach a tile with the number 2048 to win!
Additional Inputs:
- H: Hide/show the input guides (for a cleaner look).
- M: Mute or unmute the sound effects.
- O: Save the current game state to a file.
- Z: Restore the previous move (useful for undoing mistakes).
- F: Bring you to "Fast mode" so you dont need to hit Enter every time (press F in fast mode to exit fast mode)
- Q: Quit the game.
- the game automaticly hide input guides after 100 points
- in fast mode the sound is mute and the guides are hidden (you can disable this in setting menu)
- you cant save your game state in fast mode and you have do in normal game
- you cant exit the app in the fast mode
Loading Saved Games:
- You can load saved games by entering 'x', 'c', or 'v' at the beginning, corresponding to saved games for grid sizes 3x3, 4x4, and 5x5 respectively.
Top Scores:
- The game keeps track of your top scores for each grid size.
.EXE
releases
.exe
files are made bypyinstaller
. you can made this.exe
file yoursel! first of all you need to installpyinstaller
by entering this commands oncmd
(you can open upcmd
withWin + R
):pip install pyinstaller
. then you need to open the folder you cloned the repository(withgit clone https://github.com/Behroz666/py2048
) and right click and chooseopen in terminal
(you can do this bycd
command too). then this command will make.exe
file for you:pyinstaller --onefile 2048.py
.
libraries and dependencies to run the code
-
First of all you need python to run this code. You can download python from
https://www.python.org/downloads/
. -
You can install all dependecies by runing
pip install -r requirements.txt
-
This code use
pynput
andpyautogui
libraries. if you want to use the code be sure to install libraries by entering these commands oncmd
(you can open upcmd
withWin + R
):pip install pynput
andpip install pyautogui
-
The game uses sound effects for some actions (enable/disable with 'M').If you faced any error on that, make sure the
pygame
library is installed for sound to work. (First opencmd
by search orWin+R
, then typepip install pygame
)