From f941b529f1cb12312041516e6799ece0f6df2cac Mon Sep 17 00:00:00 2001 From: sowgro Date: Sun, 21 May 2023 17:12:06 -0400 Subject: add f11 fullscrn, comment gui, add scorecontroller --- src/main/ScoreController.java | 59 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/main/ScoreController.java (limited to 'src/main/ScoreController.java') diff --git a/src/main/ScoreController.java b/src/main/ScoreController.java new file mode 100644 index 0000000..a33c873 --- /dev/null +++ b/src/main/ScoreController.java @@ -0,0 +1,59 @@ +package main; + +import javafx.beans.property.SimpleStringProperty; +import javafx.beans.property.StringProperty; + +public class ScoreController{ + + int score = 0; + int combo = 0; + public StringProperty scoreProperty = new SimpleStringProperty("0"); + public StringProperty comboProperty = new SimpleStringProperty("0"); + + /** + * @return current score + */ + public int getScore() + { + return score; + } + + /** + * @return current combo + */ + public int getCombo() + { + return combo; + } + + /** + * @param newScore: the score to be set + */ + public void setScore(int newScore) + { + score = newScore; + scoreProperty.setValue(newScore+""); + } + + /** + * @param newCombo: the combo to be set + */ + 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); + } +} -- cgit v1.2.3