In the end, I made them procedurally generate, which really took a lot of the time of the jam, leaving less time to work on other aspects, but I think it turned out alright.
Originally I tried using a grid box to align and scale each cell, but i wasn't able to get position data from those cells, so I ended up coding the cells into place on generation and then moving and scaling them to fit the screen. The next part was upon generation of a cell, it was added to an array that I told to use a colour from an array and link two randomly picked cells to that colour, that was only those two cells could be connected, but not different color cells etc, with the line data being stored on one of the linked cells. This quickly became a problem when the randomly picked locations would sometimes arrive in outcomes where the puzzle was incompletable, so I had to add path logic which would create an invisible path between the start and end points and then lock those used cells to that colour so that other colours would have to find a different way around to connect each other. Sometimes the invisible paths would lock in over complicated positions and directions, but it's fine since the user doesn't see them and they can draw into any free space, it just leaves a lot of unused spaces when the player finishes a section, but it's still consistently playable which I was happy with.
← Return to game
Comments
Log in with itch.io to leave a comment.
This is awesome!
Did you make all the puzzles by hand or did you code an algorithm to generate them?
Thanks! I'm really glad you liked it!
In the end, I made them procedurally generate, which really took a lot of the time of the jam, leaving less time to work on other aspects, but I think it turned out alright.
Originally I tried using a grid box to align and scale each cell, but i wasn't able to get position data from those cells, so I ended up coding the cells into place on generation and then moving and scaling them to fit the screen. The next part was upon generation of a cell, it was added to an array that I told to use a colour from an array and link two randomly picked cells to that colour, that was only those two cells could be connected, but not different color cells etc, with the line data being stored on one of the linked cells. This quickly became a problem when the randomly picked locations would sometimes arrive in outcomes where the puzzle was incompletable, so I had to add path logic which would create an invisible path between the start and end points and then lock those used cells to that colour so that other colours would have to find a different way around to connect each other. Sometimes the invisible paths would lock in over complicated positions and directions, but it's fine since the user doesn't see them and they can draw into any free space, it just leaves a lot of unused spaces when the player finishes a section, but it's still consistently playable which I was happy with.
TLDR:
Yeah the puzzles are procedurally generated
That's awesome