buy/equipped/unequipped buttom for the store
hello everyone
I do a buy actor for my store
but
I want when I touch my buy actor the actor image change to equipped and when I touch this actor a 2nd time the actor image change to unequipped image and when i touch a 3rd time the actor image change to equipped
finaly I want when the actor image is equipped and when I touch it the image change to unequipped and when the actor image is unequipped and when I touch it the image change to equipped.
thank you
I do a buy actor for my store
but
I want when I touch my buy actor the actor image change to equipped and when I touch this actor a 2nd time the actor image change to unequipped image and when i touch a 3rd time the actor image change to equipped
finaly I want when the actor image is equipped and when I touch it the image change to unequipped and when the actor image is unequipped and when I touch it the image change to equipped.
thank you
Comments
Hello @tiesto Here's the programming for toggling between two states, "never-ending"
Rule: When touch is pressed
When toggle is false
Change Image [to] equipped
Change Image toggle to true
Otherwise
Change Image [to] unequipped
Change Image toggle to false
------
If you mean only a certain amount of times, then make an integer attribute, let's call it Count.
Rule: When touch is pressed and Count < 4
Rule(nested): When toggle is false
Change Attribute Count to Count+1
Change Image [to] self.equipped
Change Image toggle to true
Otherwise
Change Attribute Count to Count+1
Change Image [to] self.unequipped
Change Image toggle to false
---------
By the way, I've just deleted two other threads which are identical to this one. Please don't make duplicate threads; it's against Forum rules.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Make a true/false attribute for each actor
Then make a rule that say if true change image to equipped / if false change image to unequipped.
You would need images that say equipped and unequipped on them, for each actor.
I will test it and tell you if it works
it only show me Unequipped. The image doesn't change
so:
when touch is pressed
change counter (real) to 1
when counter=1
change image: Equipped
when counter=1
touch pressed
change attribue counter to 0
when counter attribue=0
change image : Unequipped
when counter=0
touch pressed
change counter to 1
this is what I do so please explain me why it doesn't work
or if you have an other idea post it
thank you
by when buttom b is down when couner=0 and it works perfectly
so I think that the problem come from there
don't tell me to let it like that because I want to touch the buttom
thank you
please help me