mirror of
https://forge.univ-lyon1.fr/tplifap4/gyromite_ya.git
synced 2024-02-27 13:31:49 +01:00
ralentissement ia
This commit is contained in:
parent
e7ee583c2f
commit
1cba55e095
@ -9,17 +9,16 @@ import java.awt.*;
|
|||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
public class IA extends RealisateurDeDeplacement {
|
public class IA extends RealisateurDeDeplacement {
|
||||||
|
|
||||||
int genererInt(int borneInf, int borneSup){
|
int alt = 0;
|
||||||
Random rand = new Random();
|
|
||||||
int nb;
|
|
||||||
nb = borneInf+rand.nextInt(borneSup-borneInf);
|
|
||||||
return nb;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected boolean realiserDeplacement() {
|
protected boolean realiserDeplacement() {
|
||||||
for (ElementDynamique e : lstEntitesDynamiques)
|
for (ElementDynamique e : lstEntitesDynamiques)
|
||||||
if (e instanceof modele.donnees.IA) {
|
if (e instanceof modele.donnees.IA) {
|
||||||
e.avancerDirectionChoisie(null);
|
if(alt < 3){
|
||||||
|
alt++;
|
||||||
|
}else{
|
||||||
|
e.avancerDirectionChoisie(null);
|
||||||
|
alt = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user