diff --git a/src/GameIO/PropertyReader.java b/src/GameIO/PropertyReader.java index 8a6a8c4..331cfd8 100644 --- a/src/GameIO/PropertyReader.java +++ b/src/GameIO/PropertyReader.java @@ -13,7 +13,7 @@ public class PropertyReader { * Reads the properties of the game. */ - private static final String PATH = "/game.properties"; + private static final String PATH = "src/game.properties"; public PropertyReader() { diff --git a/src/GameIO/SettingsListener.java b/src/GameIO/SettingsListener.java index 87c06d8..e3dc3e8 100644 --- a/src/GameIO/SettingsListener.java +++ b/src/GameIO/SettingsListener.java @@ -7,7 +7,7 @@ public class SettingsListener implements ActionListener { - private Settings settings; + private final Settings settings; public SettingsListener(Settings settings) { this.settings = settings; diff --git a/src/Panels/Playground.java b/src/Panels/Playground.java index 05ef6a3..8002b04 100644 --- a/src/Panels/Playground.java +++ b/src/Panels/Playground.java @@ -197,11 +197,11 @@ public boolean isValidPlace( int y, int x, int shipSize ) { } - if ( endPosY > 9 ) - endPosY = 9; + if ( endPosY >= Integer.parseInt(gameSummary.getProperty("grid")) ) + endPosY = Integer.parseInt(gameSummary.getProperty("grid"))-1; - if ( endPosX > 9 ) - endPosX = 9; + if ( endPosX >= Integer.parseInt(gameSummary.getProperty("grid")) ) + endPosX = Integer.parseInt(gameSummary.getProperty("grid"))-1; // See how many are alive for (int xNum = startPosX; xNum <= endPosX; xNum++) diff --git a/src/game.properties b/src/game.properties index 41da6e7..8c776df 100644 --- a/src/game.properties +++ b/src/game.properties @@ -1,7 +1,7 @@ -#Wed Apr 27 13:37:18 CEST 2022 -height=800 +#Thu Apr 28 12:28:06 CEST 2022 p1Color=0xcccc00 -grid=10 +height=800 +grid=17 width=800 restartSettingsClose=true p2Color=0x00cc00