Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Thanked 0 Times in 0 Posts

    Another Game - Tiled Picture Puzzle

    Sample Page

    A puzzle game that takes a set of images (that make up a pic)
    and randomizes them. Click one and then another to swap their
    places - upon completion an event is fired (user codable). Uses
    the document.images[] collective though I'm pretty sure it does
    not work in old NS browsers.

    view-source:http://fitale.resource-locator.com/volatile/tiles.js == The external js file
    //edit - forum wouldn't accept a [url = view-source: link] syntax

    Sample Page

    PHP Code:
    style type="text/css">

    script language="javascript">
    scripted in Notepad by [email]md@fitale.com[/email]
    image names should have syntax prefix_columnxrow.format 
    eg tile_3x4.jpg would be the fourth tile in the third row from the top


    folda "puzzleimage";                    // images folder
    picfix "tile_";                // prefix name of tiles
    format ".jpg";                 // file type
    coloms 8;                     // numbers of columns
    rowz 6;                     // number of rows
    wid 60;                     // width of tiles
    hei 60;                     // height of tiles
    diffi 2;                    // difficulty - max number of correct tiles at start - 1-4 is good
    function getset() {top.strt();}            // start event - possibly a timer function
    function dunit() {top.stp=0;}             // completion event - eg stop timer

    adim = new Array()
    for (
    x=0;x<[rowz+1];x++) {
    for (
    y=0;y<[coloms+1];y++) {
    adim[z] = new Image();
    adim[z].src folda+"/"+picfix+[x]+"x"+[y]+format;

    // -->

    <script language="javascript" src="[b]tiles.js[/b]"></script>

    Because I use psp7, I mimiced the tile naming protocol from the
    [file][export][imageSlicer] bit - so making puzzles should be no
    prob for peeps with that software.

    Anyway - feel free to play around with the coding - change the
    start/stop events - improve it, compress it, hey you can even
    make it NS4 compat if you want.
    Last edited by Íkii; 07-20-2002 at 01:42 PM.
    Íkii - formerly pootergeist
    teckis - take your time and it'll save you time.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts