aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Jordan <zxjordan5@gmail.com>2023-06-05 08:38:37 -0400
committerZach Jordan <zxjordan5@gmail.com>2023-06-05 08:38:37 -0400
commit0208dbcecb7c60a18e9c87d07e405dbb3b53fd23 (patch)
tree5ee377fe25098f377765b4d126989c79978b9970
parentb6826c6ba281366efc60e89d73d3b6f81d4f2b80 (diff)
parentc0e5adb06fa5076ae1f024f004605f7f4e442957 (diff)
downloadNPEhero-0208dbcecb7c60a18e9c87d07e405dbb3b53fd23.tar.gz
NPEhero-0208dbcecb7c60a18e9c87d07e405dbb3b53fd23.tar.bz2
NPEhero-0208dbcecb7c60a18e9c87d07e405dbb3b53fd23.zip
Merge branch 'main' of https://gitlab.sowgro.net/guitarheros/guitarhero
-rw-r--r--levels/Galway Girl/Hard/notes.txt2
-rw-r--r--levels/Take On Me/Medium/leaderboard.json1
-rw-r--r--levels/Take On Me/Medium/metadata.json1
-rw-r--r--levels/Take On Me/Medium/notes.txt48
-rw-r--r--levels/Take On Me/background.pngbin0 -> 129919 bytes
-rw-r--r--levels/Take On Me/metadata.json1
-rw-r--r--src/gameplay/SongPlayer.java15
7 files changed, 64 insertions, 4 deletions
diff --git a/levels/Galway Girl/Hard/notes.txt b/levels/Galway Girl/Hard/notes.txt
index 3bb3876..c5522e2 100644
--- a/levels/Galway Girl/Hard/notes.txt
+++ b/levels/Galway Girl/Hard/notes.txt
@@ -1,4 +1,4 @@
-s4.1
+s4.0
f5.6
j5.6
s6.6
diff --git a/levels/Take On Me/Medium/leaderboard.json b/levels/Take On Me/Medium/leaderboard.json
new file mode 100644
index 0000000..0637a08
--- /dev/null
+++ b/levels/Take On Me/Medium/leaderboard.json
@@ -0,0 +1 @@
+[] \ No newline at end of file
diff --git a/levels/Take On Me/Medium/metadata.json b/levels/Take On Me/Medium/metadata.json
new file mode 100644
index 0000000..3a4a1f0
--- /dev/null
+++ b/levels/Take On Me/Medium/metadata.json
@@ -0,0 +1 @@
+{"numBeats":75,"title":"Medium","bpm":170.0} \ No newline at end of file
diff --git a/levels/Take On Me/Medium/notes.txt b/levels/Take On Me/Medium/notes.txt
new file mode 100644
index 0000000..b15a005
--- /dev/null
+++ b/levels/Take On Me/Medium/notes.txt
@@ -0,0 +1,48 @@
+s4.0
+f5.0
+j5.0
+s6.0
+j7.0
+f7.0
+s8.1
+k9.1
+d9.5
+s10.1
+j11.1
+f11.1
+s12.1
+k13.1
+d13.1
+s14.1
+f15.1
+j15.1
+s16.2
+j17.2
+d17.6
+s18.1
+k19.1
+f19.1
+s20.0
+d21.0
+j21.0
+s22.5
+j23.1
+f23.2
+s24.2
+k25.2
+d25.8
+j26.2
+f26.7
+k27.2
+k28.7
+d29.2
+j29.7
+f30.1
+s30.6
+j31.1
+s33.2
+f34.2
+j34.3
+s37.1
+j38.2
+f38.2
diff --git a/levels/Take On Me/background.png b/levels/Take On Me/background.png
new file mode 100644
index 0000000..99a1e7a
--- /dev/null
+++ b/levels/Take On Me/background.png
Binary files differ
diff --git a/levels/Take On Me/metadata.json b/levels/Take On Me/metadata.json
new file mode 100644
index 0000000..540fcb1
--- /dev/null
+++ b/levels/Take On Me/metadata.json
@@ -0,0 +1 @@
+{"color1":"0x4d4d4dff","color2":"0x999999ff","artist":"A-ha","title":"Take On Me","color5":"0x4d4d4dff","color3":"0xe6e6e6ff","desc":"No description","color4":"0x999999ff"} \ No newline at end of file
diff --git a/src/gameplay/SongPlayer.java b/src/gameplay/SongPlayer.java
index 3e465bd..13b2b72 100644
--- a/src/gameplay/SongPlayer.java
+++ b/src/gameplay/SongPlayer.java
@@ -44,6 +44,9 @@ public class SongPlayer extends Pane {
private Double 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
+ private File song;
+ private boolean songIsPlaying = false;
+
private main.Level level;
private Difficulty difficulty;
private Pane pane;
@@ -107,8 +110,8 @@ public class SongPlayer extends Pane {
}
public SongPlayer(main.Level lvl, Difficulty d, Pane p, ScoreController cntrl) {
-
- Driver.soundController.playSong(lvl.song);
+ Driver.soundController.endSong();
+ song = lvl.song;
if (lvl.background != null) {
Driver.setBackground(lvl.background.getUrl());
@@ -162,6 +165,9 @@ public class SongPlayer extends Pane {
if (e.getCode() == KeyCode.K) {
checkNote(kLane, kButton);
}
+ if (e.getCode() == KeyCode.Q) {
+ System.out.println("" + timer.time());
+ }
//prints the user's current score and combo, for debugging purposes
//System.out.println("Score: " + scoreCounter.getScore() + "\nCombo: " + scoreCounter.getCombo() + "\n");
});
@@ -252,7 +258,9 @@ public class SongPlayer extends Pane {
gui.Driver.setMenu(new GameOver(level, difficulty, pane, scoreCounter.getScore()));
cancel();
}
- if (timer.time() > 0.0) {
+ if (!songIsPlaying && timer.time() > 0.0) {
+ songIsPlaying = true;
+ Driver.soundController.playSong(song);
}
}
};
@@ -270,6 +278,7 @@ public class SongPlayer extends Pane {
* @throws UnsupportedAudioFileException
*/
public void cancel() {
+ Driver.soundController.playMenuSong();
gui.Driver.setBackground("assets/forest.png");
gameLoop.stop();
Driver.soundController.endSong();