Search code examples
chipmunk

creating a rotating space in Chipmunk


I'm looking to make a small app in which a ball bounces around inside a square frame. Obviously thats simple enough to implement, but I would like the user to be able to rotate the frame manually (using the rotating gesture) as the ball is moving around. I have looked into using Chipmunk to accomplish this but it seems that its not possible to rotate a cpSpace, but only the bodies held within it.

My question is: Can such a process be implemented in Chipmunk by using cpBody objects, or woud i be wasting my time trying? Would it be easier to try and create my own system using things like bezierpaths with the containsPoint method?

Thanks for any help,

James


Solution

  • You should look at the "tumble" demo that comes with chipmunk. It sounds like it does pretty much what you want.