diff --git a/build.gradle b/build.gradle index d2dfcbd..fb6cf8f 100644 --- a/build.gradle +++ b/build.gradle @@ -82,21 +82,6 @@ plugins.withType(DistributionPlugin) { } } -task createDocs { - def docs = file("$buildDir/docs") - outputs.dir docs -} - -distributions { - main { - contents { - from(createDocs) { - into 'docs' - } - } - } -} - wrapper { gradleVersion = '5.6.2' } \ No newline at end of file diff --git a/src/main/java/cl/cromer/azaraka/ai/EnemyAI.java b/src/main/java/cl/cromer/azaraka/ai/EnemyAI.java index 3d20a8c..f12c64f 100644 --- a/src/main/java/cl/cromer/azaraka/ai/EnemyAI.java +++ b/src/main/java/cl/cromer/azaraka/ai/EnemyAI.java @@ -215,7 +215,7 @@ public class EnemyAI extends AI implements Runnable, Constants { public void run() { while (getActive()) { try { - Thread.sleep(600); + Thread.sleep(700); } catch (InterruptedException e) { logger.info(e.getMessage()); diff --git a/src/main/java/cl/cromer/azaraka/ai/PlayerAI.java b/src/main/java/cl/cromer/azaraka/ai/PlayerAI.java index c949f29..e70016a 100644 --- a/src/main/java/cl/cromer/azaraka/ai/PlayerAI.java +++ b/src/main/java/cl/cromer/azaraka/ai/PlayerAI.java @@ -89,6 +89,7 @@ public interface PlayerAI extends Runnable, Constants { * @return Returns the new sorted destinations */ default List sortDestinations(List destinations, State initial) { + // TODO: make the AI look for the goal farthest from the enemy destinations.sort((state1, state2) -> { if (state1.getImportance() > state2.getImportance()) { // The first state is more important diff --git a/src/main/java/cl/cromer/azaraka/object/Player.java b/src/main/java/cl/cromer/azaraka/object/Player.java index f8c36e5..b7d569c 100644 --- a/src/main/java/cl/cromer/azaraka/object/Player.java +++ b/src/main/java/cl/cromer/azaraka/object/Player.java @@ -59,14 +59,16 @@ public class Player extends Object implements Constants { super(scene, cell); setLogger(getLogger(this.getClass(), LogLevel.PLAYER)); loadPlayerAnimation(); - if (PLAYER_AI == PlayerAIType.ASTAR) { - ai = new PlayerAStarAI(scene, this); - } - else if (PLAYER_AI == PlayerAIType.BFS) { - ai = new PlayerBreadthFirstAI(scene, this); - } - else { - ai = null; + switch (PLAYER_AI) { + case ASTAR: + ai = new PlayerAStarAI(scene, this); + break; + case BFS: + ai = new PlayerBreadthFirstAI(scene, this); + break; + default: + ai = null; + break; } } @@ -130,6 +132,8 @@ public class Player extends Object implements Constants { /** * Move the player up + * + * @return Returns true if the player moved */ @Override protected boolean moveUp() { @@ -188,6 +192,8 @@ public class Player extends Object implements Constants { /** * Move the player down + * + * @return Returns true if the player moved */ @Override protected boolean moveDown() { @@ -241,6 +247,8 @@ public class Player extends Object implements Constants { /** * Move the player to the left + * + * @return Returns true if the player moved */ @Override protected boolean moveLeft() { @@ -294,6 +302,8 @@ public class Player extends Object implements Constants { /** * Move the player to the right + * + * @return Returns true if the player moved */ @Override protected boolean moveRight() {