Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void showRemoveBoardDialog() {
});

Scene scene = new Scene(layout, 350, 200);
scene.getStylesheets().add(getClass().getResource("/styles.css").toExternalForm());
scene.getStylesheets().add(getClass().getResource("/style/styles.css").toExternalForm());
removeDialog.setScene(scene);
removeDialog.showAndWait();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ public void showSnakesAndLaddersGameBoardWithLoad(Stage stage, String gameName)
scene
.getStylesheets()
.addAll(
getClass().getResource("/styles.css").toExternalForm(),
getClass().getResource("/snakesandladders.css").toExternalForm());
getClass().getResource("/style/styles.css").toExternalForm(),
getClass().getResource("/style/snakesandladders.css").toExternalForm());
stage.setScene(scene);
stage.show();
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ protected void setupUI() {
controls.getChildren().addAll(diceView, nextTurnButton, gameControls);
root.setBottom(controls);
Scene scene = new Scene(root, 800, 600);
scene.getStylesheets().add(getClass().getResource("/styles.css").toExternalForm());
scene.getStylesheets().add(getClass().getResource("/style/styles.css").toExternalForm());
primaryStage.setScene(scene);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private void setupMainMenu() {
root.setBottom(creditPane);

Scene scene = new Scene(root, 1000, 700);
scene.getStylesheets().add(getClass().getResource("/common.css").toExternalForm());
scene.getStylesheets().add(getClass().getResource("/style/common.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private void setupUI() {
root.setBottom(bottomBox);

Scene scene = new Scene(root, 600, 700);
scene.getStylesheets().add(getClass().getResource("/common.css").toExternalForm());
scene.getStylesheets().add(getClass().getResource("/style/common.css").toExternalForm());
stage.setScene(scene);

// Add double-click functionality for quicker selection
Expand Down Expand Up @@ -405,7 +405,7 @@ private void showAddPlayerDialog() {
});

Scene scene = new Scene(layout, 400, 300);
scene.getStylesheets().add(getClass().getResource("/common.css").toExternalForm());
scene.getStylesheets().add(getClass().getResource("/style/common.css").toExternalForm());
addDialog.setScene(scene);
addDialog.showAndWait();
}
Expand Down Expand Up @@ -562,7 +562,7 @@ private void showTokenSelectionDialog(String playerName) {
});

Scene scene = new Scene(layout, 400, 200);
scene.getStylesheets().add(getClass().getResource("/common.css").toExternalForm());
scene.getStylesheets().add(getClass().getResource("/style/common.css").toExternalForm());
tokenDialog.setScene(scene);
tokenDialog.showAndWait();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ public void setupUI() {
animator = new MonopolyAnimator(this, tilePanes, playerTokensByName);

// Add stylesheets
getScene().getStylesheets().add(getClass().getResource("/monopoly.css").toExternalForm());
getScene().getStylesheets().add(getClass().getResource("/styles.css").toExternalForm());
getScene().getStylesheets().add(getClass().getResource("/style/monopoly.css").toExternalForm());
getScene().getStylesheets().add(getClass().getResource("/style/styles.css").toExternalForm());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ private void setupMenu() {
root.setCenter(centerBox);

Scene scene = new Scene(root, 1200, 800);
scene.getStylesheets().add(getClass().getResource("/monopoly.css").toExternalForm());
scene.getStylesheets().add(getClass().getResource("/styles.css").toExternalForm());
scene.getStylesheets().add(getClass().getResource("/style/monopoly.css").toExternalForm());
scene.getStylesheets().add(getClass().getResource("/style/styles.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public SnakesAndLaddersGameUI(
controller,
playerNames,
mediator,
"/snakes_and_ladders_board.jpeg");
"/snakeandladder_boardgame/snakes_and_ladders_board.jpeg");
}

/**
Expand Down Expand Up @@ -173,7 +173,8 @@ protected void setupUI() {
topBar.setAlignment(Pos.CENTER_LEFT);
Button backButton = CommonButtons.backToMainMenu(primaryStage, false, controller);
backButton.getStyleClass().add("game-control-button");
topBar.getChildren().addAll(backButton, saveButton);
Button saveBtn = CommonButtons.saveGameBtn(false, controller, new Label());
topBar.getChildren().addAll(backButton, saveBtn);
root.setTop(topBar);

// --- Bottom bar: Dice view and Roll button ---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,12 @@ private VBox setUpCenterBox() {
Button mediumBtn = createMenuButton("Level: Medium");
Button hardBtn = createMenuButton("Level: Hard");

easyBtn.setOnAction(e -> startGameWithLevel("easy", "/snakes_and_ladders_easy.jpg"));
mediumBtn.setOnAction(e -> startGameWithLevel("medium", "/snakes_and_ladders_board.jpeg"));
hardBtn.setOnAction(e -> startGameWithLevel("hard", "/snakes_and_ladders_hard_board.png"));
easyBtn.setOnAction(e -> startGameWithLevel("easy",
"/snakeandladder_boardgame/snakes_and_ladders_easy.jpg"));
mediumBtn.setOnAction(e -> startGameWithLevel("medium",
"/snakeandladder_boardgame/snakes_and_ladders_board.jpeg"));
hardBtn.setOnAction(e -> startGameWithLevel("hard",
"/snakeandladder_boardgame/snakes_and_ladders_hard_board.png"));

HBox levelButtons = new HBox(20, easyBtn, mediumBtn, hardBtn);
levelButtons.setAlignment(Pos.CENTER);
Expand Down Expand Up @@ -210,8 +213,8 @@ private void createAndSetScene(BorderPane gameUI) {
scene
.getStylesheets()
.addAll(
getClass().getResource("/styles.css").toExternalForm(),
getClass().getResource("/snakesandladders.css").toExternalForm());
getClass().getResource("/style/styles.css").toExternalForm(),
getClass().getResource("/style/snakesandladders.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
}
Expand Down Expand Up @@ -440,9 +443,9 @@ private SnakesAndLaddersGameUI getSnakesAndLaddersGameUI(String gameName, BoardG
// Determine image path based on level
String imagePath =
switch (level) {
case "easy" -> "/snakes_and_ladders_easy.jpg";
case "hard" -> "/snakes_and_ladders_hard_board.png";
default -> "/snakes_and_ladders_board.jpeg";
case "easy" -> "/snakeandladder_boardgame/snakes_and_ladders_easy.jpg";
case "hard" -> "/snakeandladder_boardgame/snakes_and_ladders_hard_board.png";
default -> "/snakeandladder_boardgame/snakes_and_ladders_board.jpeg";
};
SnakesAndLaddersGameUI gameUI =
new SnakesAndLaddersGameUI(
Expand Down
249 changes: 249 additions & 0 deletions src/main/resources/saved_games/monopoly/two_player_medium_board.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
{
"currentPlayerIndex": 0,
"players": [
{
"currentTile": {
"id": 9
},
"tokenImage": "token_green.png",
"money": 1360,
"playerType": "MONOPOLY",
"name": "Katrina",
"position": 9
},
{
"currentTile": {
"id": 12
},
"tokenImage": "token_purple.png",
"money": 1340,
"playerType": "MONOPOLY",
"name": "Kareena",
"position": 12
}
],
"dice": {
"dice": [
{
"lastRolledValue": 6
},
{
"lastRolledValue": 6
}
]
},
"board": {
"tiles": {
"22": {
"nextTileId": 23,
"price": 220,
"id": 22,
"type": "PropertyTile",
"rent": 44,
"group": 2
},
"23": {
"nextTileId": 24,
"price": 220,
"id": 23,
"type": "PropertyTile",
"rent": 44,
"group": 2
},
"24": {
"nextTileId": 25,
"price": 220,
"id": 24,
"type": "PropertyTile",
"rent": 44,
"group": 2
},
"25": {
"nextTileId": 26,
"id": 25,
"type": "Tile"
},
"26": {
"nextTileId": 27,
"price": 240,
"id": 26,
"type": "PropertyTile",
"rent": 48,
"group": 3
},
"27": {
"nextTileId": 0,
"price": 240,
"id": 27,
"type": "PropertyTile",
"rent": 48,
"group": 3
},
"10": {
"nextTileId": 11,
"price": 140,
"id": 10,
"type": "PropertyTile",
"rent": 28,
"group": 2
},
"11": {
"nextTileId": 12,
"id": 11,
"type": "Tile"
},
"12": {
"owner": "Kareena",
"nextTileId": 13,
"price": 160,
"id": 12,
"type": "PropertyTile",
"rent": 32,
"group": 3
},
"13": {
"nextTileId": 14,
"price": 160,
"id": 13,
"type": "PropertyTile",
"rent": 32,
"group": 3
},
"14": {
"nextTileId": 15,
"id": 14,
"type": "FreeParkingTile"
},
"15": {
"nextTileId": 16,
"price": 180,
"id": 15,
"type": "PropertyTile",
"rent": 36,
"group": 0
},
"16": {
"nextTileId": 17,
"price": 180,
"id": 16,
"type": "PropertyTile",
"rent": 36,
"group": 0
},
"17": {
"nextTileId": 18,
"price": 180,
"id": 17,
"type": "PropertyTile",
"rent": 36,
"group": 0
},
"18": {
"nextTileId": 19,
"id": 18,
"type": "Tile"
},
"19": {
"nextTileId": 20,
"price": 200,
"id": 19,
"type": "PropertyTile",
"rent": 40,
"group": 1
},
"0": {
"nextTileId": 1,
"action": {
"type": "CollectMoneyAction"
},
"id": 0,
"type": "GoTile"
},
"1": {
"nextTileId": 2,
"price": 100,
"id": 1,
"type": "PropertyTile",
"rent": 20,
"group": 0
},
"2": {
"nextTileId": 3,
"price": 100,
"id": 2,
"type": "PropertyTile",
"rent": 20,
"group": 0
},
"3": {
"nextTileId": 4,
"price": 100,
"id": 3,
"type": "PropertyTile",
"rent": 20,
"group": 0
},
"4": {
"nextTileId": 5,
"id": 4,
"type": "Tile"
},
"5": {
"nextTileId": 6,
"price": 120,
"id": 5,
"type": "PropertyTile",
"rent": 24,
"group": 1
},
"6": {
"nextTileId": 7,
"price": 120,
"id": 6,
"type": "PropertyTile",
"rent": 24,
"group": 1
},
"7": {
"nextTileId": 8,
"action": {
"type": "GoToJailAction",
"jailTileId": 21
},
"id": 7,
"type": "Tile"
},
"8": {
"nextTileId": 9,
"price": 140,
"id": 8,
"type": "PropertyTile",
"rent": 28,
"group": 2
},
"9": {
"owner": "Katrina",
"nextTileId": 10,
"price": 140,
"id": 9,
"type": "PropertyTile",
"rent": 28,
"group": 2
},
"20": {
"nextTileId": 21,
"price": 200,
"id": 20,
"type": "PropertyTile",
"rent": 40,
"group": 1
},
"21": {
"nextTileId": 22,
"id": 21,
"type": "JailTile"
}
},
"boardSize": 28
}
}
Loading