aboutsummaryrefslogtreecommitdiff
path: root/src/main/ScoreController.java
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2024-07-08 02:41:31 -0400
committersowgro <tpoke.ferrari@gmail.com>2024-07-08 02:41:31 -0400
commitee2229339429d50afa33e2f8b9c0ee0939766290 (patch)
treea5ee54bd23c24950e9b10815f3e87605906992d8 /src/main/ScoreController.java
parent9e1371424bdf4c31d756d686313730d4c61f7ac5 (diff)
downloadNPEhero-ee2229339429d50afa33e2f8b9c0ee0939766290.tar.gz
NPEhero-ee2229339429d50afa33e2f8b9c0ee0939766290.tar.bz2
NPEhero-ee2229339429d50afa33e2f8b9c0ee0939766290.zip
Change project structure, embed resources into jar and remove libraries from source control
Diffstat (limited to 'src/main/ScoreController.java')
-rw-r--r--src/main/ScoreController.java117
1 files changed, 0 insertions, 117 deletions
diff --git a/src/main/ScoreController.java b/src/main/ScoreController.java
deleted file mode 100644
index 066a0d1..0000000
--- a/src/main/ScoreController.java
+++ /dev/null
@@ -1,117 +0,0 @@
-package main;
-
-import gui.Driver;
-import javafx.beans.property.SimpleStringProperty;
-import javafx.beans.property.StringProperty;
-
-public class ScoreController{
-
- private int score = 0;
- private int combo = 0;
- private int comboMultiplier=1;
- public StringProperty scoreProperty = new SimpleStringProperty("0");
- public StringProperty comboProperty = new SimpleStringProperty("0");
-
- /**
- * Called when the user performs a perfect hit
- */
- public void perfect() {
- combo();
- score += 300*comboMultiplier;
- scoreProperty.setValue(score+"");
- comboProperty.setValue(combo +"");
- // System.out.println("Perfect!");
- }
-
- /**
- * called when the user performs an okay hit
- */
- public void good() {
- combo();
- score += 100*comboMultiplier;
- scoreProperty.setValue(score+"");
- comboProperty.setValue(combo+"");
- // System.out.println("Good");
- }
-
- /**
- * Called when the user misses a note
- */
- public void miss(boolean muted) {
- if (!muted) {
- Driver.soundController.playSfx("miss");
- }
- combo = 0;
- comboMultiplier = 1;
- scoreProperty.setValue(score+"");
- comboProperty.setValue(combo+"");
- // System.out.println("Miss");
- }
-
- /*
- * Increments the combo by one
- */
- private void combo() {
- Driver.soundController.playSfx("hit");
- combo++;
-
- if (combo == 2) {
- comboMultiplier = 2;
- }
-
- if (combo == 4) {
- comboMultiplier = 4;
- }
-
- if (combo == 8) {
- comboMultiplier = 8;
- }
- }
-
- /**
- * @return current score
- */
- public int getScore()
- {
- return score;
- }
-
- /**
- * @return current combo
- */
- public int getCombo()
- {
- return combo;
- }
-
- /**
- * @param newScore: the score to be set, only used in debug
- */
- public void setScore(int newScore)
- {
- score = newScore;
- scoreProperty.setValue(newScore+"");
- }
-
- /**
- * @param newCombo: the combo to be set, only used in debug
- */
- public void setCombo(int newCombo)
- {
- combo = newCombo;
- comboProperty.setValue(newCombo+"");
- }
-
- /**
- * prints values into console
- */
- public void print()
- {
- System.out.println("--");
- System.out.println(combo);
- System.out.println(score);
- System.out.println("");
- System.out.println(scoreProperty);
- System.out.println(comboProperty);
- }
-}