dimanche 9 octobre 2016

Java - Libgdx : Issue with the condition Else

I'm trying to write a condition but the else structure always show me an error:

Skin skin;
        skin = new Skin(Gdx.files.internal("default/skin/uiskin.json"));
        réponse = new TextField("", skin);
        réponse.setPosition(stage.getWidth() / 2 - 445, stage.getHeight() / 1 - 1600);
        réponse.setSize(900, 120);
        stage.addActor(réponse);

        if (réponse.getText().equals("riviere")){
            game.setScreen(new Stage1(game));
            music.stop();
        }
        else (!réponse.equals("riviere")){
            ecrireLeTexte = true;
        }

Code explanation: I want to make a condtion as if the user enter the good word (riviere) it will lead it to the next screen if not it will verify the boolean of ecrireLeTexte which is drawing the text "not the good word, retry"

Aucun commentaire:

Enregistrer un commentaire