Wartybliggens

Members
  • Content count

    2
  • Joined

  • Last visited

  1. Colliding Groups

    Hello @samid737 and @mattstyles - I have been meaning to thank you for posting suggestions here. I did try out Samid's idea, and learned a ton from it. Eventually I came up with a different approach, using object-oriented code of course, which you may find interesting. Imagine egg whites and yolks: The egg whites (the outer circles - each a sprite using setCircle and P2 physics) all belong to the same collision group, but are invisible. The inner circle "yolks" are also invisible but track to their outer circles. A text box follows each inner circle. All "marbles" (also sprites using setCircle) belong to another collision group. Sets of marbles are created for each "egg" and are connected by invisible springs (P2 spring physics) of varying length. This way, marbles from different groups do collide, which helps keep the groups separate from each other. There are many (many) more details in the code as you can imagine, but that's the gist. Thanks again.
  2. Colliding Groups

    I would like to have multiple "areas" that cannot overlap on the screen (that collide). The areas would vary in size, and would be rather round/oval-shaped. Then within each area I will have a lot of circles (imagine marbles) which are also separate from each other (perhaps colliding or keeping away from each other as if suspended in a gel), around a title. I've attached a crude drawing to give the general idea (using animals for example, not the actual intended outcome). So my challenge is to have nested bounds, and I can't find an example like this. Can someone point me in the right direction?