开发者

How to implement horizontal scrolling in box2d?

I'm working on an iPhone game using box2D and I need to impl开发者_高级运维ement horizontal scrolling... I was able to scroll the background textures and all... But, the problem is that, I'm not able to scroll the physics world of box2d... Please help me, how to move the box2d world... I'm not using cocos2d... I googled a lot, but was not able to find any solution without cocos2d...

Regards,

Suran


You should not move the world. Instead, try moving the "camera" (clip area) accordingly with the game character.


Try following: in touchesEnd Method:

[self.parent runAction:[CCMoveTo actionWithDuration:.5 position:ccp(yourPosition,0)]];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜