1
0
mirror of https://github.com/Klagarge/PokeHES.git synced 2024-11-26 19:13: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){ public void action(int answer){
textEnemy.randomAnswer();
//the player is at the last question, the finish text must be displayed //the player is at the last question, the finish text must be displayed
if(getLineSpeech() == 4){ if(getLineSpeech() == 4){
checkAnswer(answer);
finishSpeech(); finishSpeech();
} }
//the player is at the finish text and he must quit the battle //the player is at the finish text and he must quit the battle
@ -67,6 +66,8 @@ public class Battle {
else{ else{
readNextLine(); readNextLine();
} }
textEnemy.randomAnswer();
} }
//check the choice answer //check the choice answer

View File

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