How to recognize a "touch is not on any of these x number of actors"?

Hi all -
Say I have multiple identical actors in a scene.
How can I get them to react to a touch event that does NOT touch ANY of them? I.e. A rogue touch.
"Touch is outside" doesn't work, because if I touch Actor 1, then that's "touch is inside" for him, but "touch is outside" for any other actors in the scene.
Say I have multiple identical actors in a scene.
How can I get them to react to a touch event that does NOT touch ANY of them? I.e. A rogue touch.
"Touch is outside" doesn't work, because if I touch Actor 1, then that's "touch is inside" for him, but "touch is outside" for any other actors in the scene.
Best Answers
-
mynameisace Hull, UKPosts: 2,484
Made this for you buddy:
http://mynameisace.com/files/RogueSquadrenLeader.gameproj.zip
Touch 4 of the actors and then the last one will fall.
Ace -
tatiang Posts: 11,949
@frankwashburn Yes, mouse is down means that a touch registered anywhere on the screen. And I thought that the overlapping change attributes (true & false) would be a problem, but in my demo it worked great (http://dl.dropbox.com/u/19602014/Detect Rogue Touch.zip). My other solution was to add a counter to each actor as follows:
When touch is pressed, change game.counter to game.counter+1; otherwise change game.counter to game.counter-1.
In the checking actor, check to see if game.counter>0 (a rogue is being pressed!).
Haven't checked my other solution though... let me know if it works for you.New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
Then have a separate actor that checks to see if mouse is down AND game.actorsTouched is false, which would be a rogue touch.
If you need a demo, let me know.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User