How would you achieve this behaviour ?

steve86steve86 Member Posts: 806
edited November -1 in Working with GS (Mac)
Hey guys.

I'm trying to make a rule that when 3 or more of the same actors are touching themselves (balls of the same color) they all destroy themselves. Kinda like bubble shooter when you get three of the same colored ball together they destroy themselves.

can you help me do this?

Thank you

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    try having a atribute called ballcount and set it to 0

    have a rule when ball actor overlaps or collides with actor (itself)

    change ballcount to ballcount+1

    then have another rule in the ball actor when ballcount=3 destroy

    that wil work depending on how your trying to do it
  • steve86steve86 Member Posts: 806
    thanks john...

    let me try that I think that would do the trick
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    steve86 said:
    Hey guys.

    I'm trying to make a rule that when 3 or more of the same actors are touching themselves (balls of the same color) they all destroy themselves. Kinda like bubble shooter when you get three of the same colored ball together they destroy themselves.

    can you help me do this?

    Thank you

    Oh man, the 12 year old in me is having a giggling fit on this one!

    :)
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    yeah thats why i said depending on what your trying to do haha. I wasnt sure if you were just using that as a bad example, or thats actually how you want to do it.

    what i posted is for say every time they hit each other or something then after the 3rd time destroy. Not for an actual bubble shooter or bejewled type game

    like tshirt said you would usueall use an array. Im working on a bejewleed type game i posted some vdeos of a while back, and the work around is a big pain.

    it basically consists of spawning actors in a certain patteren, giving each color a id number, depeding on how many of the same color id are overlapping with your spawned actors, addign to a chain attriute to determine how many there are and rferecning that with the actors your spawnign.

    Again like tshirt said its not easy, but you can check out codemonkeys demo which is whre i got the start for my system from
  • steve86steve86 Member Posts: 806
    thanks for the heads up TSB, can you tell me the name of the demo by codemonkey?

    thank you :)

    because I tried it like you said john and it didn't work quite well..
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Yeah like I posted above I didn't know u meant actually detecting threwout the whole screen where there's 3 or more touching or in a row.

    The demo is called bejeweled demo by codemonkey

    Again just letting you know even with that demo, it's not easy. It will require alot of effort to get right
  • steve86steve86 Member Posts: 806
    thanks john.. I'll see what I can do..

    wish me luck lol
Sign In or Register to comment.