Collision with irregular shaped objects?

HappyKat78HappyKat78 Member, BASIC Posts: 173
edited February 2012 in Working with GS (Mac)
Hi All,

I'm trying to have a ball collide with a large tree - which obviously isn't square or circular - but I only see the option to set collision to one of the two (Rectangle / Circle). In both instances the boundary for the rectangle or circle are nowhere near the branches etc. of the tree so the ball doesn't even come close to touching the actual tree before it collides. Is there a way to have an object collide with irregular shaped objects by using their own shape? If not, do I have to dice up the tree into lots of little parts? Seems like a tedious task if so, but just trying to figure out the best way to handle this.

Thanks very much in advance!

Comments

  • simo103simo103 Member, PRO Posts: 1,331
    @HappyKat78 ... I would create another actor and place numerous of them over the tree and make some long and thin for the branches, fat for the trunk etc and then have your actor collide with them not the tree. Also drop a change attribute self.alpha to zero in the actor first and they will be invisible.
  • HappyKat78HappyKat78 Member, BASIC Posts: 173
    Great, good advice, thanks very much. So I assume Gamesalad doesn't support pixel collision then? That would be a nice future update though wouldn't it! :-)
  • simo103simo103 Member, PRO Posts: 1,331
    @HappyKat78 .... I believe we may get polygon shapes but (if my info is correct) GS is based on the BOX2D physics engine which doesn't support pixel collision
  • Rob2Rob2 Member Posts: 2,402
    Unlikely to ever support pixel collision but hopefully convex polygons will come soon.
  • HappyKat78HappyKat78 Member, BASIC Posts: 173
    Well, that would still make life easier. :-) Thanks again for the support! The GS community rocks!
  • Rob2Rob2 Member Posts: 2,402
    @simo ...we collided.
  • jckmcgrawjckmcgraw Member Posts: 647
    @rob2 What about concave polygons?? :P
  • simo103simo103 Member, PRO Posts: 1,331
    @Rob2 .. :D

    @HappyKat78 no problem ... happy to help where I can.
  • fzeedfzeed Member Posts: 247
    I have a game where there are TONS and TONS of little invisible collide detectors. Each one is placed by hand. Took weeks and weeks (i'm still working on it in fact) But i made 2 actors. A rectangle and a circle. Their alpha goes to 0 when the game runs. I have 50 levels done now, and i can't feel my right arm :(
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    O-o
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    @slickzero LOL I had the same reaction. @-)
  • calvin9403calvin9403 Member Posts: 3,186
    not to promote any thing, but corona which can let users do there own collison, which gamesalad should do

    and pixel collision will be nice:)
Sign In or Register to comment.