Reputation: 1213
Actually i am new comer in cocos2d and box2d game development , Today i am facing one problem with FPS, My apps FPS speed is not be constant with every device, Its be increase or decrease as per different iPhone,iPad device, and in the simulator its being too low,
and Please tell me if it's possible to change the FPS (Frame per second) value,
and due to this problem only "Parallax" is effected and other physics working perfect,
Any help is greatly appreciated. Plz join hands.. !,
Thanks,
Upvotes: 0
Views: 2577
Reputation: 348
You can change your animation interval in your app delegate with this line in your didFinishLaunching method
[director setAnimationInterval:1.0/60];
There could be several reasons for lag but one thing that causes lag on older devices is allowing your UIViewController to autorotate instead of your CCDirector. To fix this go to your GameConfig.h file and comment out and (uncomment out?) the other line:
//#define GAME_AUTOROTATION kGameAutorotationUIViewController
#define GAME_AUTOROTATION kGameAutorotationCCDirector
There are two other things I can think of off the top of my head. First it is important to use a fixed time step in box2d. I implemented this with the help of this link:
http://www.cocos2d-iphone.org/forum/topic/8922
The other thing is your armv6 and armv7 processor difference on older and newer devices, check it out here:
What are the advantages of armv7 over armv6 when compiling iPhone apps?
I forgot how to implement this, but you basically have two different binaries in your build, one for older devices using armv6, and one for your newer devices using armv7. Someone correct me if I'm wrong. I hope this helps
Upvotes: 2