Hello and welcome to our community! Is this your first visit?
Register
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
    Location
    UK
    Posts
    577
    Thanks
    0
    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:
    <html>
    <
    head>
    <
    style type="text/css">
    body{margin:0pxbackground-color:ButtonFace;}
    </
    style>

    <
    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++) {
    z=(x*coloms)+y;
    adim[z] = new Image();
    adim[z].src folda+"/"+picfix+[x]+"x"+[y]+format;
    }
    }

    // -->
    </script>
    </head>
    <body>

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

    </body>
    </html> 
    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 12: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
  •