Two actors match.

pavelpavel Member Posts: 34
edited August 2013 in Working with GS (Mac)
How to make when one actor MATCHES with another actor and another actor destroys?

Help.

Comments

  • CatGoneCrazyCatGoneCrazy Member, PRO Posts: 90
    Not entirely sure what you mean, but if you're talking about a card matching game, you could have a boolean global attribute for each card, considered 'true' when the card is turned over. Then simply have an 'ALL' rule inside the actors in question that says 'when Card A boolean is true and Card B boolean is true, destroy this actor. Both actors will then be destroyed when they're turned over at the same time because the rule is in each.

    Hope that helps.
  • pavelpavel Member Posts: 34
    I mean position matching.
    I have ball and score ball.
    Then ball goes on score ball and FULL MATCHES with it score ball destroys.
    Do you understand me?
    Thank for your help)
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    This is a little clearer than the PM you sent me so will try and help here

    Try storing the ball x and y position in a game attribute, and store the score ball x and y position in a game attribute too. Then add a rule to the score ball saying that if game.BallX = game.ScoreBallX and game.BallY = game.ScoreBallY then destroy actor. Storing the positions of each in game attributes would be a lot easier than having the actors check each others positions.
  • CatGoneCrazyCatGoneCrazy Member, PRO Posts: 90
    Dang, I just sent a PM reply pretty much saying exactly what @KevinCross just said! Only he said it much more succinctly :) Well, I agree, that's how it's done. Once you get to grips with game level attributes, a world of possibilities open up!
  • pavelpavel Member Posts: 34
    Thank you CatGoneCrazy and KevinCross)
Sign In or Register to comment.