1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
|
if(winner != null) {
entities.remove(winner);
if(winner.path != null) {
if(winner.path.size() == 0) {
if(winner.lastdirection==0) {
while(!entities.isEmpty()) {
next = Collections.min(entities);
if(next.type == "peasant") {
next.path = TiledMap.findPath((int)next.tileposition.x,(int)next.tileposition.y,(int)winner.tileposition.x+2,(int)winner.tileposition.y);
}
if(next.type == "archer") {
next.path = TiledMap.findPath((int)next.tileposition.x,(int)next.tileposition.y,(int)winner.tileposition.x%4,(int)winner.tileposition.y/4);
}
winner = next;
entities.remove(next);
}
}
}
}
|