1. File list


2. How does it work

Puzzle OnSite needs two windows to play the game: the control window and the game window.

The control window is the browser window that loads the "0sample.html", which includes the control script to define the images for the puzzles.

The game window is the browser window that pops up when you click on an image thumbnail in the control window. It loads the game script, gets the image information from the control window, builds the puzzle and interacts with you.


3. How to use your own images

You need to modify both the "0sample.html" and the "puzzlex.js" to supply your own images to the puzzle game.

In "0sample.html", you need to include the "0puzzlex.js" inside the <head></head> section, like this:

<head>
<title>You page title here</title>
<script language="javascript" src="0puzzlex.js"<>/script>
</head>

... add the functoin call onload="setupImages()" in the <body> tag, like this:

<body ... onload="setupImages()">

... and use the following syntax to define a thumbnail link:

<a href="#puzzlexN"><img src="your_thumbnail_image" width="..." height="..." border="..."></a>

where N starts from 0, and should match the puzzle image index mentioned below.

In "puzzlex.js", look at the "defineImages()" function at the top of the file:

function defineImages() {
  picPool[0] = new picPara("0laputa1.jpg",450,350,5,5,10,"image from Laputa, 450x350, 5x5, 21kb");
  picPool[1] = new picPara("0laputa2.jpg",450,350,5,5,10,"image from Laputa, 450x350, 5x5, 31kb");
  picPool[2] = new picPara("0laputa3.jpg",450,350,5,5,10,"image from Laputa, 450x350, 5x5, 29kb");
  picPool[3] = new picPara("0laputa4.jpg",450,350,6,5,10,"image from Laputa, 450x350, 6x5, 25kb");
}

The "defineImages()" function is where you define your images. All you need to do with "puzzlex.js" is to change this function and define your images with the following syntax:

  picPool[n] = new picPara("your_puzzle_image", imageWidth, imageHeight, puzzleColumns, puzzleRows, puzzleMargin, "image description to be shown at browser status bar");

where n is the puzzle image index which starts from 0

You must make sure that the presenting order of the thumbnail links in "0sample.html" matches the puzzle image index in the "defineImages()" function in "puzzlex.js". For example, the first thumbnail link in "0sample.html" will launch the puzzle game with the first puzzle image(indexed 0) defined in the "defineImages()" function in "puzzlex.js".


4. Images for the puzzles

An image is good for the puzzle game if you can "slice" it exactly. Usually people like to have the puzzle tiles in square shapes, so, for example, an image with the size of 640x480 is good for puzzles of 4x3, 5x4, 8x6, 10x8 and 16x12, etc.