Commit 461411a1 authored by Mathieu Hilaire's avatar Mathieu Hilaire

Merge branch 'master' of gitlab.crans.org:genie_logiciel_2015/the_dungeon_project

parents f211d8fa a507c2a9
......@@ -59,6 +59,12 @@ public class GameContent implements Serializable{
c.setFaction(1);
gameState.addEntity(c);
players.add(c);
Character follower = SpeciesArray.createCharacter(posX, posY, 5000, "Ponyta", "ponyta"+(i+1));
follower.setFaction(1);
gameState.addEntity(follower);
Relayer followerRelayer = Relayers.addNewRelayer(follower);
AIControler.add(this, followerRelayer, EnumBehaviourType.Follower);
}
System.out.println("GameContent class: One gameContent created by"+Thread.currentThread().getId());
Logging.getInstance().getLogger().info("GameContent class: One gameContent created by"+Thread.currentThread().getId());
......
......@@ -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