Making two events mutually exclusive
mshuraih
Member, PRO Posts: 179
Hi , i have two types of actors , the first ( actorA) touching it causes loss of one life, the other actor ( actor B when its touched it ends the game, the actors are moving and when they overlap, the touch activate both actions, which is undesired outcome. I tried to connect both actors touch to attribute so if both are true ( A+B ) switch B to false and keep A true. but still did not work , any suggestions?
Answers
Before we get to a possible solution, why is it a problem if the actor both loses a life and loses the game? Wouldn't the game over condition take precedence over losing a life? Are you sure you want the actor to only lose a life and not lose the game if it collides with actor A and actor B at the same time? Obviously you know your game better than I do, I'm just curious about why that would be important.
Try this in your main actor:
When actor collides with [actor A], change self.touchingA (boolean) to true and change attribute game.life to game.life - 1, Otherwise change self.touchingA to false.
When attribute self.touchingA [do nothing], Otherwise... When actor collides with [actor B], [end the game].
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thank you! will try that. as far your question you are right but its just the different actors connected to different counters in the game. will try ur advice