How do I make a pinata?

0 favourites
  • 11 posts
  • 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. 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,

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Use this rope example:

    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.

  • 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!

  • Can you make the last link in the rope a separate sprite with it's own hinge point and connect the pinata to that?

  • 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.

  • 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.

  • 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:

    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.

  • Did you get your pinata working?

  • 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

  • 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.

  • 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.

    Well I am glad it will work for you!

    I hope we get to see your game when you get it finished. I love to whack a Pinata!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)