1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2024-11-22 17:33:27 +00:00

fix last answer

This commit is contained in:
Rémi Heredero 2022-06-20 22:44:45 +02:00
parent 20ff589d82
commit ad7432ce02
2 changed files with 7 additions and 10 deletions

View File

@ -45,10 +45,9 @@ public class Battle {
}
public void action(int answer){
textEnemy.randomAnswer();
//the player is at the last question, the finish text must be displayed
if(getLineSpeech() == 4){
checkAnswer(answer);
finishSpeech();
}
//the player is at the finish text and he must quit the battle
@ -67,6 +66,8 @@ public class Battle {
else{
readNextLine();
}
textEnemy.randomAnswer();
}
//check the choice answer

View File

@ -115,20 +115,16 @@ public class ScreenBattle extends RenderingScreen{
//add a rising front to have one impulsion
if(PokeHES.risingFront){
if (c.keyStatus.get(Input.Keys.DOWN)){
battle.cursor++;
}
else if (c.keyStatus.get(Input.Keys.UP)){
battle.cursor--;
}
if (c.keyStatus.get(Input.Keys.DOWN)){ battle.cursor++; }
else if (c.keyStatus.get(Input.Keys.UP)){ battle.cursor--; }
if (battle.cursor > 3) battle.cursor = 0;
if (battle.cursor < 0) battle.cursor = 3;
if( battle.getAttackOn() == false){ //the enemy is attacking
if (c.keyStatus.get(Input.Keys.SPACE) || c.keyStatus.get(Input.Keys.A)){
battle.action(-1);
battle.cursor = 0;
//battle.cursor = 0;
}
} else if(battle.getAttackOn() == true){ //the enemy is speaking
if (c.keyStatus.get(Input.Keys.NUM_1) || c.keyStatus.get(Input.Keys.A) && b.cursor == 0){