Creating rope physics using matterjs within Phaser

I am trying to develop a game that involves rope-like physics. The rope is segmented into a bunch of tiny images to allow fluid movement – unfortunately the example on Phaser 3’s website is not suitable due to the rope segments rotating in random directions.

Any thoughts on how I could accomplish this?

I have created a bridge with matter. If you only attach it on one side, it behaves like a rope. Hope this helps :slight_smile:


Hey Yannick, thank you for that post – it’s definitely helped me quite a bit.

So far I do have the rope somewhat working, but I want to make the rope unstretchable when dragging it with the mouse.

Here is a testing CodePen:

Glad it helped :slight_smile:

I’m sorry, but I do not know how to make it stiffer. The doc only says A value of '1' means the constraint should be very stiff.

I guess very stiff does not mean riged or fixed :thinking:

I finally achieved a satisfying looking rope. Not using matterJS, but using Phaser’s graphics object and a set of nodes!

Could you be so kind as to share that code? I’m trying to make a rope display similar to yours shown. I have my constraint, I just need to be able to see it without turning on debug.

I modified yannick’s Bridge code by commenting out one of the worldConstraints as suggested and it does make a pretty good rope using matter physics. Changing the friction and density help make it behave less like a chain.

1 Like