开发者

Cocos2d: Perspective effect with mutli-layers

I want to use in my game effect of perspective view by using few layers, scrolling with different speed. I have three layers. My background is bottom layer, it scrolls very slowly, so it can be in a few times smaller than level. My "semi-background" is second layer, which lays between foreground and background. It scrolls with medium speed, faster than background, but slower than foreground. Third layer is foreground, it scrolls with speed, that my character moves. For scrolling foreground I simply use CCFollow action for my CCLayer, where all objects are placed. Now I'm confused, what is the best way to implement my first and second layers. Does cocos2d have any actions, similar to CCFollow, but having custom speed (speed is not best word to use, but it's 开发者_JAVA技巧difficult to find appropriate term for me)? My background and "semi-background" images are tiled textures.


The term that describes what you're looking for is "parallax scrolling". There's an entire chapter devoted to it in Steffan Itterheim's book.

I found this tutorial in a quick Google search.
(Dead link above. Wayback Machine led me to this video.)

I hope that helps a little bit!
Mike

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜