1# Puzzle Game 2 3### Introduction 4 5This puzzle game app is developed based on the **\<Grid>** component. It uses the `Image` and `MediaLibrary` APIs to obtain and crop images. Below shows the sample app. 6 7 8 9### Concepts 10 11`ImagePacker`: a class that provides APIs to pack images. Before calling any API in `ImagePacker`, you must use `createImagePacker` to create an `ImagePacker` instance. 12 13`MediaLibrary`: a class that provides APIs to access and modify media data such as audios, videos, images, and documents. 14 15### Required Permissions 16 17ohos.permission.READ_MEDIA 18 19### Usage 20 211. The sample app reads the image files on the local device and displays the first image it obtains. If there is no image on the local device, a blank is displayed. 22 232. Touch **Start**, and the countdown begins. If you fail to finish the puzzle within the specified time, the game ends. You can touch **Restart** to play the game again. 24 253. When the game is in progress, you can touch any image around the gray grid to swap the position of the image and highlighted grid cell, until you get a complete image. 26 274. When the game is not in progress, you can touch the large image on the top and select another image for the game. 28 29### Constraints 30 311. This sample can only be run on standard-system devices. 32 332. This sample demonstrates the stage model, which supports only API version 9. 34 353. This sample requires DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.992, built on July 14, 2022) to compile and run. 36