1
\$\begingroup\$

So I'm a beginner in developing android gaame. I already developed a game, it's intended for kids. Basically, the game has 4 stages. In each stage, it has 15 questions. If the user chooses the correct answer, he will proceed to the next question, otherwise, will be given 3 trials to choose the correct answer/object.

Below is the structure of my game:

Home
Menu
    >>> Stage 1 | Stage 2 | Stage 3 | Stage 4

Stage 1_1.class 
Stage 1_2.class 
....

Stage 2_1.class 
Stage 2_2.class 
....

Stage 3_1.class 
Stage 3_2.class 
....

Stage 4_1.class 
Stage 4_1.class 

I know it's very noob, that's why I ask for your help to translate this to a more consistent, and efficient game or just give me an idea. I want to put each stage's main loop only in ONE ACTIVITY. Help is truly appreciated. Thanks.

\$\endgroup\$
  • 1
    \$\begingroup\$ Is there some problem in particular you're having trouble with using the existing design? It's hard to suggest improvements if we don't know what's wrong and how you want things to work. Right now your question is pretty broad. \$\endgroup\$ – MichaelHouse Jul 10 '13 at 16:37
  • \$\begingroup\$ @Byte56 basically, I want to put all the game loop in just one activity in each stage. \$\endgroup\$ – neknek Jul 10 '13 at 16:42
  • \$\begingroup\$ From my limited experience with Android, I believe what you're looking for is using an Activity for each level? Something like: gamedev.stackexchange.com/questions/26822/… \$\endgroup\$ – MichaelHouse Jul 10 '13 at 16:49
  • \$\begingroup\$ Thanks for the link but the answers there suggest to switch between activities, what I want to do is just use on Activity for each stage but changing the views for each questions. \$\endgroup\$ – neknek Jul 10 '13 at 17:00
1
\$\begingroup\$

I don't know if this is what you need, but you should write just one general class Stage and all of your questions are defined in some XML. When your game starts, it will create for example array of stages, which it will go through. And in each stage you can have loop which will just increment question number.

\$\endgroup\$
  • \$\begingroup\$ Exactly! This is what I want, can you give me a snippet of codes to get me started? I badly need to get it working :( \$\endgroup\$ – neknek Jul 10 '13 at 17:02
  • \$\begingroup\$ Sorry. But I'm not java/android developer :( \$\endgroup\$ – zacharmarz Jul 10 '13 at 19:35

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.