Join 02 sprites and move it

Get help using Construct 2

Post » Tue Jan 15, 2013 11:41 am

Does anyone have an example of how to join two sprites side by side at the moment that sprite1 touch in sprite2 (collision)? This always should occur only on one side. The first sprite (player)must pulls the second part and the others that touching (like a train). I would also make this junction articulated during movement (Physics + Joint?). Thanks
B
65
S
13
G
2
Posts: 969
Reputation: 6,732

Post » Tue Jan 15, 2013 12:17 pm

Would pin behavior be something that you are looking for?

On collision
      Pin Position&Angle to sprite1 to sprite2

To stop 'pulling' you can unpin the objects.
B
24
S
8
G
7
Posts: 756
Reputation: 7,202

Post » Tue Jan 15, 2013 3:33 pm

Thaks for the suggestion, @vee41.

As I understand it, the sprite 2 is over the sprite 1. Sprite 2 must join in a specific side of Sprite 1. And with respect to the articulated junction? Does anyone have more suggestions and, if possible, an example (capx)? ThanksRenatoB2013-01-15 16:33:42
B
65
S
13
G
2
Posts: 969
Reputation: 6,732

Post » Tue Jan 15, 2013 4:50 pm

Well you can do that with pin behavior, so I don't really understand what you are looking for. Something like this perhaps?

Traincart demo
B
24
S
8
G
7
Posts: 756
Reputation: 7,202

Post » Tue Jan 15, 2013 5:39 pm

Nice example, @vee41. But you didn't use the pin behavior. Could you do the same thing that you do with physics? Thanks
B
65
S
13
G
2
Posts: 969
Reputation: 6,732

Post » Tue Jan 15, 2013 5:44 pm

Just do the pin action instead if creating physics joint.
B
24
S
8
G
7
Posts: 756
Reputation: 7,202

Post » Tue Jan 15, 2013 6:34 pm

After the train is engaged in the cart, I cannot move them together.

Obs.: I have replaced the physics to 8directions behaviorRenatoB2013-01-15 18:53:13
B
65
S
13
G
2
Posts: 969
Reputation: 6,732

Post » Wed Jan 16, 2013 2:21 pm

The game will be in top view mode. The sprites, once together, they will have to go for curved paths. I'm using obstacles to determine the path and 8directions behavior to define the main sprite movement. When I make the curve with the sprite1 and sprite2 (connected by Physics / Pin Join or behavior), the sprite2 remain parallel or slightly changes the angle, ie not accompanying the motion. How can I resolve this in an easy way?RenatoB2013-01-16 15:50:16
B
65
S
13
G
2
Posts: 969
Reputation: 6,732

Post » Thu Jan 17, 2013 10:29 am

Here is another quick example, from top down view: Train example 2

Does your joint perhaps allow for too much rotation as it doesn't follow the motion?

And please, do post your .capxvee412013-01-17 10:29:41
B
24
S
8
G
7
Posts: 756
Reputation: 7,202

Post » Thu Jan 17, 2013 3:30 pm

Thanks for the example, @vee41.

I change the interface of your file and did some tests. I noticed that the control for Physics was not very good and despite including the solid behavior, there is a moment that the car passes under the obstacle. I am attaching the CAPX to give you an idea.

test_train.capx
B
65
S
13
G
2
Posts: 969
Reputation: 6,732

Next

Return to How do I....?

Who is online

Users browsing this forum: Callan S and 11 guests