itemNR tells you which item is currently selected. "Set item to: (itemNR+1)<=2 ? itemNR+1 : 0" lets you go through your list. It goes like this: 0 (remember that it's the first index in the array), 1, 2... and in my example you don't have 3rd array index, so you have to return to 0 index. So the exact performance is:
- your current itemNR=2,
- on touched Sprite the condition is checked: (2+1)<=2; it's not true, so Construct sets itemNR value to 0.
Take a look at Operators part here:
https://www.scirra.com/tutorials/77/nat ... onstruct-2
Thanks I understand it now <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" />
Do you know how I can use the array.At expression to point the return value to a specific line on the array, say the second or third row?
Also, how do I cycle through the Y axis instead of the X? Some of my buttons will cycle downwards through the array instead of across.
I'm trying to work it out myself but I keep getting incorrect expression etc....