This is a Python implementation of the popular 2048 game. The goal of the game is to achieve highest score and tile possible with 0 undo. You can use the undo for practice.
- Install the required dependencies:
pip install numpy pygame
- Arrow Keys: Move the tiles in the respective direction (left, right, up, down).
- Spacebar: Undo the last move.
- R Key: Reset the game.
- Escape Key: Quit the game.
Slide the tiles on the board to combine them and create a tile with the number 2048. The advanced players can keep going for 4096 and 8192. The game ends when no more moves are possible.
- Adding Tiles: Each move adds a new tile (2 or 4) to the board at a random empty position.
- Combining Tiles: When two tiles with the same number collide while moving, they merge into a tile with the total of their values.
- Undo: You can undo the last move by pressing the Spacebar.
-
Execute the script:
python game_engine.py
-
Enjoy the game!
- Scoring System: Track your score as you combine tiles.
- Undo Functionality: Undo your last move with the Spacebar.
- Reset Functionality: Reset the game with the R key.
- Game Over Detection: The game will notify you when no more moves are possible.