HTML5-Image-Slider-Game icon indicating copy to clipboard operation
HTML5-Image-Slider-Game copied to clipboard

Canvas grid

Open Underdot opened this issue 12 years ago • 5 comments

The puzzle isn't working when I change the number of the canvas grid (4 is the default).

Underdot avatar Jul 02 '13 21:07 Underdot

True it only works with a 4*4 grid (too complicated for the first level)

AlejandroGarciaPol avatar Sep 26 '14 07:09 AlejandroGarciaPol

Found a solution!

delete this line j = canvas_grid, and add this one under the potential_spaces array: var j = potential_spaces.length;

and now it works with all canvas grids.

The problem was that the while loop was ending after finding the matching potential_spaces index, so the piece couldn't be moved.

AlejandroGarciaPol avatar Sep 26 '14 09:09 AlejandroGarciaPol

@AlejandroGarciaPol awesome spot! thanks :-) would you mind opening a PR for this?

Integralist avatar Sep 26 '14 09:09 Integralist

Oh wow, I've just realised how long ago this issue was opened! I never got the original notification?? :-(

Integralist avatar Sep 26 '14 09:09 Integralist

Of course :), I just made the PR two days ago.

AlejandroGarciaPol avatar Oct 01 '14 10:10 AlejandroGarciaPol