Skip to content
Snippets Groups Projects
Commit 36a55d3b authored by Mohamed Taarit's avatar Mohamed Taarit
Browse files
parents f32a50a2 650573b8
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,6 @@ package bitFight; ...@@ -2,7 +2,6 @@ package bitFight;
import java.time.Duration; import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Random; import java.util.Random;
...@@ -20,8 +19,6 @@ class Main { ...@@ -20,8 +19,6 @@ class Main {
Scanner in = new Scanner(System.in); Scanner in = new Scanner(System.in);
Random rand = new Random(); Random rand = new Random();
LocalDateTime timeBeforeAttack = LocalDateTime.now();
int attackTime = 8 - (int)(5 * rand.nextDouble()); //A garder au début de la boucle
Input input = new Input(); Input input = new Input();
input.setInput(in.nextLine()); input.setInput(in.nextLine());
...@@ -32,6 +29,9 @@ class Main { ...@@ -32,6 +29,9 @@ class Main {
while (!input.getInput().equals("q") && !JoueurEnnemi.isDead()) { while (!input.getInput().equals("q") && !JoueurEnnemi.isDead()) {
LocalDateTime timeBeforeAttack = LocalDateTime.now();
int attackTime = 8 - (int)(5 * rand.nextDouble()); //A garder au début de la boucle
// Affiche un message lors d'un input non répertorié // Affiche un message lors d'un input non répertorié
if(!input.validInput()){ if(!input.validInput()){
System.out.println("Error input invalid"); System.out.println("Error input invalid");
...@@ -60,7 +60,7 @@ class Main { ...@@ -60,7 +60,7 @@ class Main {
if(Duration.between(timeBeforeAttack, LocalDateTime.now()).toSeconds() > attackTime){ if(Duration.between(timeBeforeAttack, LocalDateTime.now()).toSeconds() > attackTime){
//TODO, code pour joueur qui vient de se faire attaquer, FIN DE BOUCLE //TODO, code pour joueur qui vient de se faire attaquer, FIN DE BOUCLE
System.out.println("?? "); System.out.println("Attaque de l'ennemi (Trop lent!!!!!!!!!!!!!!!!!!!!!)");
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment