开发者

chipmunk and static bodies : if the game map is to large for the screen, I can move sprites but how can I move static bodies and shapes?

开发者 https://www.devze.com 2023-04-02 20:34 出处:网络
I think the title i开发者_如何学运维s pretty clear. The way I see it is there are two things :

I think the title i开发者_如何学运维s pretty clear.

The way I see it is there are two things :

  • the sprites for display
  • the bodies for physics

Sprites can be moved in the screen when the level to display is to wide for the screen. But static bodies ? Can they be moved ? What's the pattern here ?


You scroll the graphics, not the objects in the world. They physics objects always stay at absolute coordinates, and you draw the graphics with an offset. Cocos2D doesn't really give you a camera or anything you can move around (well, not really anyway), you simply have to offset your entire scene.

0

精彩评论

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