有限长度的视差滚动
我有一个横向滚动平台游戏,它使用 iPhone 版的 Chipmunk 和 Cocos2d。玩家从关卡的一侧移动到关卡的另一侧以完成关卡。玩家实际上从一侧移动到另一侧;背景不会重复以产生滚动的错觉。
然而,我对如何在视差背景下做到这一点感到困惑。 x 坐标上的级别约为 3000。我无法使用那么大的图像。我也无法在玩家到达某一点后让图像重复出现,因为玩家没有站在一个位置。
有什么建议吗?
I have a side scrolling platformer that uses Chipmunk and Cocos2d for iPhone. The player moves from one side of the level to the other side of the level to complete the level. The player actually moves from one side to the other; the background is not repeated to create the illusion of scrolling.
However, I have been befuddled as to how I could do this with a parallax background. The level goes to about 3000 on the x coordinate.I cannot use an image that large. I also cannot make the image repeat itself after the player reaches a certain point because the player is not standing in one location.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将背景图像分割为 3 个图像,每个图像宽度为 1024 像素。只需将第二个和第三个图像精灵的位置分别偏移 1024 乘以 2 乘以 3。
You can split the background image into 3 images, each 1024 pixels in width. Simply offset the 2nd and 3rd image sprite's position by 1024 times 2 respectively times 3.