2 Player Switch Turns Help

I am making an optional 2Player matching card game. I already have a boolean attribute called "Activated card" that identifies when two cards have been flipped. I have 24 cards and I have a score system that counts the total pairs. I made an Integer attribute called Switch turn that switches between each player if "activated card" is true and "score" is 0, Switch attribute = (switch+1)%2, makes it switch fine. The trouble is keeping it on the player when he gets a correct pair and stop it from switching. I have tried when score = 1 to stop the switch. And then set the score back to 0 to start the cycle over again. But for some reason it keeps on switching. Any ideas on how you would go about solving this would help me greatly. Thanks.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    If your rule condition has switch=0 or switch=1, then this will certainly be the case. But in your post, you mention score=0 and score=1. Was that a typo? What does score have to do with switching turns?

    Most likely, you need to remove the conditions from those rules so that the switch attribute is not a condition. So if you have a boolean such as activated card that gets set to true when the player's turn is over (is that case?) then you would do Change Attribute game.switch to (game.switch+1)%2 and Change Attribute game.activated card to false.

    If that doesn't make sense, post a screenshot of your rules and I'll help you further.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Or, nevermind. I see you had two threads open for the same question. Please keep questions to a single thread.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

This discussion has been closed.