How do I make a pinata?

Get help using Construct 2

Post » Sun Feb 12, 2017 6:29 am

Hey everyone,

I've been struggling with this over the past few days - how do I make a rope in Construct 2 that can hold any real weight?

I've been trying to create a pinata simulation...Wherin I have a pinata suspended on a rope (which can be hit around by the player).

I tried using a series of links connected by 'limited revolute joints', but as soon as I attach the pinata, the joints go crazy - they stretch out like a spring (leaving huge gaps in between) and/or completely spazz out. :lol: I've tried playing the the density, friction, elasticity etc, but nothing has worked so far. I've also searched the forums for a solution, but have come up short.

The only thing which has sort of worked so far is to make the pinata really tiny, but this isn't the effect I want to achieve.

Does anyone have any ideas as how to create realistic enough rope physics that can hold weight, and support being struck by the player?

Thank you all, :)
B
8
S
3
G
3
Posts: 10
Reputation: 2,116

Post » Sun Feb 12, 2017 7:48 am

Use this rope example: viewtopic.php?t=65930&start=0
To create your rope. Attach your Pinata sprite to the very end.

As for the candies part, I suggest you create the candy sprites on start of layout and set their relative positions to the pinata because if you spawn them as the Pinata is being struck, that will cause game slowdown.
Image Image Image
B
31
S
11
G
27
Posts: 748
Reputation: 17,093

Post » Sun Feb 19, 2017 7:57 am

Thank you! And I apologise for such an untimely response.

This solution comes close to working! The pinata stays up without stretching the chain.
But I can't seem to figure out how to attach the pinata to the last link in particular. It seems to attach itself to the first link in the chain. And then if the rope is hit, it spazzes out again.

Here's the capx so you can see what I mean ;)

https://www.dropbox.com/s/v8jewgsnka32bkv/Pinata.capx


Thanks again for your help!
B
8
S
3
G
3
Posts: 10
Reputation: 2,116

Post » Sun Feb 19, 2017 3:32 pm

Can you make the last link in the rope a separate sprite with it's own hinge point and connect the pinata to that?
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Sun Feb 19, 2017 10:29 pm

The creation of the ropes using loops is a bit difficult for me. I can't find which rope I should put the pinata on.
Will try and develop my own later.
Image Image Image
B
31
S
11
G
27
Posts: 748
Reputation: 17,093

Post » Mon Feb 20, 2017 2:41 am

Mmm...I could make another 'end of rope' sprite, but then there's the question of how to attach this to the main chain :)
...Because as MPPlantOfficial pointed out, this particular rope model is made of looping sprites, so (as far as I know), it's only possible to attach things to the very first sprite.
B
8
S
3
G
3
Posts: 10
Reputation: 2,116

Post » Mon Feb 20, 2017 3:17 am

Aphelleon wrote:Mmm...I could make another 'end of rope' sprite, but then there's the question of how to attach this to the main chain :)
...Because as MPPlantOfficial pointed out, this particular rope model is made of looping sprites, so (as far as I know), it's only possible to attach things to the very first sprite.



OK well here is a braided rope sprite you can make any color:

Image

You will need an image point on each end and attach them together the same way the links attached using physics hinge points.

Make one rope sprite with a different name for the last piece that attaches to the pinata.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Mon Feb 20, 2017 9:13 pm

Did you get your pinata working?
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Mon Feb 20, 2017 9:38 pm

Here is what I come up with and maybe it will work for you:

CAPX

https://www.dropbox.com/s/milu0mi6ovsmd1b/Pinata.capx?dl=0

Image

Image
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,790

Post » Mon Feb 20, 2017 11:21 pm

Oh wow, thank you so much Lamar! I had tried that before, but had used revolute joints and/or pins to connect the rope together. But your distance joint is so much more stable. This is pretty much exactly what I was looking for.
You're an absolute legend, Lamar. Thanks a bunch.
B
8
S
3
G
3
Posts: 10
Reputation: 2,116

Next

Return to How do I....?

Who is online

Users browsing this forum: Blendi1223, Darknessed and 50 guests