I am looking at the demos on the iPhone (downloaded with cocos2d), and I wonder why the world seems to be defined from -320 to 320 and -480 to 480, while the device is 320 * 480 only. Is there anything that should prevent me from using 0-320 and 0-480? Maybe the demo code is from another platform where this made more sense?
Thanks,
Eiko
PS: I think it would be useful to have the version number somewhere in the source files, as I can only guess if cocos2d has the newest things included. Well, I am currently using nothing but the physics engine.
Hey chess77,
I'm also using Cocos2d with Chipmunk. slembcke's right in that they've just grabbed the demo code without modification of the simulation space. When setting up your cpSpace, you can just specify the min width and height to be 0 and the max to be 480x320 (or 320x480 if you're running landscape.) Alternatively you could position the origin at the center of the display and then do conversions between physics space and cocos space. Personally I find matching the physics space up to the display space to be helpful. The chipmunk_accel demo in Cocos2d uses a Chipmunk coordinate space that is aligned with Cocos.
Can anyone clarify how you can change the width and height of cpSpace? All I can see in the documentation is cpSpaceNew() and after having a good look through the headers I havent found anything that would resemble width or height. This information would help me greatly as I am too using cocos2d and would like my cpSpace to be from 320X480.