Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Dave Galvin |
I’m porting a logic grid puzzle engine I wrote in Python a while back to Godot. Users will be able to use this to solve and create logic grid puzzles. My question is whether there is a best practice I should follow for the UI.
The basic flow is:
- The user enters a number of categories and elements per category
- The engine builds the matching puzzle (elements x elements blocks for every pair of categories)
- The user can then label the categories and elements
- Every category.element pair can then be marked as equal or not equal, with an initial state of unknown.
What’s a good way to approach this, or a good tutorial to read through? At least a couple approaches come to mind:
- Dynamically generate choose(categories,2) * (elements ** 2) buttons (one for every category.element pair (the cells in the picture below)), and update based on left- or right-clicking buttons
- Draw the grid, and somehow map mouse clicks to category.element pairs positionally
Here’s an example of a logic grid puzzle
The advice I got on Discord was to go for lots of buttons. The example above is small, but this could be on the order of a few thousand cells = buttons. Apparently that won’t cause performance issues.
Another possibility is to use Tiles.
Dave Galvin | 2020-12-29 19:58