Make a counter roll over up or down.

tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
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

  • Rob2Rob2 Member Posts: 2,402
    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
  • Rob2Rob2 Member Posts: 2,402
    did this solve your problem ?
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Yes thanks. its always more simple than it seemed.
Sign In or Register to comment.