Toggle collide on ball & peg... bounce action needs to be moved into peg rules?

jmp909jmp909 Member Posts: 73
edited November -1 in Working with GS (Mac)
Hi,

i was just playing around with the Pachinko example and I wanted to make the pegs not collidable if i click on them.. the only way I can see to do this is move the bounce/play sound rule into the peg not the ball and wrap it in a condition on a custom attribute

eg:

PEG: if touched, set attribute self.collidable to false
if self.collidable = true bounce when hits actor of type ball & play sound

it seems a little odd because it's not the peg that's actually meant to bounce (and it won't because it's not movable), but the result is the same

Is there another way to do this using rules in the ball? (since it can't see Peg's attributes i'm guessing not)

thanks
j

Comments

  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    You did it the right way. To use rules in the ball, you would need to have a game attribute, like your "collidable" one in the peg, for every peg...the pegs would update their respective game attribute, and the ball would only be set to collide with pegs that are "collidable".
Sign In or Register to comment.