aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2023-05-21 00:45:19 -0400
committersowgro <tpoke.ferrari@gmail.com>2023-05-21 00:45:19 -0400
commitf49a73c6af7445bb4ae92fcab87e13abba527048 (patch)
tree218b7b8c6d64ccd54015d3d47921cb04e11ef503 /src/main
parent7c106e7dda744e7d3782737262601de693db0dca (diff)
downloadNPEhero-f49a73c6af7445bb4ae92fcab87e13abba527048.tar.gz
NPEhero-f49a73c6af7445bb4ae92fcab87e13abba527048.tar.bz2
NPEhero-f49a73c6af7445bb4ae92fcab87e13abba527048.zip
add ui scrollbars, game over menu, new font
Diffstat (limited to 'src/main')
-rw-r--r--src/main/LeaderboardController.java5
-rw-r--r--src/main/LevelController.java2
-rw-r--r--src/main/SettingsController.java61
3 files changed, 61 insertions, 7 deletions
diff --git a/src/main/LeaderboardController.java b/src/main/LeaderboardController.java
new file mode 100644
index 0000000..b48f103
--- /dev/null
+++ b/src/main/LeaderboardController.java
@@ -0,0 +1,5 @@
+package main;
+
+public class LeaderboardController {
+
+}
diff --git a/src/main/LevelController.java b/src/main/LevelController.java
index 6dec953..6d2f5dc 100644
--- a/src/main/LevelController.java
+++ b/src/main/LevelController.java
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
+import javafx.scene.image.Image;
import javafx.scene.paint.Color;
public class LevelController
@@ -31,6 +32,7 @@ public class LevelController
testLevel2.diffList.add("Easy");
testLevel2.diffList.add("Med");
testLevel2.diffList.add("insane+++");
+ testLevel2.preview = new Image("assets/pico.png");
levelList.add(testLevel2);
}
diff --git a/src/main/SettingsController.java b/src/main/SettingsController.java
index 79fb560..66da588 100644
--- a/src/main/SettingsController.java
+++ b/src/main/SettingsController.java
@@ -1,7 +1,54 @@
-// coming soon
-// needs to have getters and setters for:
-// - sfx vol
-// - music vol
-// - full screen
-//
-// perhaps use public variables instead of getters and setters \ No newline at end of file
+package gui;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.io.FileWriter;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+
+import org.json.simple.JSONObject;
+import org.json.simple.JSONArray;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+
+public class SettingsController
+{
+ private int effectsVol;
+ private int musicVol;
+ private boolean fullscreen;
+ private JSONObject settings;
+
+ public void saveAndWrite(int newEffVol, int newMusVol, boolean isFull)
+ {
+
+ }
+
+ public void readFile() throws ParseException
+ {
+ JSONParser jsonParser = new JSONParser(); //parser to read the file
+
+ try(FileReader reader = new FileReader("settings.json"))
+ {
+ Object obj = jsonParser.parse(reader);
+
+ settings = (JSONObject)(obj); //converts read object to a JSONObject
+
+ effectsVol = (int) settings.get("effectsVol");
+ musicVol = (int) settings.get("musicVol");
+ fullscreen = (boolean) settings.get("fullscreen");
+ }
+ catch (FileNotFoundException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ catch (IOException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+}