This is basically my menu thingo, each cell is a value.
When my variable equals the same as the cell value, the cell is selected (shows as '2' in the picture).
This is what I'm doing for moving down the menu ( in the first column):
-Down is pressed |
-Value >= 1 | Add 1 to value
-Value <= 4 |
-Value = 5 | Set value to 1
And a similar thing for moving up, except subtracting 1 from value.
This works fine, however I'm having trouble moving left/right
I've tried something like this (for moving right in the first row of the menu):
-Right is pressed |
-Value = 1 | Add 4 to value
- OR |
-Value = 5 |
- OR |
-Value = 9 |
-Value = 13 | Set value to 1
However it doesn't always seem to work right. Is there a different/better way to code something like this?