I'm working on my first game, and it works fine, but clearly needs some optimizing. Initially, I had everything running on one thread (I used the LunarLander API to get started on gaming). Since then, I've added 2 new threads to the game. It still works just fine, but I see no improvement. I must be doing something wrong..
This is the basic setup:
class GameView extends SurfaceView implements SurfaceHolder.Callback {
private Mover mover;
private Collider collider;
private GameThread thread;
class Mover extends Thread{
//methods
}
class Collider extends Thread{
//methods
}
class GameThread extends Thread{
//methods
}
public GameView(Context context, AttributeSet attrs) {
mover = new Mover();
collider = new Collider();
thread = new GameThread();
thread.start();
}
}
Then, in the GameThread class I call methods on other threads when needed:
collider.checkCollision();
Is this the proper way to reduce load on the main thread?