EDIT: I have changed the subject, so I can extend my question, sorry about the abbreviations.
My question was originally about pinning physics sprites together the way lego cubes are connected; meaning - you can apply force on one or more sprites and the final object behave as one solid object while still has physics properties. The parts would be arranged during the gameplay. I ran into problems solving this either way (PINs, JOINTs).
But as I was thinking more about the issue, I realized it would have horrible performace consequences even if I make it work. There's where my workaround comes to place (lower in this thread; basically wrap all the square sprites by one invisible sprite with multiple image points and collision polygon). The problem is, it seem impossible to do in C2 which I bought especially for this project.
I would need to be able to move or set image points within the sprite programatically AND change the collision mask polygon also programatically, i.e. during the gameplay. I can't see the way to achieve that.
I could premade matrix of 100x100 image points manually and use only some of them, but phew, sounds dull and time consuming. If C2 won't crash on me first.
I guess changing the collision polygon to trace the borders of all squares during the gameplay will be the same problem as I couldn't find or google the way to change those properties programatically.
I have also added a simple capx example as requested (see the whole thread).
Original message:
(please read to fully understand)
Canvas:
2 adjacent physics sprites
there's a separate force on both of them
Aim:
I need to keep them "locked" together like lego parts are.
Approach:
- PIN
Problem 1: Pinned sprite losing its collision behaviour. Maintaining its relative position no matter the enviroment.
Problem 2: If sprite is pinned to movable but sitting sprite, the pinned sprite can't be moved as it's pinned down.
I need all the pinned sprites act as one physics object. Imagine lego parts pinned together.
No matter which part(s) I apply the force, the whole thing need to act as one object.
- JOINT
Joints doesn't seem to have either of the problems but there's one new. Attached objects collide with enviroment, but don't colide with each other and therefore re-arranging the whole group. I tried to prevent this behaviour to no avail.
I almost feel like there's no other way to make the physics work as intended, but that seem to me hard to believed.