Elementrat Posted April 4, 2014 Share Posted April 4, 2014 Hey guys! Thanks Rich for the incredible library. I'm working on a game that will require a single "rope" instance (no, it's not a cut the rope clone) and without any experience working with these physics primitives, I'm at a loss as far as which type would suit my needs. I need to chain together a bunch of physics enabled "links" in the chain. They each must be distance constrained, and locked to the right point on the next chain link. Is this possible? I thought revolute constraint would be ideal, but i've had trouble getting the right effect.Any help is greatly appreciated! Thank you! Link to comment Share on other sites More sharing options...
rich Posted April 8, 2014 Share Posted April 8, 2014 You'd use a series of bodies linked with RevoluteConstraints. If you look at Stefan's constraints demo you'll see the middle one looks close: http://schteppe.github.io/p2.js/demos/constraints.html Link to comment Share on other sites More sharing options...
valueerror Posted April 8, 2014 Share Posted April 8, 2014 http://www.html5gamedevs.com/topic/5423-implementing-a-rope-with-p2/#entry33046 the same thread with a really nice example ... Link to comment Share on other sites More sharing options...
valueerror Posted April 9, 2014 Share Posted April 9, 2014 and here is my own implementation of the above example with real images and a little less complex code.... http://test.xapient.net/phaser/ALL/ropes.html glhf Link to comment Share on other sites More sharing options...
valueerror Posted April 11, 2014 Share Posted April 11, 2014 and here the successor ;-)http://test.xapient.net/phaser/ALL/chain.html Link to comment Share on other sites More sharing options...
george Posted April 11, 2014 Share Posted April 11, 2014 I want to play with the rope. Give me some mouse support. Now! Good job! Link to comment Share on other sites More sharing options...
valueerror Posted April 11, 2014 Share Posted April 11, 2014 I want to play with the rope. Give me some mouse support. Now! Good job!haha.. good idea.. thx... you could jump on it with mario for now. http://test.xapient.net/phaser/ALL Link to comment Share on other sites More sharing options...
valueerror Posted April 24, 2014 Share Posted April 24, 2014 http://test.xapient.net/phaser/ALL/snake.html something with mouse support für george not exactly the same because of no gravity but also fun to use ... Link to comment Share on other sites More sharing options...
totor Posted April 24, 2014 Share Posted April 24, 2014 haha.. good idea.. thx... you could jump on it with mario for now. http://test.xapient.net/phaser/ALL awesome game! but you cannot climb up or down the rope. Link to comment Share on other sites More sharing options...
Recommended Posts