This application is a simple swap puzzle game.
In this game an image is cut into a number of square pieces of the same size. Pieces are placed in a random order. The objective of the game is to swap the messed up puzzle pieces to restore the primary picture.
How to play
"Puzzle" button displays pictures to choose from. Underneath each photo there is a list of difficulties. Change images using "< Previous" and "Next >" buttons. To start the game select the number of pieces you want the photo to be cut into and click the chosen picture. A pop up window will show. Enter your name and press "OK". Next you should see a window with an image cut into a number of square pieces of the same size. Pieces are placed in a random order. Not a single piece in a right place. The objective of the game is to swap the messed up puzzle pieces to restore the primary picture. If you click on an element it will be highlighted with a blue border. Double click on the same element will cause the border to be removed. To make a swap click on the piece you wish to move. Then click again on the square you want to move it to. Positions of the two pieces will be changed. Continue the process until the image is recovered. The faster you finish the puzzle and the fewer moves you make, the higher your score. Once all the pieces are moved into their right places, record lists are shown. New records will be highlighted in red. Each list contains at most 10 best results. These record lists can be also seen by clicking "show records" button located in a settings panel. Pressing that "show records" button will show best results associated with a relevant photo and a chosen number of puzzle pieces. Good luck.
The project is a simple frame application.
Bottom part of the application window is occupied by three buttons.
Use the buttons to:
- Start the game.
- Enable settings options.
- Display informations on how to play the puzzle game.
Rest of the window contains elements activated by the three main buttons.
Settings options enable you to:
- Replace photos with pictures of your choice.
- Set difficulties associated with each photo.
- Display and clear best results associated with each photo and a chosen number of puzzle pieces.
You can replace any photo with a picture of your choice. Newly added images are resized so that they have width between 250 to 800 pixels and height between 250 to 570 pixels. During rescaling ratios are kept unchanged. Any pictures that cannot be rescaled to the required size are rejected. Replacing a photo keeps previously set difficulties but it removes any best results associated with all difficulties set for that image.
You can set between 1 and 6 difficulties for each photo. After adding new difficulty best results associated with that difficulty will be deleted. Removing a difficulty also removes any best results associated with that difficulty.
There are two record lists. One for fewest swaps and one for fastest time taken to complete the puzzle game. Each list contains at most 10 best results.
The game has been set to display 10 images. Number of pictures can be easily changed without modifying source code. Simply write more photos in the "resources\jpg" directory and record the fact in the "resources\difficulties.txt" file by providing at least one difficulty for each newly added image.
The program has been written so that the size of the images, as well as the length of record lists and number of puzzle pieces can all take any values. However, changing these values require modifying source code.
Download and running options
Choice of download options include:
- complete application with all the source code as well as jar and exe files.
- exe file only.
To run the project use Puzzle.jar or Puzzle.exe.
language: English or polish
programming language: Java