Hi folks, my first post *wow*
I'm not new to Java Programming but general to GAME programming and especially ANDROID programming. I've read some tutorials about how to scroll in a game scene etc. pp. All fine so far.
Now, i've got a Problem: at the start of the App, i cache a lot of images (to prevent instantiating them later). And i've got images to be turned around (rotate) in 1 degrees steps (making 360 little tiles) for turret tracking action. And here my problems:
1. a lot of garbage collection (even if i try to prevent using method variables, i try to use globals instead) while drawing the game scene and doing the game loop (all 30 seconds around 60000 objects with around 2 MB of memory)
2. if i start to cache the "360 degrees" tiles, i get an OutOfHeapSpace Exception for Bitmaps.
So my question: how to do this? How may i rotate an existing (cached) bitmap before drawing it to the main canvas (i know about matrix, but that means to create a new "temp" bitmap, which is causing following things: 1. instantiate uses more time than caching. 2. garbage collection )
If you need some code, i would like to post some example code.