Game Development Reference
In-Depth Information
Don't forget to check Limit Enabled for each joint and then set the Min / Max values to
-135 and 135 , respectively.
If you need help finding good anchors, you can set the anchor for joints whose Body A is a
chain2 element to 9.5x6 and, for those joints where Body A is a chain1 element, set the
anchor to 6.5x4. Yes, you need only two different anchor values because the anchors are
relative to Body A , and you only have the aforementioned two different types of chain ele-
ments that have already been moved in place. The ball doesn't need to be considered be-
cause it's attached as Body B to the last joint.
The result of this editing operation should look like Figure 9-8 .
Figure 9-8 . Ball and chain are hooked up, and the selected joint shows the angle limits
You can now try out your “ball on a chain(TM)”. Feel free to add additional Chain.ccb in-
stances to Level1.ccb . Definitely try rotating the chains so that they start out swinging.
Note You may observe strange behavior with the chains at this time—for in-
stance, collisions with invisible areas. You'll fix the collision categories and
masks later. For now, just ignore the fact that the chains will behave erratically
when they intersect walls or triggers. For now, just move the chains to a
collision-free area to test them.
Search WWH ::




Custom Search