PhonPhun

Menu
Home
M-SuDoKu
M-SuDoKu-LE
M-Kanji-SuDoKu
M-Puzzle
The game
License
Download
Customization
M-Shift
JMovieDownloader
Java Utility
Audio/Video
Tools
 
Tutorials
Contacts

Donate
Support PhonPhun!!!

More info available here!

AV TOP100

Page views

 
Customize M-Puzzle

0. Tools of the trade
To customize M-Puzzle you need a ZIP tool which supports .jar files; we will use ZipGenius (you can find the download link in the utility page), but other similar programs such as 7zip, WinRar etc. will be ok.
Optionally, if you wish to test your custom version with a pc emulator before sending it to your cellphone, you can use the emulators which can be downloaded from the manifacturers' web sites (a list of links is available in this page). You could also need to create a .jad file from the .jar game file: you can use JadMaker, which you can download from the link in this page.

1. Image creation
Choose the images you wish to use with M-Puzzle, and then resize and crop them (using an image manipulation program: some are listed here) so that the new dimensions are compatible with the screen resolution of the devices you want to use with the game.
For example, the original version of M-Puzzle uses 120x120 pixel images, so that they are compatible with as many devices as possible; anyway, there are no limits on the width or height of the images you can use with M-Puzzle: they are not required to be all the same size, and they are not even required to be square (of course, using non-square images implies that the puzzle tiles will not be square either); if any image is larger than the device screen, it is cropped (NOT resized!!!) and its middle part will be shown on the screen.
If the image is smaller than the screen size, it will always be centered on the screen.

Using 120x120 images you also have the advantage of image dimensions being integer multiples of the number of tiles in the different difficulty levels (that is, 3, 4, 5, and 6); anyway this is not a general constraint or requirement: images are automatically clipped so that the dimensions of the displayed portion is an integer multiple of the number of tiles of the current difficulty level (again, the displayed portion is always the central part of the image).

Three more images are used by M-Puzzle: one for the foreground of the "splash screen", one for the background of the splash screen (this one is optional: if not included, a black background will be used), and another one for the background of the game.
Background images are always tiled on the screen: as a special case, if the background image has the same dimensions as the screen, it will be drawn exactly once, so that you can actually use a non-tiled background (of course, this is only going to work for a certain, well defined screen size!).

Images can be PNG, JPG and GIF (anyway, don't expect animated GIFs to work!); GIF and PNG images support transparency too (this is mainly useful for the splash screen foreground image).

2. M-Puzzle.jar file editing
Download the MPuzzle.jar file from this page and open it with ZipGenius (just run the program and drag&drop the file icon inside the application window).


Click on the image to enlarge it in a new window

Remove from the archive the original images of the game (cats.jpg, churros.jpg, leafback.png, marble.png, Matisse.jpg, PalazzoMadama.jpg, Sekhmet.jpg, splash.png - all of them or only the ones you don't wish to use in your customized version): just select them one by one and press the Delete key.


Click on the image to enlarge it in a new window

If you wish to use the original images as an inspiration for your custom images, you can extract them in a temporary folder before removing them from the .jar file. Then, you can add the images which you created for yor custom version of M-Puzzle (puzzle images, background images and splash screen image) by dragging&dropping them in ZipGenius window. Compile the fields in the Compression options dialog as shown in the picture below, then press the Proceed... button.


Click on the image to enlarge it in a new window

Select the image.txt, puzzles.txt and info.txt files and extract them in a temporary folder or on the desktop. Open the images.txt file (using Notepad, for example) and follow the instructions in the file to edit it: add (in this exact order!) the file names of the image used for the puzzle background, for the splash screen foreground and (optionally) for the splash screen background - pay attention to type the exact file names, including correct case!


Click on the image to enlarge it in a new window

Save and close the images.txt file and then open the puzzles.txt file: following the instructions in the file, edit it and insert (one per line) the file names of the images to use for the puzzles, a comma, and the corresponding description to show in the Images menu of the game. Again, pay attention to type the exact file names!


Click on the image to enlarge it in a new window

If you also want to customize the message shown to the user in the information screen accessible through the Info item in the game menu, just edit the info.txt and enter the text you want to be shown.


Click on the image to enlarge it in a new window

To create a localized version of M-Puzzle for your language, extract the en-en.txt file, open it with Notepad and follow the instructions in the comments (the lines starting with #) to add texts for menus and messages (you'll have to translate them from the English original which is shown in the comments).


Click on the image to enlarge it in a new window

Once you've finished with your translation, save the file, close Notepad and rename the file (you might find it useful to use a descriptive name related to the translation language!).

Now, extract the lang.txt file and open it: this file is used by M-Puzzle to automatically detect the language to use, based on the mobile phone settings.
To configure the new language, follow the instructions in the comments (and the examples of the pre-configured languages) and add a line with the following comma-separated strings:

  • the two letter standard code for the language (a list is available here), e.g. it, en, de, etc., optionally followed by the regional/national code (for different language variants/dialects spoken in different countries), e.g. it-IT, it-CH, en-GB, en-US, etc. (don't panic, you can discover the standard code associated with the language configured on your mobile phone in the screen shown by the Info item of M-Puzzle main menu, just check the string in the square brackets!);
  • a human-readable name for the language;
  • the name of language file that you've just created (again, pay attention to letter cases!).

Click on the image to enlarge it in a new window

Save the file and close Notepad.

If you want to reduce the size of your .jar file, you can remove comments (lines starting with "#") and empty lines from the three text files.

Add the edited text files to the .jar file by dragging&dropping them on ZipGenius window and setting the fields in the dialog window which will pop up as shown in the figure below.


Click on the image to enlarge it in a new window

Then, close the application.

Finally, if you wish, you can rename the modified M-Puzzle.jar file.

3. Testing on a PC with an emulator
Before sending your custom version of M-Puzzle to a cell phone, you can test it using a PC emulator.
To do this, you might need to create a .jad file from your .jar file: for this purpose, you can use JadMaker and simply drag&drop the .jar file on the program window - the corresponding .jad file will be created automatically.


Click on the image to enlarge it in a new window

You have now to browse your emulator documentation to check how to execute the .jad/.jar file (the actual way varies depending on the emulator): for example, with Sony Ericsson emulators for the Windows platform you have to launch the emulator through Start -> Programs -> Sony Ericsson -> J2ME SDK -> WTK2 -> Run MIDP Application and select the .jad file created by JadMaker using the Select JAD file to run dialog.


Click on the image to enlarge it in a new window

Once your custom version has been successfully tested with the emulator, you can finally play it on your real device!