[GAMECANVAS] Tela branca ao iniciar Midlet

Boa noite a todos.

Estou executando o seguinte código:

Midlet


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package game;


import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;

/**
 * @author Carlos Eduardo
 */
public class Midlet extends MIDlet {

    private Game game = new Game();
    
    public void startApp() {
        Display display = Display.getDisplay(this);
        display.setCurrent(game);
        game.run();
    }
    
    public void pauseApp() {
    }
    
    public void destroyApp(boolean unconditional) {
    }
}

Game

class Game extends GameCanvas implements Runnable{

    //Verifica se o jogo está rodando
    private boolean ativo;
    //Criação dos Sprites e das animações
    private GameDesign gd;
    private Sprite carro;
    private AnimaSprite asCarro;
    //criação do Timer - Age como uma Thread definindo ações individuais
    private Timer timer;
    //criação da TiledLayer e da Layer Maneger
    private LayerManager layerManeger;
    private TiledLayer tiledLayerBeira;
    //Posição da LayerManeger
    private int xLayerManeger = 0, yLayerManeger = 0;
    
    
    //COnstrutor do jogo
    public Game(){
        super(true);
        setFullScreenMode(true);
        jogo();
        try{
            inicio();
        }catch(IOException e){
            e.printStackTrace();
        }
    }
    
    public void run() {
         Graphics g = getGraphics();
        
        while(!this.ativo){
            //Inicia o jogo com o carro virado para frente
            carro.setFrameSequence(gd.carSeq);
            
            //Método que verifica as teclas pressionadas
            lerTeclado();
        }//fim while
        
        //Definições visuais
        layerManeger.setViewWindow(xLayerManeger, yLayerManeger, this.getWidth(), this.getHeight());
        this.layerManeger.paint(g, 0, 0);
        flushGraphics(0, 0, this.getWidth(), this.getHeight());
        
        try{
            Thread.sleep(20);
        }catch(InterruptedException e){
            e.printStackTrace();
        }
    }

    private void jogo() {
        gd = new GameDesign();
        timer = new Timer();
        layerManeger = new LayerManager();
        try{
            gd.updateLayerManagerForCenaGame(layerManeger);
        }catch(IOException e){
            e.printStackTrace();
        }
    }

    private void inicio() throws IOException {
        carro = gd.getCar();
        tiledLayerBeira = gd.getBeirada();
        asCarro = new AnimaSprite(carro, true);
        
    }

    
    //Método que lê as teclas pressionadas
    private void lerTeclado() {
        int keyState = getKeyStates();
        
        //CIMA
        if((keyState & UP_PRESSED) != 0){
            if(0 < yLayerManeger){
                carro.setPosition(carro.getX(), carro.getY() + 4);
            }
        }
    }
    
    //Para o jogo
    public void stop(){
        ativo = true;
    }
    
}

Não estou compreendendo o motivo dele estar exibindo esta tela branca.

Espero que possam me ajudar.

Porque aqui você mandou que ela se pinte de branco.

:thumbup:

Se refere ao método paint?

[quote=edu_fernandes]Se refere ao método paint?
[/quote]

Sim.

:thumbup:

Linha 21 da Midlet, voce deveria usar Thread, e não chamar o run().