Mi Ni Pai

Game Components and Options


In its purest form, Mi Ni Pai is a very simple, easy to play game. Technically, however, this implementation is very complex, offering a wide variety of features.

This page will discuss the different components of the games and the features which are available. Note that this is only an introduction and an overview. For more information on implementing any of these features consult the page on
Applet Parameters.

Required Components
Java Class Files Applet HTML
Pattern Image Background Image
Tile Collection Help Text
  Shareware GIF
Optional Images
Expanded Tile Sets Zoom Images
Bonus Images Multiple Backgrounds
Basic Sounds Continuous Sound
Periodic Sounds  
Other Visual Features
Colors Remove Tile Effects
Messages Captions
Tile Drawing Options  
Play Options
Levels Layouts


Loosely defined, an "edition" of Mi Ni Pai is an implementation of the game at a particular URL on the web using a particular set of tile images. Any implementation which uses a different set of images, or uses the same images but located at a different URL, constitutes a separate edition. For more information, refer to the precise definiton of an edition.

Required Components

Every game, at a minimum, consists of the applet HTML (imbedded in a web page), the Mi Ni Pai Java class files, a collection of 36 tile images, a pattern image and a single background image.

The Java Class Files

The Java class files are the actual Mi Ni Pai program. All class files must be present for the program to function.

The Applet HTML

The applet HTML is used to identify the location and name of the components to the Java program, and to configure the game (i.e. establish file locations, game size, turn features on, etc.).

The Pattern Image

The pattern image is simply used to tile the background (and the applet area when the game is played in its own window) when no background image is available (i.e. it hasn't been downloaded yet).

The Background Image

The background image is placed behind the tile set. It is the players reward, the hidden treasure which the player is attempting to uncover. As such it should be a most appealing image, and the focus of the image should be buried in the heart of the tile structure (so that all tiles must be removed to completely appreciate the background image).

The Tile Collection

The tile collection consists of (at least) 36 tile images. The 36 tile images are used to draw the 144 tiles in the standard game. They must all be the same size (usually 50 pixels high for a 640x480 or 800x600 game).

All images may be either GIF or JPEG format, whichever is best suited to compressing and rendering the image involved.

The Help Text

The standard help text file comes with the this Host Kit, but may be customized for individual editions. It is displayed when the user requests instructions during the game. Note that normally this file should be suppled as is, and any modifications (as well as a brief introduction to the game) should be included on or immediately before the web page containing the applet.

The Shareware GIF

This component is not necessary for a version of the game which is played over the Internet. It is possible put all of your files into a zip file and allow players to download and expand that file. By opening the unzipped applet HTML file, they can play the game without connecting to the Internet. If you do so you should supply the standard shareware gif in your zip file (in the same directory as your applet HTML, named simply "shareware").

Optional Images

Three types of optional images may be included in an edition.

Expanded Tile Sets

An edition may make more than 36 tile sets available (a "tile set" is the collection of all images which will match with each other when the game is being played). An edition may also make more than one image available for a particular tile set (so that each individual tile may have its own image). At any one time only 36 tile sets will be loaded, and at most 4 tile images will be used (one for each tile in each set of 4). Every tile set must have a first image, but not all tile sets need have the same number of images.

A slightly difficult game would use 4 different images for one tile set, and only a single image for the remaining 35 tile sets. An excedingly difficult game would use 4 different images for each of the 36 tile sets in play at one time.

Zoom Images

Zoom images are displayed when the player double clicks on a tile. They are meant to help the player resolve exactly what a particular tile represents, in case they have difficulty discerning the image on a small tile. Generally, zoom images should be 2 to 4 times larger than the corresponding tile image, and use exactly the same image.

Bonus Images

Bonus images are displayed either when a player removes a pair of tiles, or when a player has removed all 4 tiles in a tile set. This image is meant to be a reward for matching the tiles, and generally is a much larger, better resolution version of the tile images, although it may be shaped and cropped differently.

In addition to viewing bonus images when a match is made, players can review the images they've earned this game using command keys to either view them one at a time, or initiate a slide show of the images.

Multiple Backgrounds

More than one background image can be made available. The choice of background when a new game loads can depend on the level of play or the board layout, it can be random, or it can depend on some combination of those three aspects, all controlled by the applet HTML.


Three types of optional sounds may be used by an edition.

Basic Sounds

A game may use a collection of basic sounds which are played when certain user actions are taken or events occur. These sounds must be in Sun au format (the only sound format which Java currently handles). The sound events are:
Startup New/restart game Select a first tile
Select a matching a tile Select a non-matching tile Invalid action
Request a clue Mark a spot in the game Show a bonus image
Show a zoom image Win the game Lose the game
Undo a move    

Continuous Sound

The continuous sound (usually music) is played in a constant loop whenever a game is in progress. The music is stopped after the player wins or loses the game, and resumes when the player restarts the same game or starts a new game.

Periodic Sounds

A game can optionally include any number of periodic sounds. The periodic sounds are played at constant intervals, one after the other. After the last periodic sound is played, the sequence begins again starting with the first sound. This continues as long as the applet is active (i.e. as long as the program is running).

Other Visual Features

In addition to the images available, a variety of other features can be used to enhance the game.


All of the colors used in the game can be set for an edition. These include colors for:

The background Tile frames Highlighted tile frames
Tile sides Win message Lose message
Options screen text    

Colors are specified by using simple, english descriptions like "very dark red".

Note that tile frame and highlight colors should be carefully chosen to provide adequate contrast with the tile images to allow the user to easily distinguish tiles, and immediately located highlighted tiles. Tiles are highlighted when the player requests a clue.

Remove Tile Effects

When tiles are matched the removal can be animated using a number of preprogrammed visual effects.

Motion effects include:

Fly Tiles accelerate off the screen.
Coast Tiles move smoothly off the screen.
Swirl Tiles spiral off the screen.
Wander Tiles meander in different directions until they leave the screen.

Transition effects include:

Fade Tiles gradually and evenly fade (become transparent).
Dissolve Tiles gradually, but unevenly, fade.
Waver Tiles fade with a wave effect.
Twinkle Parts of the tile randomly, sporadically and gradually change to a chosen color, then fade.
Glow The entire tile gradually changes to a chosen color, then fades.

The speed and timing of all effects is controlled in the HTML. In addition, the HTML can control the direction (for motion effects) and color (for twinkle and glow effects).


Three game messages can be changed for each edition; the message shown when a new game is started, the message shown when a player loses and the message shown when a player wins.

In addition, the HTML can be used to change the copyright message for any images used and the name of the party hosting the edition.


Whenever a zoom or bonus image is displayed, the game can display a caption associated with that image in the browser status window. The caption can also be displayed on the game board with the bonus image itself. These captions are specified in a text file which can be referenced in the applet HTML.

Tile Drawing Options

Two options can be used to change the appearance of tiles (in addition to the side, frame and highlight colors).

An edition can set the "tile trim"; the degree to which tile corners are rounded.

An edition can also set the tile "side height"; the size of the sides of the tiles (for 3D effect).

Play Options

Two features programmed into the game can add variety or make the game more challenging.


When more than one image is supplied for each tile set in a tile collection, the game can be played at different levels. Each level corresponds to the number of different images displayed for a tile set, up to the maximum number of images available to at least one tile set in the collection. For example, level 2 would display 2 different images (when available) for the 4 tiles in each set (one image for 2 tiles, another image for the other 2 tiles). Level 4 would display an entirely different image for each tile (when available).

An edition can be set with an initial level, a minimum level and a maximum level. The maximum level is 4, even if more than 4 images are supplied for each tile set.

When multiples images are supplied for each tile set, the user may also change which images are used in different levels. For instance, by playing at level 1, tile rank 2 the player will see (whenever available) the second image in each tile set instead of the first. A player can also see a random image from each tile set.

It is also possible to vary the backround image by level, so that players which choose the more difficult levels are treated to a more rewarding background image.

When playing a multi-level game it is possible to "charge" the player for clues. If a player uses too many clues, the level can be automatically dropped (and the background image changed, as well, as is suited to the new level).


Mi Ni Pai is normally played on the standard, traditional layout. It can be played using different layouts, however. A small selection of layouts has been included in the game, and an edition can determine which of these layouts are valid. It sould be noted that some of the layouts do not obscure the same parts of the background image as the standard layout.

A modification is in the works to allow an edition to declare its own layouts.

Back to the Host Kit Main Page