Limit touch to a single actor/instance.
tatiang
Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
I spent way too much time figuring this out, but if it benefits someone else, it's worth it.
There may be a simpler way (oh please, oh please) but I couldn't get this to work with booleans, index counting, or game.Touches.Count. It _almost_ works without resorting to what I did, but not quite.
This -- I think -- ensures that only one answer is chosen, even if multiple actors are tapped.
The key is that each actor (or instance of an actor) must have a unique attribute. In this case, I used self.Label and then populated each instance with a value: A, B, or C. This is to simulate a quiz app.
There may be a simpler way (oh please, oh please) but I couldn't get this to work with booleans, index counting, or game.Touches.Count. It _almost_ works without resorting to what I did, but not quite.
This -- I think -- ensures that only one answer is chosen, even if multiple actors are tapped.
The key is that each actor (or instance of an actor) must have a unique attribute. In this case, I used self.Label and then populated each instance with a value: A, B, or C. This is to simulate a quiz app.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Comments
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
The problem (and in this case, it's a quiz game with a single right answer from multiple choices) is that if you press and hold on two or more actors with that rule and then let go, one or more of the actors triggers that rule and checks for a right answer. So it's very easy to cheat without knowing the correct answer.
@FryingBaconStudios Yes, it'd be helpful to see another approach, even if it's similar. Thanks!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS