After 2 nights of failure I'm back. Please help.
Read the error message. Note where it says "Thread already started" at "thread.start()". Fix that. Don't start a thread that is already started.
I tried but nothing is working. I tried making a Boolean variable and setting it to false and then setting it to true right after the "thread.start" function. The app doesn't give me the error anymore, it gives me a blank black screen, I have to restart the app to get it to work. I tried in various ways.....
Unlike c++ there was a lot of stuff automatically done for me that I just accepted but I'm really having a hard time figuring out where this program starts. I know if I could just get a clue how to look at the beginning I know I could solve this.
@Override
public void surfaceCreated(SurfaceHolder holder){
if (threadStarted == false) {
bg = new BackGround(BitmapFactory.decodeResource(getResources(), R.drawable.grassbg1));
player = new Player(BitmapFactory.decodeResource(getResources(), R.drawable.helicopter), 100, 86, 3);
/*/NO USAGE
smoke = new ArrayList<Smokepuff>();
smokeStartTime = System.nanoTime();*/
//cystalPoint = new CystalPoint(BitmapFactory.decodeResource(getResources(),R.drawable.redcyrstal), 91, 86, 1);
cystalPoint = new ArrayList<CystalPoint>();
cystalPoint.add(new CystalPoint(BitmapFactory.decodeResource(getResources(), R.drawable.redcyrstal), 91, 86, 1));
cystalPoint.add(new CystalPoint(BitmapFactory.decodeResource(getResources(), R.drawable.redcyrstal), 91, 86, 1));
//Safely start game loop
thread.setRunning(true);
// thread.threadHasBeenMade(true);
threadStarted = true;
thread.start();
}
}