Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Well I've finnaly decided to start Android game dev, and my first project will be simple 2d canvas based game. I have some experience in game developing with C# and XNA, and I'm a bit confused now. Back in XNA we have Game class with Initialize, Update and Draw methods.

In Android I have to extend SurfaceView class, run draw and update in their own thread, and receive touch input from user.

I'm looking for a proper way to structure my code.

Some of my questions are :

  • How to deal with Activities (Should I run everything in one activity, or split whole game in 2 or more) ?
  • Where should I run game loop ?
  • Where to put Draw and Update methods ?
  • How to respond to touch events ?

Hope I came to the right place for answers...

share|improve this question
1  
I suggest you want to look at LibGDX. Just like XNA it's a library for games. It has a pretty big community and lots of documentations. –  Sidar Jan 6 '13 at 4:20
    
Well, I'll give it a try sometime. –  Nikola Ninkovic Jan 6 '13 at 10:13
add comment

1 Answer

up vote 2 down vote accepted

A minimal Breakout game, demonstrating the use of Activities, touch event handling, and draw/update with GLSurfaceView can be found here: http://code.google.com/p/android-breakout/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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