Skip to content

Commit

Permalink
first finish - 2
Browse files Browse the repository at this point in the history
  • Loading branch information
fab-kreuzer committed Apr 28, 2022
1 parent fdd09f4 commit 9061fb7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/GameIO/PropertyReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {

Expand Down
2 changes: 1 addition & 1 deletion src/GameIO/SettingsListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class SettingsListener implements ActionListener {

private Settings settings;
private final Settings settings;

public SettingsListener(Settings settings) {
this.settings = settings;
Expand Down
8 changes: 4 additions & 4 deletions src/Panels/Playground.java
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down
6 changes: 3 additions & 3 deletions src/game.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9061fb7

Please sign in to comment.