3 State Button
jattard
Member Posts: 1
Hi,
I have two buttons which are controlled via an integer going from 0 to 3
One button (A) on touch adds a value and I used the following: (game.state+1)%4
The other button (B) on touch reduces a value and I used the following: (game.state-1)%4
Now not sure this is the best method to go for but the issue is that when the integer reaches 3 by pressing the button (A) x3 and then i hit the reduce button (B) it goes back to 0 instead of reducing to 2
Any ideas?
I have two buttons which are controlled via an integer going from 0 to 3
One button (A) on touch adds a value and I used the following: (game.state+1)%4
The other button (B) on touch reduces a value and I used the following: (game.state-1)%4
Now not sure this is the best method to go for but the issue is that when the integer reaches 3 by pressing the button (A) x3 and then i hit the reduce button (B) it goes back to 0 instead of reducing to 2
Any ideas?