Prevent dragged sprites moving through each other

Get help using Construct 2

Post » Sun Dec 23, 2012 7:59 pm

I have a game piece with the drag-and-drop behavior. I want to prevent the pieces from moving through each other. Thanks.
B
3
Posts: 11
Reputation: 347

Post » Sun Dec 23, 2012 8:02 pm

This can actually be a little complex depending on the shapes/angles of your objects. If they are all horizontal rectangles you might be able to hack a solution but if not it will be a little harder.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Dec 23, 2012 8:07 pm

My pieces are circles.

Are there other behaviors one can download?

Edit: Alright, I made them solid, 8-directional, Physics/immovable. Now, they won't go through each other, but sometimes they'll move each other. It's like there's a hierarchy of which piece can move another... comport92012-12-23 20:19:35
B
3
Posts: 11
Reputation: 347

Post » Sun Dec 23, 2012 8:21 pm

I don't think there's a behavior for this as it's rather specific.

Circles, eh? hmm. As Ashley said in a similar question I asked the other day, the most realistic solution is to have the shape go red whenever it's overlapping another shape, showing invalid placement. Of course, I don't know your game so there's a chance it won't work for gameplay reasons.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Dec 23, 2012 8:33 pm

Did a little more testing, and there's definitely a hierarchy involved. Instances of the pieces can move pieces created before them, but not created after them.

Why would this be?
B
3
Posts: 11
Reputation: 347


Return to How do I....?

Who is online

Users browsing this forum: SpartCrafter and 25 guests