views:

72

answers:

2

Hello. I need some help on the following:

  1. I have the following class:

public class Game extends Activity {...

...}

  1. My questions is:

    • Where and how do I create my View (do I use another class that extends View....)
    • Where and how do I implement the Runnable interface so I would be able to use threads.
    • Where and how do I connect all three (the Activity, the View, the Run() method)

Any help is appreciated.

A: 

I'd suggest making a simple Android "hello world!" app first to get the hang of the framework. That will answer your first question.

Then, you should probably start developing your game by reading this and looking at the SurfaceView or OpenGL docs on d.android.com

Dave
Unfortunately, I found only SurcafeView a bit useful. However, Im not a novice, and ive done some apps. I guess im so stressed out that i can not even post my questions right. But, tnx for trying.
Stole
A: 

So, I have managed to find the perfect algorithm for GAMES.

public void run() {  
    while (isRunning) {  
        while (isPaused && isRunning) {  
            sleep(100);  
        }  
        update();  
    }  
}  


private void update() {  
    updateState();  
    updateInput();  
    updateAI();  
    updatePhysics();  
    updateAnimations();  
    updateSound();  
    updateVideo();  
}  

So, my question is something like this:

  1. In which class do i put all of these functions?
  2. In which class do i implement the runnable class?
  3. In which class do i put the View class?

Final and most important

  1. HOW do i connect all of these together.

Thanks in advance.

Stole