Skip to content
Snippets Groups Projects
Commit aa36a5a5 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

fixed vbox lives

parent 7fc7eadf
Branches
Tags
No related merge requests found
......@@ -248,6 +248,8 @@ public class LevelController
vboxPowerUps.setStyle("-fx-border-color: #333333; -fx-border-width: 2px;");
vboxLives.setStyle("-fx-border-color: #333333; -fx-border-width: 2px;");
vboxLives.setPadding(new Insets(3));
vboxLives.setAlignment(Pos.BOTTOM_CENTER);
vboxLives.setSpacing(9);
anchorPaneGame.setPadding(new Insets(0));
......@@ -479,21 +481,6 @@ public class LevelController
}
}
}
// DEBUG is this neccessary? --> slows done fps on mac
// long sleepTime = (previousTime - System.nanoTime() + OPTIMAL_TIME) / 1000000;
// if(sleepTime > 0)
// {
// try
// {
// Thread.sleep(sleepTime);
// }
// catch(Exception e)
// {
// e.printStackTrace();
// }
// }
}
};
}
......@@ -581,36 +568,12 @@ public class LevelController
{
vboxLives.getChildren().clear();
for(int i = 0; i < MAX_LIVES - game.getLivesRemaining() + 1; i++)
{
ImageView iv = new ImageView(new Image("de/bricked/resources/textures/bricks/empty.png"));
iv.setFitWidth(30);
iv.setFitHeight(120 / MAX_LIVES);
vboxLives.getChildren().add(iv);
if(i > 0)
{
VBox.setMargin(iv, new Insets(9, 0, 0, 0));
}
}
for(int i = 0; i < game.getLivesRemaining() - 1; i++)
{
ImageView iv = new ImageView(new Image("de/bricked/resources/textures/paddle/paddle-extra-small.png"));
iv.setFitWidth(30);
iv.setFitHeight(120 / MAX_LIVES);
vboxLives.getChildren().add(iv);
if(game.getLivesRemaining() == MAX_LIVES)
{
if(i > 0)
{
VBox.setMargin(iv, new Insets(9, 0, 0, 0));
}
}
else
{
VBox.setMargin(iv, new Insets(4, 0, 0, 0));
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment