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

set ball colors

parent 6d0f37b4
No related branches found
No related tags found
No related merge requests found
......@@ -2,19 +2,19 @@ package de.bricked.game.balls;
public enum BallType
{
NORMAL("N", "normal", 10, 4),
EXPLOSIVE("A","explosive", 10, 6),
NO_COLLISION("S","no_collision", 10, 8);
NORMAL("N", "#9CD8FF", 10, 4),
EXPLOSIVE("A","#CC2E2E", 10, 6),
NO_COLLISION("S","#2828CC", 10, 8);
private String ID;
private String textureID;
private String color;
private double radius;
private double speedFactor;
private BallType(String ID, String textureID, double radius, double speedFactor)
private BallType(String ID, String color, double radius, double speedFactor)
{
this.ID = ID;
this.textureID = textureID;
this.color = color;
this.radius = radius;
this.speedFactor = speedFactor;
}
......@@ -24,9 +24,9 @@ public enum BallType
return ID;
}
public String getTextureID()
public String getColor()
{
return textureID;
return color;
}
public double getRadius()
......
......@@ -607,10 +607,10 @@ public class LevelController
{
anchorPaneGame.getChildren().remove(stackPaneBall);
game.setBall(new Ball(BallType.NORMAL));
game.setBall(new Ball(BallType.NO_COLLISION));
// create circle for ball
final Circle circle = new Circle(game.getBall().getBallRadius(), Color.rgb(156, 216, 255));
final Circle circle = new Circle(game.getBall().getBallRadius(), Color.web(game.getBall().getType().getColor()));
circle.setEffect(new Lighting());
stackPaneBall = new StackPane();
stackPaneBall.getChildren().addAll(circle);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment