aboutsummaryrefslogtreecommitdiff
path: root/src/main/Level.java
diff options
context:
space:
mode:
authorAidan Ross <aross02@fairport.org>2023-05-25 16:31:51 -0400
committerAidan Ross <aross02@fairport.org>2023-05-25 16:31:51 -0400
commitb3f8d14e1af6277914e4a7c1c81082fb95f62d85 (patch)
tree81d8a8007fa1ac6a246ba093971c1beaeef717bf /src/main/Level.java
parentcb9076941d76b4395d19d30076481bfeea35cacb (diff)
downloadNPEhero-b3f8d14e1af6277914e4a7c1c81082fb95f62d85.tar.gz
NPEhero-b3f8d14e1af6277914e4a7c1c81082fb95f62d85.tar.bz2
NPEhero-b3f8d14e1af6277914e4a7c1c81082fb95f62d85.zip
the main.Level() class is now declared in levelcontroller with the name of the level being read in the assets folder, allowing for different songs in the list.
Diffstat (limited to '')
-rw-r--r--src/main/Level.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/Level.java b/src/main/Level.java
index eb8d60e..bf39af5 100644
--- a/src/main/Level.java
+++ b/src/main/Level.java
@@ -20,6 +20,7 @@ import org.json.simple.parser.ParseException;
public class Level
{
public Image preview; //optional
+ private String levelFolderName;
private String title;
private String artist;
public String desc;
@@ -36,11 +37,12 @@ public class Level
}
//all below is required for table view
- public Level()
+ public Level(String path)
{
+ levelFolderName = path;
JSONParser jsonParser = new JSONParser(); //parser to read the file
- try(FileReader reader = new FileReader("src/assets/levels/test level/metadata.json"))
+ try(FileReader reader = new FileReader("src/assets/levels/" + levelFolderName+ "/metadata.json"))
{
Object obj = jsonParser.parse(reader);