From 5d4aaa344df642a17355d33dbc820638792fa59b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Mon, 20 Jun 2022 16:48:41 +0200 Subject: [PATCH] fix 4 attacks --- src/Screen/ScreenBattle.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Screen/ScreenBattle.java b/src/Screen/ScreenBattle.java index 5f193cd..0e2c854 100644 --- a/src/Screen/ScreenBattle.java +++ b/src/Screen/ScreenBattle.java @@ -124,16 +124,13 @@ public class ScreenBattle extends RenderingScreen{ if (battle.cursor > 3) battle.cursor = 0; if (battle.cursor < 0) battle.cursor = 3; - - //the enemy is attacking - if( battle.getAttackOn() == false){ + + 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; } - } - - //the enemy is speaking - if(battle.getAttackOn() == true){ + } 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){ battle.action(1); battle.cursor = 0; @@ -151,7 +148,7 @@ public class ScreenBattle extends RenderingScreen{ battle.cursor = 0; } } - + b.updateText(); //mettre le front à false jusqu'à ce que le bouton soit relâché