Problem with disappearing the actor
Hello, in my game I have 2 actors when I touch the first actor the second actor will be appear (true, change Alfa color to 1). How to disappear the second actor by double pressing first actor or when appear is true ...please help
Comments
When Actor 1 receives touch, if 'visible' = false change 'visible' to true
When Actor 1 receives touch, if 'visible' = true change 'visible' to false
In actor 2
If visible = true change alpha color to 1
else change alpha color to 0
@alarm658
Hi, as @Kyukon says; and here it is with a bit more detail (changing the name of the boolean, let's call it A2vis; so if you've more "pairs" you can name the other ones B2vis, C2vis, etc)
In your first actor:
Rule: When touch is pressed
Rule: (nested in above) When A2vis is false
Change Attribute A2vis to true
Otherwise
Change Attribute A2vis to false
In your second actor:
Rule: When A2vis is true
Change Attribute self.Color.alpha to 0
Otherwise
Change Attribute self.Color.alpha to 1
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Hi, I'm not fully understanding what you're need now, to be honest, as the Inventory analogy confused me... (when picking an item from an inventory it's usual to have it highlighted, or similar, the other items remaining as they are).
But you want what you want, so first a bit more info please and I or another member can sort it for you.
So have I got it right the effect you're after?: You've one actor on screen, lets call it A. You press A and B appears, A disappears. If you press B, C appears and B disappears. If you press C, D appears and C disappears, etc. Is that what you're after?
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Is it routine? I want to disappear inventory. When I pressed the suitcase next to it appeared inventory. Now what I want, I want to disappear the inventory by again pressing the suitcase or by double pressing suitcase)))
So you have a suitcase that opens and closes an inventory. So, when this inventory is open it only shows the first item, even if there's more than one item in there? And when you choose it, it disappears and the next one appear, etc?
I'll show you how that can be done but first can I make a suggestion: forget the items appearing only when the one before has been pressed; so what you have is a suitcase when pressed, all your items in the suitcase appear at once (allowing you to press on one to highlight/drag or use it) and when the suitcase is pressed again, all the items disappear. This way seems to make more sense to me....
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
rule 1:
If visible = true change alpha color to 1
rule 2:
If visible = false change alpha color to 0
I made a mistake in my example. here is how rules in actor 2 should be.
rule 1:
If visible = true change alpha color to 1
rule 2:
If visible = false change alpha color to 0
YAHOOOOOOOOOOO!!!!!! Perfect!!!! it works excellent!!! Thank You so much!!!
I think it's time to close the discussion. But I don't know how to))))
I'll create another discussion about items in inventory))) Thanks a lot!