Skip to content

This repository contains a Java implementation of the popular sliding puzzle game, 2048. The game allows players to combine tiles with matching numbers to reach the 2048 tile. It features a simple, intuitive user interface and supports standard keyboard controls (arrow keys) for tile movement.

License

Notifications You must be signed in to change notification settings

sgupta1703/2048---Java-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2048 Game in Java

This repository contains two different implementations of the classic 2048 puzzle game. One is a text-based version, and the other is a GUI-based version using Swing.

Files

  • Run.java: A simple, text-based version of the game.
  • Game2048.java: A GUI-based version of the game built using Swing.

Instructions

Run.java (Text-based version)

  1. Navigate to the directory containing run.java.
  2. Compile the file:
    javac run.java
  3. Run the program:
    java run
  4. Use the following commands to control the game:
    • left: Move tiles left.
    • right: Move tiles right.
    • up: Move tiles up.
    • down: Move tiles down.
    • restart: Restart the game.
    • exit: Exit the game.

Game2048.java (GUI-based version)

  1. Navigate to the directory containing Game2048.java.
  2. Compile the file:
    javac Game2048.java
  3. Run the program:
    java Game2048
  4. Control the game using:
    • Arrow keys (Up, Down, Left, Right) or
    • W (Up), A (Left), S (Down), D (Right).

Enjoy the game and try to reach the 2048 tile!

About

This repository contains a Java implementation of the popular sliding puzzle game, 2048. The game allows players to combine tiles with matching numbers to reach the 2048 tile. It features a simple, intuitive user interface and supports standard keyboard controls (arrow keys) for tile movement.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages