Game Development Reference
In-Depth Information
move at half the speed, para2 at normal speed, para3 at double the speed of the
CCParallaxNode , and so on.
Using a sequence of CCMoveBy actions, the CCParallaxNode is moved from left
to right and back. Notice how the clouds in the background move slowest, and the trees
and gravel in the foreground scroll by the fastest. This gives the illusion of depth.
Note You can't modify the positions of individual child nodes once they're ad-
ded to the CCParallaxNode . You can only scroll as far as the largest and
fastest-moving image before the background shows through. You can see this
effect if you modify the CCMoveBy actions to scroll a lot farther. You can in-
crease the scrolling distance by adding more of the same sprites with the appro-
priate offsets. But if you require endless scrolling in one or both directions,
you'll have to implement your own parallax system. In fact, this is what you're
going to do in Chapter 7 .
CCMotionStreak
CCMotionStreak is essentially a wrapper around CCRibbon . It causes the
CCRibbon elements to more or less slowly fade out and disappear after you've drawn
them. Try it in the ScenesAndLayers10 project and take a look at Figure 5-5 to get an
impression how the fade-out effect might look.
Figure 5-5 . The CCMotionStreak class lets you draw a slowly fading line
 
 
Search Nedrilad ::




Custom Search