Commit a507c2a9 authored by Ghyselen's avatar Ghyselen

Now the soigner action will correpond to follow in the IA

parent f0b30cdd
......@@ -84,7 +84,19 @@ public class IGPEntity extends AbstractEntity {
}
break;
case "soigner" :
// This case is not implemented in the game, so "soigner" willl be considered as nothing by the IA
// This case is not implemented in the game, so "soigner" will be considered as "follow" by the IA
System.out.println("Je suis" + victim.getName());
int dX4 = victim.getX();
int dY4 = victim.getY();
int sX4 = relayer.getCharacter().getX();
int sY4 = relayer.getCharacter().getY();
Direction dir4 = AI.alpha_star(map,sX4, sY4, dX4, dY4,map.getWidth(),map.getHeight());
if (relayer.getCharacter().getCollisionBox().intersect(victim.getCollisionBox())) {
this.relayer.move(Direction.NONE);
} else {
this.relayer.move(dir4);
}
break;
default:
// In the default case, so the aciton "nothing", the Follower will just follow his owner
Entity owner =null;
......@@ -102,7 +114,7 @@ public class IGPEntity extends AbstractEntity {
this.relayer.move(Direction.NONE);
} else {
this.relayer.move(dir3);
}this.relayer.move(dir3);
}
}
}
}
Markdown is supported
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