Create Tiles in different degrees ...

All your problems with Audio, Video and Images.

Create Tiles in different degrees ...

Postby kniffo80 » Thu Feb 04, 2010 12:16 pm

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.
kniffo80
Freshman
Freshman
 
Posts: 3
Joined: Mon Jan 04, 2010 4:35 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 15 guests