Hello android developers,
I am developing a simple game for Android in Eclipse using OpenGLES 1.0. I am using Samsung Galaxy S2 Android(2.3) as a device for developm
You should use elapsed time to scale all your movement, so that the movement stays smooth at varying FPS rates. You can get elapsed time like this:
long currentTime = System.currentTimeMillis();
float elapsed = (System.currentTimeMillis() - lastFrameTime) * .001f;//convert ms to seconds
lastFrameTime = currentTime;
Then express your velocities in units per second, and update position like this:
sprite.x += (sprite.xspeed * elapsed);