Monday, March 12, 2012

[android-developers] Re: Android Game Programming help

100% agree.
 
Actually writing the nuts and bolts of a real time game on Android has very little to do with Android. You will need to know how to use the classes associated with I/O, like how to write an Bitmap to the display or handle touch events. This stuff is pretty simple, with plenty of on-line code snippets. The difficult/complex things like collision detection and implementing a physics engine all have to be written from the ground up, and will not contain anything specific to Android.
 
What I found hard was getting the initial game framework setup. A real time game needs a couple of different threads, and when someone presses the HOME key the threads needed to be halted/suspended properly. It also needs to supply real-time environments for the real time game itself with the CPU rendering its little heart out, and environments like Help Screens where it can render once and wait for a user input.
 
Writing this stuff properly requires a knowledge of the Android architecture and considerable experience in setting up game environments. What you want to do instead is take a game which already works, hollow it out, and insert your own game logic. The game demos in the SDK don't provide this; Lunar Lander (for example) will crash if you leave it at the wrong point and try to switch back to it. If these guys couldn't get it right, mere mortals have no chnace.
 
This is why I also recommend Zechner's book. It builds two games from scratch - one using 2D graphics libraries, the other 3D - and they demonstrably work properly. And the programs are designed to allow easy substitution of some other game logic. He does a piss-poor job of explaining the Android architecture, but if you use his programs as a start point you don't need to know very much about it at all (a thoroughly good thing; its quite complicated). He does briefly discuss some specific game programming concepts like collision detection, but you will find more comprehensive resources on the web. What he does do very well is give you a fully working game with help screens, menus, persistent data and all the rest of it ready to modify to your needs, and this will save you a huge amount of work.
 
Peter Webb
 

On Sunday, March 11, 2012 9:55:04 PM UTC+11, Oli Wright wrote:
I had replied but it didn't submit for some reason.  Oh well.  It boiled down to:
1. What Kris said
2. Read Mario Zechner's book Beginning Android Games
3. Until you've done (2) I don't buy "Most of the links given by the group are links and sources i've gone through before".  If you still don't understand, read it again.

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

No comments:

Post a Comment