Commit a0c7fd5a authored by Yann Ramusat's avatar Yann Ramusat
Browse files

AI stop on player.

parent bfb791b1
......@@ -38,7 +38,13 @@ public class StraightEntity extends AbstractEntity {
if (victim_i!=-1) {
double r = random();
if(r<0.9){
this.move_to_victim(gameState.getAllEntities().get(this.Choose_victim()));
//this.move_to_victim(gameState.getAllEntities().get(this.Choose_victim()));
if (relayer.getCharacter().getCollisionBox().intersect(gameState.getAllEntities().get(this.Choose_victim()).getCollisionBox())) {
this.relayer.move(Direction.NONE);
}
else {
this.move_to_victim(gameState.getAllEntities().get(this.Choose_victim()));
}
}
else{
this.random_move();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment