Page 1 of 1

Working perfect on simulator not working on device

Posted: Mon Oct 24, 2011 11:12 pm
by mrigankgupta
This is my first post on this forum, so first of all thanks for making this awesome engine.
now comes to the question part, I am making a small sample on iOs. in my sample I am dropping a balls with gravity cpv(0,-10). It is working fine on simulator but on device ball doesn't fall and remain still on the same place.
what can be the problem, any idea on this.

Re: Working perfect on simulator not working on device

Posted: Tue Oct 25, 2011 9:00 am
by slembcke
There shouldn't be any problems with Chipmunk itself between the two. I suspect your update loop isn't getting called. Try putting a NSLog() statement where you step the space and see if it ever gets called.

Can you share any more information about how your game is set up?

Re: Working perfect on simulator not working on device

Posted: Tue Oct 25, 2011 11:34 pm
by mrigankgupta
I figured it out.. it was because I was calling cpSpaceStep with very small update time. actually my gameloop settings are different on simulator and device so now its fine. my next question is .. for ideal gravity (cpv (0,-10)) situation what might be timeInterval of game cpSpaceStep update for device (or generally right now I am updating 1/60 sec) .. anyways thanks for help :)

Re: Working perfect on simulator not working on device

Posted: Wed Oct 26, 2011 9:59 am
by slembcke
1/60th of a second is good. If you have faster moving objects you might need a smaller one. You should always use a fixed size timestep though instead of the amount of time that has passed since the last frame. This is a good article about why: http://gafferongames.com/game-physics/f ... -timestep/