4
\$\begingroup\$

I've done some small OpenGL games for computer. I've used continuous loop (with VSync) for game life cycle, input - update - render. Now i'm going to write simple game for Android, but i'm wondering if it is the right way to go.

What matters? Battery usage, i've played some simple games that used so much battery compared to their complexity and graphics and i don't wanna to create that battery hungry game.

\$\endgroup\$
5
\$\begingroup\$

You technically will always want a continuous loop. What you may consider is making that loop wait for user input events before redrawing the screen or processing game logic.

If the game is not real time and doesnt need animations to always be playing, it's absolutely a good idea to be event driven.

(Update for clarity): Note that by event driven I mean that the loop should call to the platform's "block and wait until an input message occurs" API. Not sure what that is on Android. On many platforms, it means calling a "Get" function rather than a "Poll" function.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.