Please explain me where the error is:
I have a main game loop in a run() method of a Thread Object.
It's contents is simple:
The main game logic is inside the paint method of the game canvas.
1 switch (gameUtil.getCurrentDisplayNumber())
2 case GameUtil.CANVAS_GAME:
8 case GameUtil.CANVAS_GAME_OVER:
I utilize the fact that paint() is called all the time and I do all movement calculations
inside this method.
Now, when somewhere inside this paint() method I detect that the player has lost all lives
I want to switch to a Game Over screen. So I call:
This call is made somewhere inside the paint() method of the game canvas.
And the problem is that on some phones the game over canvas shows up but is deadlocked.
I mean the paint() method of the game over canvas is called only once and never again.
I noticed that removing the serviceRepaints() call from the 5th line solves the problem but
it result in animation frames being dropped (at least it looks like this).
So I want to find out what is causing the problem - what I'm doing wrong and how to correct it.
By the way: I'm not explicitly using any other threads than the main one.