A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: [BETA] Slide Puzzle

  1. #1
    Professional Air Guitarist Frag's Avatar
    Join Date
    Dec 2002
    Location
    Brain, Body, Clothes, Computer Chair, Room, House, Neighborhood, City, State, Country, Continent, World, Galaxy, Universe, and on?
    Posts
    811

    [BETA] Slide Puzzle

    I figured it'd be cool to have a slide puzzle engine that pictures could be plugged into and ready to go, so I worked this up this morning. Press LEFT and RIGHT to go through the pictures/graphics (randomly chosen from my computer), UP and DOWN to adjust the difficulty (aka number of pieces), and SPACE to toggle the scrambler.

    http://www.gotcool.com/slidePuzzle.swf

    [PS] Sorry, no preloader (1.3 mb)

  2. #2
    Senior Member Danskeren's Avatar
    Join Date
    Jan 2004
    Posts
    263
    Gosh I just love kids They are the best !! She is so cute that little girl in pink.
    Possibilities are only limited by the lack of creativity...
    www.Ryer.dk
    www.ArrayPainter.com
    www.PawnStar.net

  3. #3
    doItLikeThis
    Join Date
    Jan 2004
    Location
    :noitacoL
    Posts
    1,080
    Wow, cool dude, does this engine breaks the images by itself to make the puzzle automatically?

    BTW: While randomizing, you can make a for loop instead of an if loop for randomiztion, which can randomize the puzzle just with one press of a button.
    Last edited by adit_ya_sharma; 01-02-2005 at 04:02 AM.
    -Aditya

  4. #4
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,180
    Hey,
    That's funny, I just started a similair engine this morning

    It's working nicely, but the masks sometimes screw up leaving ugly white lines between sections. Did you solve it by rezising the image? Or atleast that's what it seems like

    My engine also gets very slow when I devide the image in more then 8*8 pieces, do you have the same problem? Your maximum doesn't go above that so that's why I wondered

    I like your auto-scrambler

    Well uhm.. good luck with your engine
    SaphuA
    Last edited by SaphuA; 01-02-2005 at 06:51 PM.

  5. #5
    Professional Air Guitarist Frag's Avatar
    Join Date
    Dec 2002
    Location
    Brain, Body, Clothes, Computer Chair, Room, House, Neighborhood, City, State, Country, Continent, World, Galaxy, Universe, and on?
    Posts
    811
    Thanks.

    adit - The shuffling of the pieces is random. I used setMask() to get the individual pieces, so no photoshop or otherwise was necessary.

    SaphuA - I had the same problem with the ugly lines. After trying a bajillion combonations of Math.round(), floor, and ceil, I settled with this:
    code:

    w = Math.round(p._width/cols);
    h = Math.round(p._height/rows);
    p._width = w*cols;
    p._height = h*rows;


    It does distort the image a bit, but it isn't one of my major concerns. I probably won't do anymore with this anyway

    Also, I just re-uploaded it and now you can go up to 8x8. It is slower, but I think still playable.

  6. #6
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,180
    Hey,
    Thanks for the tip I made a slight change to it, came up with this:
    code:
    image._width -= image._width%devide;
    image._height -= image._height%devide;
    sectionWidth = image._width/devide;
    sectionHeight = image._height/devide;


    Edit: Fixed a bug
    It'll decrease the width/height of the image so that 'section' won't have decimals once devided. (I didn't bother to think of an easy way to increase the image if that'll have lesser effect on the size)

    Hope you can use it
    SaphuA
    Last edited by SaphuA; 01-03-2005 at 06:12 AM.

  7. #7
    doItLikeThis
    Join Date
    Jan 2004
    Location
    :noitacoL
    Posts
    1,080
    Originally posted by Frag
    Thanks.

    adit - The shuffling of the pieces is random. I used setMask() to get the individual pieces, so no photoshop or otherwise was necessary.
    So, if Iam not wrong, you are duplicating many mc's of the same photograph, and, all of them are masked at areas so that only that puzzle part of the picture is seen, cool idea!
    -Aditya

  8. #8
    juggernart me2222's Avatar
    Join Date
    Jun 2000
    Posts
    1,322
    Hi.
    Some weeks ago I made a slighlty different slide puzzle.
    http://www.juggernart.com/games/cele...ler/index.html

    It uses between 4 and 25 tiles depending on the level. The pictures are loaded externally.
    At 25 tiles it gets slower (on my Mac G4). I think the masking is responsible for the slowdown.
    juggernart.com

  9. #9
    doItLikeThis
    Join Date
    Jan 2004
    Location
    :noitacoL
    Posts
    1,080
    Originally posted by me2222
    At 25 tiles it gets slower (on my Mac G4). I think the masking is responsible for the slowdown.
    But still its fun!
    -Aditya

  10. #10
    Senior Member ihoss.com's Avatar
    Join Date
    Oct 2004
    Location
    Norway
    Posts
    581
    Real good, by all of you! Has anyone tried one of the old fashioned puzzles with the pieces and everything? It can't be that much of a difference. Just a drag and drop.

  11. #11
    Professional Air Guitarist Frag's Avatar
    Join Date
    Dec 2002
    Location
    Brain, Body, Clothes, Computer Chair, Room, House, Neighborhood, City, State, Country, Continent, World, Galaxy, Universe, and on?
    Posts
    811
    Originally posted by ihoss.com
    Real good, by all of you! Has anyone tried one of the old fashioned puzzles with the pieces and everything? It can't be that much of a difference. Just a drag and drop.
    Too easy to solve since Flash couldn't handle more than a few pieces

  12. #12
    the thud of the body rabbitkiller's Avatar
    Join Date
    Jan 2004
    Location
    Royal Oak, Mi
    Posts
    318
    Originally posted by Frag
    Too easy to solve since Flash couldn't handle more than a few pieces
    Electrotank guys made that jigsaw recently (in flash) you can do up to 475 pieces.. And yes it's very slow and sometimes buggy...
    Check the pic - that jigzy puzzle made of flash community forum reply form, and it's sopposed to be polar bears...
    Attached Images Attached Images
    world[i] = new world();

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center