OK this is driving me up the wall now. I've managed to get the score adding/subtracting, but because it's an 'is touching' event the scores rocket up/down if the button is held.
---
Global number Score = 0
Global number Answer = 0
Global number AnswerCheck = 0
Global number Guess = 0
System > On start of Layout > Score > Set text to "Score: " & Score
System > On start of Layout > System > Set Answer to choose(1,2)
System > On start of Layout > System > Set AnswerCheck to Answer
Touch > Is touching GuessButtonYes > System > Set Guess to 1
Touch > Is touching GuessButtonYes > System > Set AnswerCheck to Answer
---- System > Guess = AnswerCheck > System > Add 1 to Score
---- System > Guess = AnswerCheck > System > Restart Layout <-- restart layout adds/subtracts the score on the next layout, but it cycles through this for as long as the mouse is held down
---- System > Guess ? AnswerCheck > System > Subtract 1 from Score
---- System > Guess ? AnswerCheck > System > Restart Layout <-- restart layout adds/subtracts the score on the next layout, but it cycles through this for as long as the mouse is held down
I've tried the Trigger once action but it still continually restarts the layer and rockets up/down the score.
I need an action that restarts the layout once per click.
Any ideas?