views:

103

answers:

1

hi,

I'm trying to create a chipmunk space with a bouncing ball.(Example seen here)

Currently my device is running in Landscape mode. So according to cocos2D everything is all right. When adding Sprites they orient to landscape mode.

    [director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];

The only problem is that the device orientation is screwed up when using chipmunk right now. When tilting the ipad towards the upper-left corner, my 'bouncing ball' moves towards the upper-right corner.

Is there a way to rotate a chipmunk space manually?

Or is there some other way to set rotation within a chipmunk space?

A: 

It sounds like a simple sign issue. I assume the balls are moved by applying a force to them. So instead of applying a positive force like (10, 0) apply a negative force (-10, 0) when moving the balls in one direction, and do the reverse in the other (eg multiply x coordinate forces by -1). Chipmunk doesn't care or know about device orientation, it just moves objects according to forces and gravity.

GamingHorror