Game Development Reference
In-Depth Information
Figure 9-13 . Chain and rope in motion, bending and flexing nicely
Note The rope's visual design using sprites works best if the rope can't bend
too much. If you need a really elastic, flexible rope, you may need to resort to
drawing the rope using Cocos2d's CCRenderer . Each node class can override
the -(void)draw:(CCRenderer *)renderer transform:(const
GLKMatrix4 *)transform method to perform custom drawing. You'll
find an example in the next chapter.
Fixing Chain and Rope Collisions
The chain and rope may also appear wildly distorted, as shown in Figure 9-14 , when they
are partially stuck inside a collision or overlapping. This can lead to the entire chain or
ball jittering, separating, or even leaving the screen. If the player character touches such
an unresting chain or rope, it may be accelerated to a high velocity instantly.
Search WWH ::




Custom Search