Chipmunk physics: Velocity question

Posted by Johannes Jensen on Stack Overflow See other posts from Stack Overflow or by Johannes Jensen
Published on 2010-05-30T23:54:18Z Indexed on 2010/05/31 0:02 UTC
Read the original article Hit count: 333

Filed under:
|
|
|
|

I'm making an iPhone game where the main actor is a ball that rolls depending on the device's accelerometer rotation.

I haven't started on this part of the coding yet, but I was wondering if you guys had a nice way of solving this:

I tried looking a little into chipmunk, and I noticed that bodies have the property v, which is a point containing x and y velocities.

I was thinking it'd be a bad idea to just do like:

playerBody->v = ccp(accelerometer.x * 5, playerBody->v.y);

because it'd just roll up of walls and stuff,

is there a better solution to do this?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about c