diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e051867ba08f795b1217e09668bd322d4db61908..85d06e63f7fd185eb29c2ee812a6ce56e7214dfa 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,9 +5,19 @@ UNO ====== >>> start-date: 09.04.16 ->>> status-date: 23.04.16 +>>> status-date: 24.04.16 ____________________________________________________ +v.1.1.0 - (2) +=============== + +-added minHeight and minWidth to Achievement Window +-Fixed flipped image buf (only appears on Mac) (caused by Anti-Aliasing) +-changed Menu and Startpage Layout +-made save path OS independent + +>>> end-work: 24.04.16 + v.1.0.0 - (1) =============== diff --git a/README.md b/README.md index c7c9c4cb34aa8e9efb2a3c2b2d78017a32eba977..2729085c3bf19d5d8d708bf0aaa1e18f38d3f71b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # UNO - startdate: 09.04.16 -- current version: 1.0.0 (1) - 23.04.16 +- current version: 1.1.0 (2) - 24.04.16 ### Description diff --git a/build/UNO.exe b/build/UNO.exe index b67fe0e2368748727dacc2ba2e9f989988ae1dbe..7b02d4290cf370600925f3797b1324bc8dd080cf 100644 Binary files a/build/UNO.exe and b/build/UNO.exe differ diff --git a/build/UNO.jar b/build/UNO.jar index e024eb2de4c1fa764cd4557219ae2944d4e21c67..365f80e115053236b82069b88b800e2e52f805a1 100644 Binary files a/build/UNO.jar and b/build/UNO.jar differ diff --git a/class/application/Controller$2.class b/class/application/Controller$2.class index 4d2591e15faa0f3fffbff619bf1baccbdaad886a..c817c8bff08ffebfca784208764feb1e71ef913e 100644 Binary files a/class/application/Controller$2.class and b/class/application/Controller$2.class differ diff --git a/class/application/Controller$3.class b/class/application/Controller$3.class index c9b29953b86bd801c5abe7bb080b6304d68ee361..cb09ad2228fd51b5be495c3f74989d99b9c7bb93 100644 Binary files a/class/application/Controller$3.class and b/class/application/Controller$3.class differ diff --git a/class/application/Controller$4.class b/class/application/Controller$4.class index cd82e66530250756624ba54ab6ef335fe0ca2962..12000491658f84a5cf997f640f6719614c1a6de0 100644 Binary files a/class/application/Controller$4.class and b/class/application/Controller$4.class differ diff --git a/class/application/Controller$5.class b/class/application/Controller$5.class index 916951d78b8511f603280aaaaab6827552e5c339..5c0b126293a150a7faa5f95616128d37e57402ad 100644 Binary files a/class/application/Controller$5.class and b/class/application/Controller$5.class differ diff --git a/class/application/Controller$6.class b/class/application/Controller$6.class index 96ba6f61200760ad0299c7a20e2cb2116fc527e8..5294c4bbf5fa45cb1c42ce8adab8139d6670c9ef 100644 Binary files a/class/application/Controller$6.class and b/class/application/Controller$6.class differ diff --git a/class/application/Controller$7.class b/class/application/Controller$7.class index 5114eebad1bbbe936eddff14e04368997e701842..45eb526fb5a72939124fd0e191c2791c7c49f084 100644 Binary files a/class/application/Controller$7.class and b/class/application/Controller$7.class differ diff --git a/class/application/Controller$8.class b/class/application/Controller$8.class index d15225855fb61543518af353422532735a2d9b2c..14d4ee6282a3ef0da2c25f9bdbcfdd7f744e27ff 100644 Binary files a/class/application/Controller$8.class and b/class/application/Controller$8.class differ diff --git a/class/application/Controller$9.class b/class/application/Controller$9.class index c4731d596c18cac74ce651a0f0797f039c5c1bf6..cd3f4e26daec5e48266ae36a59e8ea2555256e2d 100644 Binary files a/class/application/Controller$9.class and b/class/application/Controller$9.class differ diff --git a/class/application/Controller.class b/class/application/Controller.class index 11e012d102404782794c62ae5acca1e18aba99dd..6761f57b5cda095f75b35f72431cd1ef4e83e667 100644 Binary files a/class/application/Controller.class and b/class/application/Controller.class differ diff --git a/class/application/MainGUI.fxml b/class/application/MainGUI.fxml index 56a58bd158ee2d27f6e2e83157fc273cef44d7c9..af60c37f64751a166df64fa64436f91e848ef071 100644 --- a/class/application/MainGUI.fxml +++ b/class/application/MainGUI.fxml @@ -78,8 +78,7 @@ <menus> <Menu fx:id="menu1" mnemonicParsing="false" text="Menü"> <items> - <MenuItem fx:id="menuItemNewGame" mnemonicParsing="false" onAction="#startGame" text="Neues Spiel" /> - <MenuItem fx:id="menuItem2" mnemonicParsing="false" onAction="#openSettings" text="Einstellungen" /> + <MenuItem fx:id="menuItemBack" mnemonicParsing="false" onAction="#showMainMenu" text="Zurück zum Start" /> <MenuItem fx:id="menuItem1" mnemonicParsing="false" onAction="#buttonAchievements" text="Achievements" /> <MenuItem fx:id="menuItem3" mnemonicParsing="false" onAction="#about" text="Über" /> </items> @@ -91,12 +90,17 @@ <Image url="@../images/icon.png" /> </image> </ImageView> - <Label fx:id="labelLogo" layoutX="244.0" layoutY="385.0" text="Willkommen bei UNO!"> + <Label fx:id="labelLogo" layoutX="252.0" layoutY="385.0" text="Willkommen bei UNO!"> <font> <Font name="System Bold" size="28.0" /> </font> </Label> - <Button fx:id="buttonNewGame" layoutX="344.0" layoutY="469.0" mnemonicParsing="false" onAction="#startGame" text="Neues Spiel"> + <Button fx:id="buttonNewGame" layoutX="282.0" layoutY="468.0" mnemonicParsing="false" onAction="#startGame" text="Neues Spiel"> + <font> + <Font name="System Bold" size="14.0" /> + </font> + </Button> + <Button fx:id="buttonSettings" layoutX="410.0" layoutY="468.0" mnemonicParsing="false" onAction="#openSettings" text="Einstellungen"> <font> <Font name="System Bold" size="14.0" /> </font> diff --git a/class/application/_de.properties b/class/application/_de.properties index 1f94040dc28a05b09e3240cf9a5c7a62b3e7ebae..577ee1e02ff6483bc7462c11584bd7e8862458f1 100644 --- a/class/application/_de.properties +++ b/class/application/_de.properties @@ -1,4 +1,4 @@ app.name=UNO -version.code=1 -version.name=1.0.0 +version.code=2 +version.name=1.1.0 version.date=23.04.16 \ No newline at end of file diff --git a/class/logic/AI.class b/class/logic/AI.class index f6705afda4d606403bdcf6cbe9f5e96e9b71fbbc..e54608b3bdd23e131beb98974db60b01601c4d69 100644 Binary files a/class/logic/AI.class and b/class/logic/AI.class differ diff --git a/class/logic/Game.class b/class/logic/Game.class index e45bf14a5786795e43bae92f336c649012f9e37a..af9ac1e726f77c8a3284c9294710f6887a3254e6 100644 Binary files a/class/logic/Game.class and b/class/logic/Game.class differ diff --git a/src/application/Controller.java b/src/application/Controller.java index 23e6895b76d71ae4060702bb4ffe3ff39d78e334..03d122b7f9fc3b75d8abe0905849ef0aa6705297 100644 --- a/src/application/Controller.java +++ b/src/application/Controller.java @@ -69,13 +69,12 @@ public class Controller @FXML private MenuBar menuBar; @FXML private Menu menu1; @FXML private MenuItem menuItem1; - @FXML private MenuItem menuItem2; @FXML private MenuItem menuItem3; - @FXML private MenuItem menuItemNewGame; + @FXML private MenuItem menuItemBack; @FXML private ImageView imageViewLogo; @FXML private Label labelLogo; @FXML private Button buttonNewGame; - + @FXML private Button buttonSettings; public Game game; public Color chosenWishColor; @@ -85,6 +84,7 @@ public class Controller private int secretCounter; private boolean playerHasDrawn; public boolean playerMustChallenge; + public TranslateTransition translateTransition; public Stage stage; public Image icon = new Image("images/icon.png"); @@ -184,11 +184,10 @@ public class Controller { if(game != null) { - game.stop(); + game.stop(); } clearAll(); - menuItem2.setDisable(true); drawCounter = 0; playerHasDrawn = false; @@ -231,11 +230,26 @@ public class Controller buttonStart.setVisible(true); } + public void showMainMenu() + { + if(game != null) + { + game.stop(); + } + + clearAll(); + clearPlayerDeck(); + clearAllDecks(game.getAIs()); + + showNeutralUI(); + } + public void showNeutralUI() { imageViewLogo.setVisible(true); labelLogo.setVisible(true); buttonNewGame.setVisible(true); + buttonSettings.setVisible(true); } public void hideNeutralUI() @@ -243,6 +257,7 @@ public class Controller imageViewLogo.setVisible(false); labelLogo.setVisible(false); buttonNewGame.setVisible(false); + buttonSettings.setVisible(false); } public void setLabelNames(Player player, ArrayList<AI> ais) @@ -507,7 +522,7 @@ public class Controller { Point2D deckPosition = iconLastCard.localToScene(Point2D.ZERO); - TranslateTransition translateTransition = new TranslateTransition(); + translateTransition = new TranslateTransition(); translateTransition.setDuration(Duration.millis(500)); translateTransition.setNode(view); translateTransition.setCycleCount(1); @@ -521,46 +536,52 @@ public class Controller @Override public void handle(ActionEvent event) { - if(newWishColor != null) - { - showCircleWishColor(newWishColor); - } - else - { - hideWishColor(); - } - Card playedCard = game.getPlayer().playCard(card); - - if(playedCard.getType().equals(CardType.DRAW_FOUR) && game.getDeadDeck().getCards().get(game.getDeadDeck().getCards().size()-1).getType().equals(CardType.DRAW_FOUR) && game.getChallengeCounter() > 0) + if(game.isRunning()) { - try - { - handler.unlockAchievement(6); - handler.saveAndLoad(); - } - catch(Exception e) - { + if(newWishColor != null) + { + showCircleWishColor(newWishColor); } - } - - if(playedCard.getType().equals(CardType.WILD)) - { - try - { - handler.unlockAchievement(7); - handler.saveAndLoad(); + else + { + hideWishColor(); } - catch(Exception e) - { + Card playedCard = game.getPlayer().playCard(card); + + if(playedCard.getType().equals(CardType.DRAW_FOUR) && game.getDeadDeck().getCards().get(game.getDeadDeck().getCards().size()-1).getType().equals(CardType.DRAW_FOUR) && game.getChallengeCounter() > 0) + { + try + { + handler.unlockAchievement(6); + handler.saveAndLoad(); + } + catch(Exception e) + { + } } - } - - setPlayerDeck(game.getPlayer().getDeck()); - game.playCard(playedCard, newWishColor); + + if(playedCard.getType().equals(CardType.WILD)) + { + try + { + handler.unlockAchievement(7); + handler.saveAndLoad(); + } + catch(Exception e) + { + } + } + + setPlayerDeck(game.getPlayer().getDeck()); + game.playCard(playedCard, newWishColor); + } } }); - translateTransition.play(); + if(game.isRunning()) + { + translateTransition.play(); + } } public void moveAICardToDeadDeck(AI ai, int currentPlayer, Card card, Color newWishColor) @@ -584,7 +605,7 @@ public class Controller Point2D deckPosition = iconLastCard.localToScene(Point2D.ZERO); - TranslateTransition translateTransition = new TranslateTransition(); + translateTransition = new TranslateTransition(); translateTransition.setDuration(Duration.millis(500)); translateTransition.setNode(view); translateTransition.setCycleCount(1); @@ -598,21 +619,27 @@ public class Controller @Override public void handle(ActionEvent event) { - if(newWishColor != null) + if(game.isRunning()) { - showCircleWishColor(newWishColor); - } - else - { - hideWishColor(); + if(newWishColor != null) + { + showCircleWishColor(newWishColor); + } + else + { + hideWishColor(); + } + Card playedCard = ai.playCard(card); + setAIDeck(ai); + game.playCard(playedCard, newWishColor); } - Card playedCard = ai.playCard(card); - setAIDeck(ai); - game.playCard(playedCard, newWishColor); } }); - translateTransition.play(); + if(game.isRunning()) + { + translateTransition.play(); + } } public void moveCardFromDeckToPlayer(ArrayList<Card> cards) @@ -627,7 +654,7 @@ public class Controller view.setY(deckPosition.getY()); mainPane.getChildren().add(view); - TranslateTransition translateTransition = new TranslateTransition(); + translateTransition = new TranslateTransition(); translateTransition.setDuration(Duration.millis(500)); translateTransition.setNode(view); translateTransition.setCycleCount(1); @@ -640,7 +667,7 @@ public class Controller { @Override public void handle(ActionEvent event) - { + { ObservableList<Node> nodes = mainPane.getChildren(); Iterator<Node> iterator = nodes.iterator(); while(iterator.hasNext()) @@ -650,27 +677,32 @@ public class Controller iterator.remove(); } } - - game.getPlayer().drawCard(cards.get(drawCounter)); - setPlayerDeck(game.getPlayer().getDeck()); - drawCounter++; - playerHasDrawn = false; - - if(drawCounter < cards.size()) - { - moveCardFromDeckToPlayer(cards); + if(game.isRunning()) + { + game.getPlayer().drawCard(cards.get(drawCounter)); + setPlayerDeck(game.getPlayer().getDeck()); + drawCounter++; + playerHasDrawn = false; + + if(drawCounter < cards.size()) + { + moveCardFromDeckToPlayer(cards); + } + else + { + game.setShowingInfo(false); + hideInfo(); + drawCounter = 0; + game.draw(); + } } - else - { - game.setShowingInfo(false); - hideInfo(); - drawCounter = 0; - game.draw(); - } } }); - translateTransition.play(); + if(game.isRunning()) + { + translateTransition.play(); + } } } @@ -777,7 +809,7 @@ public class Controller view.setY(deckPosition.getY()); mainPane.getChildren().add(view); - TranslateTransition translateTransition = new TranslateTransition(); + translateTransition = new TranslateTransition(); translateTransition.setDuration(Duration.millis(500)); translateTransition.setNode(view); translateTransition.setCycleCount(1); @@ -814,25 +846,31 @@ public class Controller } } - ai.drawCard(cards.get(drawCounter)); - setAIDeck(ai); - drawCounter++; - - if(drawCounter < cards.size()) - { - moveCardFromDeckToAI(ai, cards); - } - else + if(game.isRunning()) { - game.setShowingInfo(false); - hideInfo(); - drawCounter = 0; - game.draw(); - } + ai.drawCard(cards.get(drawCounter)); + setAIDeck(ai); + drawCounter++; + + if(drawCounter < cards.size()) + { + moveCardFromDeckToAI(ai, cards); + } + else + { + game.setShowingInfo(false); + hideInfo(); + drawCounter = 0; + game.draw(); + } + } } }); - translateTransition.play(); + if(game.isRunning()) + { + translateTransition.play(); + } } } @@ -1152,8 +1190,7 @@ public class Controller public void clearAll() { - hideNeutralUI(); - menuItem2.setDisable(false); + hideNeutralUI(); hideWishColor(); hideInfo(); labelCurrentPlayer.setVisible(false); diff --git a/src/application/MainGUI.fxml b/src/application/MainGUI.fxml index 56a58bd158ee2d27f6e2e83157fc273cef44d7c9..af60c37f64751a166df64fa64436f91e848ef071 100644 --- a/src/application/MainGUI.fxml +++ b/src/application/MainGUI.fxml @@ -78,8 +78,7 @@ <menus> <Menu fx:id="menu1" mnemonicParsing="false" text="Menü"> <items> - <MenuItem fx:id="menuItemNewGame" mnemonicParsing="false" onAction="#startGame" text="Neues Spiel" /> - <MenuItem fx:id="menuItem2" mnemonicParsing="false" onAction="#openSettings" text="Einstellungen" /> + <MenuItem fx:id="menuItemBack" mnemonicParsing="false" onAction="#showMainMenu" text="Zurück zum Start" /> <MenuItem fx:id="menuItem1" mnemonicParsing="false" onAction="#buttonAchievements" text="Achievements" /> <MenuItem fx:id="menuItem3" mnemonicParsing="false" onAction="#about" text="Über" /> </items> @@ -91,12 +90,17 @@ <Image url="@../images/icon.png" /> </image> </ImageView> - <Label fx:id="labelLogo" layoutX="244.0" layoutY="385.0" text="Willkommen bei UNO!"> + <Label fx:id="labelLogo" layoutX="252.0" layoutY="385.0" text="Willkommen bei UNO!"> <font> <Font name="System Bold" size="28.0" /> </font> </Label> - <Button fx:id="buttonNewGame" layoutX="344.0" layoutY="469.0" mnemonicParsing="false" onAction="#startGame" text="Neues Spiel"> + <Button fx:id="buttonNewGame" layoutX="282.0" layoutY="468.0" mnemonicParsing="false" onAction="#startGame" text="Neues Spiel"> + <font> + <Font name="System Bold" size="14.0" /> + </font> + </Button> + <Button fx:id="buttonSettings" layoutX="410.0" layoutY="468.0" mnemonicParsing="false" onAction="#openSettings" text="Einstellungen"> <font> <Font name="System Bold" size="14.0" /> </font> diff --git a/src/application/_de.properties b/src/application/_de.properties index 1f94040dc28a05b09e3240cf9a5c7a62b3e7ebae..577ee1e02ff6483bc7462c11584bd7e8862458f1 100644 --- a/src/application/_de.properties +++ b/src/application/_de.properties @@ -1,4 +1,4 @@ app.name=UNO -version.code=1 -version.name=1.0.0 +version.code=2 +version.name=1.1.0 version.date=23.04.16 \ No newline at end of file diff --git a/src/logic/AI.java b/src/logic/AI.java index 82e7898c6c9b06c69e204763a84628b21d4ce43b..5dc93985f994f35a043ba1f5192b0958a38fb92e 100644 --- a/src/logic/AI.java +++ b/src/logic/AI.java @@ -163,7 +163,10 @@ public class AI { System.out.println("draw " + game.getChallengeCounter() + " cards"); ArrayList<Card> drawedCards = game.getDeck().drawCards(game.getChallengeCounter(), game.getDeadDeck()); - game.getController().moveCardFromDeckToAI(this, drawedCards); + if(game.isRunning()) + { + game.getController().moveCardFromDeckToAI(this, drawedCards); + } System.out.println("deack after draw: " + deck); } else @@ -171,7 +174,10 @@ public class AI System.out.println("draw one card"); ArrayList<Card> drawedCards = new ArrayList<Card>(); drawedCards.add(game.getDeck().drawCard(game.getDeadDeck())); - game.getController().moveCardFromDeckToAI(this, drawedCards); + if(game.isRunning()) + { + game.getController().moveCardFromDeckToAI(this, drawedCards); + } System.out.println("deack after draw: " + deck); } } @@ -188,7 +194,10 @@ public class AI newWishColor = getBestColor(); } - game.getController().moveAICardToDeadDeck(this, game.getCurrentPlayer(), playedCard, newWishColor); + if(game.isRunning()) + { + game.getController().moveAICardToDeadDeck(this, game.getCurrentPlayer(), playedCard, newWishColor); + } } } diff --git a/src/logic/Game.java b/src/logic/Game.java index 6ab42d7d217023827797ca02940f7843a8455835..d3f30b792d342fde705215454292f4e7fcb0eed7 100644 --- a/src/logic/Game.java +++ b/src/logic/Game.java @@ -185,35 +185,37 @@ public class Game } else { - - AI currentAI = ais.get(currentPlayer - 2); - - controller.setLabelCurrentPlayer(currentAI.getName() + " ist am Zug"); - - controller.setAIDeck(currentAI); - - try + if(running) { - switch(aiSpeed) + AI currentAI = ais.get(currentPlayer - 2); + + controller.setLabelCurrentPlayer(currentAI.getName() + " ist am Zug"); + + controller.setAIDeck(currentAI); + + try { - case 1: Thread.sleep(500); - break; - case 2: Thread.sleep(250); - break; - case 3: Thread.sleep(50); - break; - case 4: Thread.sleep(0); - break; - default: break; - } - } - catch(InterruptedException e) - { - //ERRORHANDLING - e.printStackTrace(); + switch(aiSpeed) + { + case 1: Thread.sleep(500); + break; + case 2: Thread.sleep(250); + break; + case 3: Thread.sleep(50); + break; + case 4: Thread.sleep(0); + break; + default: break; + } + } + catch(InterruptedException e) + { + //ERRORHANDLING + e.printStackTrace(); + } + + currentAI.turn(lastCard, wishColor, challenge); } - - currentAI.turn(lastCard, wishColor, challenge); } } else @@ -425,5 +427,6 @@ public class Game public void stop() { running = false; + System.out.println("STOPPED"); } } \ No newline at end of file