Skip to content
Snippets Groups Projects
Commit b4ce51a3 authored by Administrator's avatar Administrator
Browse files

Fixed #4

parent 82085f80
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -81,6 +81,7 @@ public class Controller
public Settings settings;
public AchievementHandler handler;
private int secretCounter;
private boolean playerHasDrawn;
public Stage stage;
public Image icon = new Image("images/icon.png");
......@@ -182,6 +183,7 @@ public class Controller
menuItem2.setDisable(true);
drawCounter = 0;
playerHasDrawn = false;
labelCurrentPlayer.setVisible(true);
iconDeck.setImage(createEmptyBackCard());
......@@ -190,8 +192,9 @@ public class Controller
@Override
public void handle(MouseEvent event)
{
if(game.isRunning() && game.getCurrentPlayer() == 1 && !game.isShowingInfo())
if(game.isRunning() && game.getCurrentPlayer() == 1 && !game.isShowingInfo() && !playerHasDrawn)
{
playerHasDrawn = true;
Card drawedCard = game.getDeck().drawCard(game.getDeadDeck());
ArrayList<Card> allCards = new ArrayList<Card>();
allCards.add(drawedCard);
......@@ -637,6 +640,7 @@ public class Controller
game.getPlayer().drawCard(cards.get(drawCounter));
setPlayerDeck(game.getPlayer().getDeck());
drawCounter++;
playerHasDrawn = false;
if(drawCounter < cards.size())
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment