views:

1924

answers:

2

I'm working with my friend on our first Android game. Basic idea is that every frame of the game the whole surface is redrawn (1 large bitmap) in 2 steps:

  1. Background with some static image (PNG) wipes out previous frame
  2. Then it is sprinkled all over with large number of particles which produces effect of soapy bubbles where there's a pool of about 20 bitmaps which randomly gets picked to produce illusion that all bubbles (between 200 - 300) are all different. Bubbles positions updated on each frame (~50ms) producing effect of moving bubbles.

The math engine is in C (JNI) and currently all drawing is done using android.graphics package very similar (since that was the example I was using) to Lunar Lander. It works but animation is somewhat jerky and I can feel by temperature of my phone that it is very busy. Will we benefit from switching to OpenGL? And as a bonus question: what would be a good way to optimize the drawing mechanism (Lunar Lander like) we have now?

+2  A: 

I recommend you to watch the video from Google I/O 2009: http://www.youtube.com/watch?v=U4Bk5rmIpic . It will answer to your questions.

WarGoth
I haven't been able to find a transcript of that talk :/
Lo'oris
+1 very intresting talk, btw
Lo'oris
A: 

now after i started to work with opengl es i would use it also for 2d grafics. this way you are most flexible and its extreme fast (look at this example code: http://code.google.com/p/apps-for-android/source/browse/trunk/SpriteMethodTest/ ) its about 2d rendering and there you can see the power of opengl

its not the easiest thing to start with opengl there are some good tutorials out there (for example this http://blog.jayway.com/2009/12/03/opengl-es-tutorial-for-android-part-i/ is a very good one)

Sponge
It looks like jayway's tutorial is focused on 3D drawing, unless I'm mistaken.
Lo'oris
the basic initalization stuff is the same for 2d and 3d and if you want to use opengl you have to understand it first;) there are some GL11 (a special OpenGL ES interface which is not available on all devices) methods where you dont have to setup a point of view and stuff like that but most of stuff is important for 2d as well as for 3d
Sponge