Hello people.

I've gone through several Android examples, tutorials and generally
just played around with the system. Now I'm in a need of help
concerning a making of a game for Android, more specifically
structuring the design. I'm going to use OpenGL to render everything.
Generally when I have programmed games on the PC side I've gone about
it roughly in this manner:

game_loop( running )
{
     updateInput();
     updateGameLogic();  // enemies, objects, etc. stuff

     renderEverything();
}

That's it in a nutshell, of course I've generally added interpolation
of rendering. Basically having an if statement saying that "if over X
amount of time has passed do update" and render as fast as possible
with the interpolation. But how should I go about this on Android?

Since doesn't OpenGL ES "require" a separate thread for itself and I
really don't want to do my update stuff in onDraw() of the OpenGL
thread. So any links, help or just generic tips where to look on how
to build the structuring properly? Aiming to get it to look something
like this:

game_loop( running )
{
   readInput();

   if( has 20ms passed )
   {
      updateGameLogic();  // enemies, objects, etc. stuff
   }

   float t = calculate interpolation point based on time;
   renderEverything( t );  // this supposedly then ... calls the ...
rendering thread? Which we cannot really "call" like a function..
ugh..
}

Or is it done completely different on Android? How could I achieve the
same "effect"/flow of events. But yeah kind of need a help to point me
in the right direction on how to structure things on Android and from
there I can take care of the rest.

Thank you.





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to