Memory performance and Frame-rate questions

Hey!
I've been developing on a game for the past few weeks and I'm just trying to make it perform at the same speed as the iPad on an iPhone 3.

Is there any sort of tips or best practices that I could use to help speed things up?

So far we have boss character, which is a sprite that is around 240x 340, a background image and a small lime map. On each frame update there is a movement from the large sprite image along with character controls / camera movement.

I'm sorry this is so blunt! I'm not sure what sort of detail would really help and I don't want to include a load of irrelevant information.

Doing too much work (or just inefficient code) in EVERY frame (30 or 60 x/second) will always cause a slow app. Put some print statements in there to show how long various functions are taking to run. Also, I've seen several times where runtime listeners accidentally get added more than once and that will kill your performance.

Finally, use local vars to shortcut global table lookups, especially in loops.

Good luck.

Along those lines, are there any "guidelines" about how many listeners are just too much? What about sprites? Some guidelines about what the system can handle would be beneficial to a lot of people I think.

Can you query about how many listeners are active?

Speaking of framerate, can we display the framerate on screen somehow to keep an eye on what's going on?

Can we dump memory usage to determine what the system is currently allocating to the app? These little tricks would be good to discuss I think.

views:779 update:2011/9/28 9:01:40
corona forums © 2003-2011