diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2024-07-14 03:40:03 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2024-07-14 03:40:03 -0400 |
commit | 550701557c1e021e45bddff92ad1a2e8c808e8e0 (patch) | |
tree | 219c5979d3b30843b88336ae755dd8e45a1e5471 /src/main/java/net/sowgro/npehero/gameplay/Block.java | |
parent | cf8f3d35716cd93d0d5d123d80b07f9ae704f939 (diff) | |
download | NPEhero-550701557c1e021e45bddff92ad1a2e8c808e8e0.tar.gz NPEhero-550701557c1e021e45bddff92ad1a2e8c808e8e0.tar.bz2 NPEhero-550701557c1e021e45bddff92ad1a2e8c808e8e0.zip |
NEW LEVEL EDITOR!!!!
Diffstat (limited to 'src/main/java/net/sowgro/npehero/gameplay/Block.java')
-rwxr-xr-x | src/main/java/net/sowgro/npehero/gameplay/Block.java | 37 |
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 |