diff options
author | Aidan Ross <aross02@fairport.org> | 2023-05-30 08:47:05 -0400 |
---|---|---|
committer | Aidan Ross <aross02@fairport.org> | 2023-05-30 08:47:05 -0400 |
commit | 0b7a23fc35acc1059654fd1df0505b2b10429dda (patch) | |
tree | 3fcfc10d07d4e4fc943f3c7dacb501e62f9fdcbf /src | |
parent | 864cc31d4672a77bb6f0adc0906a66b9f0c4ff15 (diff) | |
parent | d283ab67988fe1c7f63b27c70077d3b599171d07 (diff) | |
download | NPEhero-0b7a23fc35acc1059654fd1df0505b2b10429dda.tar.gz NPEhero-0b7a23fc35acc1059654fd1df0505b2b10429dda.tar.bz2 NPEhero-0b7a23fc35acc1059654fd1df0505b2b10429dda.zip |
Merge branch 'main' of https://gitlab.sowgro.net/guitarheros/guitarhero
Diffstat (limited to 'src')
-rw-r--r-- | src/gameplay/SongPlayer.java | 4 | ||||
-rw-r--r-- | src/main/Difficulty.java | 2 | ||||
-rw-r--r-- | src/main/Level.java | 27 | ||||
-rw-r--r-- | src/main/LevelController.java | 4 |
4 files changed, 34 insertions, 3 deletions
diff --git a/src/gameplay/SongPlayer.java b/src/gameplay/SongPlayer.java index 671fad9..7ea6bfa 100644 --- a/src/gameplay/SongPlayer.java +++ b/src/gameplay/SongPlayer.java @@ -37,6 +37,10 @@ import sound.AudioFilePlayer; // gui.Driver.setMenu(new GameOver(lvl, d, p, cntrl.getScore())); +//d.numBeats - int +//d.song - File + + public class SongPlayer extends Pane { private int bpm; //initializes the bpm of the song, to be read in from a metadata file later private int songLength; //initializes the length of the song in terms of the song's bpm, to be read in later diff --git a/src/main/Difficulty.java b/src/main/Difficulty.java index 7955698..24480e4 100644 --- a/src/main/Difficulty.java +++ b/src/main/Difficulty.java @@ -11,6 +11,8 @@ public class Difficulty private ObservableList<LeaderboardEntry> leaderboard = FXCollections.observableArrayList(); public File notes; public int bpm; + public File song; + public int numBeats; public void parseMetadata(File file) { //hi zach put json reader stuff here diff --git a/src/main/Level.java b/src/main/Level.java index 2e97367..66fe243 100644 --- a/src/main/Level.java +++ b/src/main/Level.java @@ -21,7 +21,12 @@ public class Level public ArrayList<Difficulty> diffList = new ArrayList<Difficulty>(); public Image background; //optional - public Color[] colors = new Color[]{Color.RED,Color.BLUE,Color.GREEN,Color.PURPLE,Color.YELLOW};//optional, have default colors + public Color[] colors;//optional, have default colors + public Color c1; + public Color c2; + public Color c3; + public Color c4; + public Color c5; private JSONObject levelStuff; @@ -54,9 +59,25 @@ public class Level artist = (String)(levelStuff.get("artist")); desc = (String)(levelStuff.get("desc")); - if(( levelStuff).containsKey("color1")) + if(( levelStuff).containsKey("color1")) //check for custom colors in a hexadecimal format { - + colors = new Color[5]; + + c1 = Color.web((String)(levelStuff.get("color1"))); //read in all the custom colors + c2 = Color.web((String)(levelStuff.get("color2"))); + c3 = Color.web((String)(levelStuff.get("color3"))); + c4 = Color.web((String)(levelStuff.get("color4"))); + c5 = Color.web((String)(levelStuff.get("color5"))); + + colors[0] = c1; + colors[1] = c2; + colors[2] = c3; + colors[3] = c4; + colors[4] = c5; + } + else + { + colors = new Color[]{Color.RED,Color.BLUE,Color.GREEN,Color.PURPLE,Color.YELLOW}; } } catch (FileNotFoundException e) diff --git a/src/main/LevelController.java b/src/main/LevelController.java index f4d7587..faa5bf4 100644 --- a/src/main/LevelController.java +++ b/src/main/LevelController.java @@ -33,6 +33,10 @@ public class LevelController { diff.notes = curFileInCurDiff; } + if (curFileInCurDiff.getName().equals("song.wav")) + { + diff.song = curFileInCurDiff; + } } level.diffList.add(diff); } |