aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/net/sowgro/npehero/gameplay/Block.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/sowgro/npehero/gameplay/Block.java')
-rwxr-xr-xsrc/main/java/net/sowgro/npehero/gameplay/Block.java37
1 files changed, 28 insertions, 9 deletions
diff --git a/src/main/java/net/sowgro/npehero/gameplay/Block.java b/src/main/java/net/sowgro/npehero/gameplay/Block.java
index 5bc9d9c..c55a7bf 100755
--- a/src/main/java/net/sowgro/npehero/gameplay/Block.java
+++ b/src/main/java/net/sowgro/npehero/gameplay/Block.java
@@ -6,22 +6,41 @@ import javafx.scene.effect.BlurType;
import javafx.scene.effect.DropShadow;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
+import net.sowgro.npehero.main.Note;
+/**
+ * A block is a visual representation of a note on the screen. This is used both in the editor and in during the game play.
+ */
public class Block extends Rectangle
{
- public Block(Color c, double a, double b, int r)
+ public Color color;
+ public Note note;
+
+ public Block(Color color, double width, double height, int cornerRadius, boolean useDropShadow, Note note)
{
- super();
+ this.note = note;
+ this.color = color;
+
+ super.setFill(color);
+ super.setWidth(width);
+ super.setHeight(height);
+ super.setArcHeight(cornerRadius);
+ super.setArcWidth(cornerRadius);
+
+ if (useDropShadow) {
+ enableDropShadow();
+ }
+ }
+
+ public Block(Color color, double width, double height, int cornerRadius) {
+ this(color, width, height, cornerRadius, true, null);
+ }
+
+ public void enableDropShadow() {
DropShadow dropShadow = new DropShadow();
dropShadow.setRadius(200.0);
- dropShadow.setColor(c);
+ dropShadow.setColor(color);
dropShadow.setBlurType(BlurType.GAUSSIAN);
-
- super.setFill(c);
- super.setWidth(a);
- super.setHeight(b);
- super.setArcHeight(r);
- super.setArcWidth(r);
super.setEffect(dropShadow);
}
} \ No newline at end of file