creating a counter

mcmunchlymcmunchly Member Posts: 2
edited November -1 in Working with GS (Mac)
How do I make a counter?

I tried making an actor and giving it an integer attribute called counter and setting to 10.

Then I create the actor when hold the mouse down. Then the actor has two rules.

The first rule says when self.counter is larger than one set self.counter to self.counter-1.

The second rule says when self.counter = 0 destroy the actor.

The actor never gets destroyed so something isn't working.

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    To see if its changing the attribute or not You can make make a plain actor drag the display text behavior and choose attribute self.counter to be displayed. Then drag it in your scene and preview so you can see if the attributes changing at all while your clicking
Sign In or Register to comment.