开发者

Possibilities to reduce power consumption with cocos2d apps

I made a board game with includes just some little animations. I reduced the fps from 60 to 30 to reduce the processor l开发者_开发知识库oad. But the device still gets very warm. Another application made without cocos2d is not heating it so much. Are there any methods to calm the iPhone down? The device state is as follows:

  • Wifi is always enabled
  • The app uses gamecenter
  • GPS is inactive
  • fps is always on 30
  • I use cocos2d-iphone as engine


It might be worth experimenting with different director types, e.g. kCCDirectorTypeNSTimer, and seeing if that helps at all. Those will have the biggest effect on the main loop of the game.

You should also spend some time with Instruments if you've not already, as that will show you where the CPU is spending its time and give you some hints on where you could ease things up.


I've noticed that a sequence of small time animations in cocos2d takes a lot of processor time. I've tried making tips at the level which will pulse in size. 0.1 second pulse up, 0.15 down and 0.2 stay. And i've put it all in a repeat forever sequence. Everything was terribly slow. Then i've just made the animation manually and the device calmed down and fps increased back to 60


When showing menus or dialogs that do not require animation, you can actually lower your framerate even further.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜