Cocos2D Infinite Background Picture

后端 未结 4 1067
清歌不尽
清歌不尽 2020-12-30 17:36

I\'m curious as to how to create an infinite background in cocos2d. For example lets say I was building an app with a man running from left to right, and I want him to run i

4条回答
  •  盖世英雄少女心
    2020-12-30 18:32

    The easiest way would be to include two background images that mesh seamlessly together. (CCSprite would work fine for this) In your update method as soon as the first background is completely off of the screen move it back to the other side of the screen directly next to the second background and continually move both background images. Repeat this process for the second background as well.

提交回复
热议问题