Hi,
I want to implement controls system on hexagonal tileset. The tileset should be the same as image in attachment. I want to be able to mark each tile by arrow keys or mouse click.
In mouse click should be easy, if I click for example on tile 5, then tile 5 hexagon is marked (meaning that change color to blue), when I click on tile 17, then tile 5 change color back to white and tile 17 change color to blue etc.
Same should work if I want to mark tile hexagon by keyboard, but with difference when I’m on tile 1 and press rightkey, should move on tile 2, next rightkey on tile 3 next on the tile 4, but leftkey pressed when I’m on tile 4 move me back to tile 3.
The hardest part be, when I’m on 1 and press downkey should move to tile 5, another downkey move me to tile 10 upkey to tile 5 etc.
The question is, how to achieve this in some efficient way?
If there will be implemented only movement from left to right and right to left, then can be easily done by changing some control variable to + -1, but I don’t know how to do it for Up and down control mechanism.
Thank you for answers
I want to implement controls system on hexagonal tileset. The tileset should be the same as image in attachment. I want to be able to mark each tile by arrow keys or mouse click.
In mouse click should be easy, if I click for example on tile 5, then tile 5 hexagon is marked (meaning that change color to blue), when I click on tile 17, then tile 5 change color back to white and tile 17 change color to blue etc.
Same should work if I want to mark tile hexagon by keyboard, but with difference when I’m on tile 1 and press rightkey, should move on tile 2, next rightkey on tile 3 next on the tile 4, but leftkey pressed when I’m on tile 4 move me back to tile 3.
The hardest part be, when I’m on 1 and press downkey should move to tile 5, another downkey move me to tile 10 upkey to tile 5 etc.
The question is, how to achieve this in some efficient way?
If there will be implemented only movement from left to right and right to left, then can be easily done by changing some control variable to + -1, but I don’t know how to do it for Up and down control mechanism.
Thank you for answers
Attachments
-
28 KB Views: 11