Minor performance update to v0.3. Chris pointed out to me that it runs at 20fps or less on a 3G. On my 3GS mine went up from 30fps to 60fps when running the start screen. It idles around 50fps with all enemies and towers on screen and will spike down to 40fps every once in a while. Since I can detect the device in code, I’m thinking that I will target 3GS to hold 60fps and any device lower, I will scale graphics back for it. Hopefully, StarkDesigns can do some tricks with the artwork to use less sprites on the lasers, cause that is what is really killing performance right now. I don’t think it’s too many sprites on screen, I think it’s calculating the position along the cubic bezier for all the sprites that is loading it down.
- Switched cubic bezier control points from 50 to 10. This gave a huge performance boost and the lasers look just as detailed.
- Re-factored some small chunks of code to try to get more performance.
- Overhauled how collision layer mask work to help filter out collisions better.
- Set chipmunk to step at the same rate. This was suggested in documentation to give better performance.
- Rehashed chipmunk space based on chipmunk documentation recommendations.