Game Development Reference
In-Depth Information
Repeat doubling the value until the joint no longer breaks. You now know
two upper and lower bounds between which the actual breaking point lies.
Narrow down the breaking point by halving the difference. For instance, if at
5,000 the joint breaks but stops it breaking at 10,000, you should try 7,500
next.
Keep narrowing down the value until you get close enough to the breaking
point.
You don't have to know the exact breaking point value. For instance, if you determine that
a joint (at rest) breaks at 1,100 but doesn't break at a 1,200 breaking force, you are within
10% of the breaking point (at rest) and can start experimenting actual gameplay behavior
with the 1,200 value. If 1,200 causes the joint to break too easily when you apply just a
minimal amount of force, you'll need to increase the breaking force, anyway.
Finding the breaking point is done only to show you the minimal base value where the
joint breaks under minimal force, but you'll certainly have to consider that the joint is
supposed to withhold some, but not too much, extra force.
You can disable the breaking force by simply setting the Breaking force field back to un-
limited . You can alter a joint's breakingForce property in code as well. For instance,
this code disables the breaking force by setting it to infinite programmatically:
joint.breakingForce = INFINITY;
Motor Example
Open Rope.ccb , and select the hook joint that connects the first rope segment with the
hook node.
On the Item Properties tab, uncheck both Spring Enabled and Limit Enabled in case they
are enabled for this joint. This allows the joint to rotate 360 degrees around itself; other-
wise, a motor force that applies torque would be limited to within the angle limits.
Then select the Motor enabled check box and enter -4 in the Rate field. The negative
value will make the joint rotate counter-clockwise.
If you place a rope in the level and run the project, you'll see the rope is trying to swirl
around its hook point. Try different rate values to see what happens if the rope spins faster
or slower.
Search WWH ::




Custom Search