 Inside Technique : Sliding Puzzle Scriptlet By Scott Isaacs
Convert any image into a sliding puzzle!
Reference
<OBJECT
TYPE="text/x-scriptlet"
DATA="puzzle.htm"
</OBJECT>
| Properties | img | The URL of the image. |
| scale | The default size of the image is used. This specifies whether to scale the image larger or smaller. The puzzle automatically sizes itself to the size of the contents. |
| rows | The number of rows to break the puzzle into. |
| cols | The number of cols to break the puzzle into. |
| moves | (R/O) Returns the number of moves played in the current game. |
| Methods | play() | Starts a new game. |
| solve() | Solves the game. |
| Events | onready | The game is ready to be played. This event occurs every time the game is customized. |
| onnotready | This event occurs if the play() method is called before the image is downloaded. |
| onmove | The user performed a valid move. |
| onerror | The image failed to download. |
| onwin | The user solved the game |
| onplay | Occurs after the play() method is called and the game is ready to be played. |
| onsolve | Occurs after the solve() method is called and the game is reset. |
© 1997-2000 InsideDHTML.com, LLC. All rights reserved. |