toggle menu
Categories
Discussions
Dashboard
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Dashboard
Sign In
·
Register
×
Home
›
GameSalad 101
›
Working with GS (Mac)
Make a counter roll over up or down.
tenrdrmer
Member, Sous Chef, Senior Sous-Chef
Posts:
9,934
April 2011
edited November -1
in
Working with GS (Mac)
So I know how to make a counter rollover from say 10 back to 1 but how do you make it go from 1 to 10 so that it can go either way?
Comments
Rob2
Member
Posts:
2,402
April 2011
not sure if this is what you mean , both change attributes
self.count to (self.count-1)%11 counts down from 10 to zero
self.count to (self.count+1)%11 counts from from 1 to zero via 10
so I guess you would just replace the +-1 with a switching attribute
Rob2
Member
Posts:
2,402
April 2011
did this solve your problem ?
tenrdrmer
Member, Sous Chef, Senior Sous-Chef
Posts:
9,934
April 2011
Yes thanks. its always more simple than it seemed.
Sign In
or
Register
to comment.
Comments
self.count to (self.count-1)%11 counts down from 10 to zero
self.count to (self.count+1)%11 counts from from 1 to zero via 10
so I guess you would just replace the +-1 with a switching attribute