The Picture Puzzle

This case study describes a simple game that uses the Mobile Media API to take photographs using a camera phone. The sample MIDlet also illustrates using the RMS store to save, load and delete persistent records and makes use of a TiledLayer from the Game API.

The Picture Puzzle MIDlet is a variation on the familiar Mix Pix native application that ships on Nokia Series 60 phones. In this sample MIDlet we use the on-board camera to capture a snapshot that acts as the original image. The MIDlet automatically displays this as a scrambled 4 x 4 grid (Figure 5.18). The user has to unscramble the image by re-arranging the tiles to complete the game (Figure 5.19).

The MIDlet stores newly captured images in the RMS record store so that they are available for subsequent games, as shown in Figure 5.20. The Picture Puzzle MIDlet comprises the classes shown in Figure 5.21.

Capture

Close

Select Cancel

Figure 5.18 The Picture Puzzle MIDlet running on a Nokia 6600.

Figure 5.19 The completed Picture Puzzle game.
0 0

Post a comment

  • Receive news updates via email from this site