15 Fifteen Sliding Puzzle maker for HTML5

A simple implementation of the classic mini-game Fifteen Sliding Puzzle, using HTML DOM document elements and without using Canvas or third party libraries.

When mixing a picture, random replacement of slots is not used, only natural mixing by moving a free slot, thanks to this, an error is excluded, due to which the puzzle may not be assembled.

By solving the puzzle, you can move several blocks in a column and a row in one move.

The engine code is very flexible for modifications, has many settings and can be integrated into any web page or web app.


Editor / Demo
You can upload your image, set parameters and generate an html file with the game and your image. You can use the resulting file on your website or directly on your device, or you can modify it yourself, change the parameters, or write your own script that will run after the game is finished.

Editor features

  • Automatic style adaptation based on image dimensions
  • Proportional division of an image into blocks
  • Building / exporting HTML file with the game
  • Moving multiple blocks in one move
  • Drag and Drop upload image



Structure
To use it, you need to create a div element with ID "fifteen" and add an array with parameters, the script will do the rest itself. The script is very simple and you can easily add this mini-game to your web page.

<div id="fifteen"></div>
<script>
    var setup={
        puzzle_fifteen:{
        diff:300,
        size:[512,640],
        grid:[3,3],
        fill:true,
        number:true,
        art:{
            url:"art.jpg",
            ratio:false
        },
        time:"0.1",
        style:"border-radius:12px;"
        emptySlot:[1],
        keyBoard:true,
        gamePad:true
        }
    }
</script>
<script src="fifteen_puzzle.js"></script>


The project is available on GitHub: https://github.com/Kirilllive/Fifteen_puzzle_maker



I will be glad to support the project onx patreon or PayPal


Download

Download NowName your own price

Click download now to get access to the following files:

Fifteen Sliding Puzzle maker.zip 292 kB

Development log

Comments

Log in with itch.io to leave a comment.

(+1)

i did it :P


Cool!👍