This is a simple implementation of the classic 4-by-4 2048 tile game. The game's objective is to merge tiles until the target tile 2048 has been created.
- Tiles represent powers of 2, 2 being the smallest possible tile and 2048 (the target) being the largest.
- Tiles can be shifted up, down, left, and right with their corresponding keyboard keys.
- If the screen is filled with tiles and no move is possible, the player looses.
- Every time two equal-valued tiles are merged, the score increases by the outcome of the merging (ex: merging 2 and 2 increases the score by 4).
- After the player makes a (successful) move, a new tile (with value 2 or 4) is spawned on the game board.
- Open your terminal
- Navigate to the
2048gamedirectory - Run the command
./gradlew run - Enjoy!
If multiple Java versions are installed locally, we can check which version is active in the local environment by using java -version. Given that jdk 8 is installed locally, we can change the java version used in the environment by using:
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
Note: This method has only been tested on my local machine (M1 Mac)



