3

all! I'm creating a game based on Box2d and Cocos2d. I want to make up a rope, which will be able to contact with all of the physical objects. Something like this:

http://rghost.ru/35987917.view

I created a rope by using a rectangles joined through a revolute joint, but creating more than 3 ropes reduces fps from 60 down to 30. I must use at least 5 ropes, water and particles in Cocos2d, but in this way fps will be near 5-10, how to avoid this?

bouteillebleu
  • 2,456
  • 23
  • 32
Gralex
  • 4,285
  • 7
  • 26
  • 47
  • Quick clarification. Is your low fps rate on your actual device or is it in the simulator? Tassinari is correct in that a b2RopeJoint won't solve what you are trying to do since it is not a Rigid Body. – Jer In Chicago Jan 19 '12 at 18:40
  • I know about b2RopeJoint, it's my plan "B"=) But I really need rope which contacting with all physical objects – Gralex Jan 20 '12 at 12:00

1 Answers1

2

Use a box2d rope joint and verlet rope from this tutorial: http://www.cocos2d-iphone.org/archives/1112

There shouldn't be any performance issues with 5 ropes with this method. You may have to update your box2d version though because b2RopeJoint is relatively new.

tassinari
  • 2,313
  • 2
  • 24
  • 32