Rule for Number sequence
I need to add a couple of rules to change the images for my howto page. How do i create a button that once clicked it changes an atribute from 0 to 4?I mean every time i click this button i would like that GS changes the atribute "Howtopage" from 0 to 1, from 1 to 2, from 2 to 3, from 3 to 4 and then stops. It's there a way to do that?
Comments
Make a game attribute , integer, call it "how to page number"
Now make a background actor with the initial image , in that actor make a rule,
First change "game.how to page number" to 1 ( so the first image will come up every time)
When touch is pressed:
Change "game.how to page number" TO "game.how to page number" + 1
Now make rules like this:
When "game.how to page number" = 1
Change image to the first image.
When "game.how to page number" = 2
Change image to the second image.
And so on..
Then when "game.how to page number" = 5
You can change scene back to the menu!
Hope it helps you.
Roy.
And I think Tshirt has a tutorial on how to do counting like this with just math expressions that would probably be more efficient. I don't know how to do it without looking at it myself.
when adding +1 would be perfectly fine? is there a better response in game salad to multiplying it by a %?