Skip to content

Commit

Permalink
Improve JukeBoxTest
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias <[email protected]>
  • Loading branch information
Hangman committed Sep 2, 2023
1 parent c68eb5e commit 180ddbc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/src/test/java/de/pottgames/tuningfork/test/JukeBoxTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ public void create() {
this.rhythm2Source = this.audio.obtainSource(this.rhythm2);
this.rhythm4Source = this.audio.obtainSource(this.rhythm4);

// OPTIONAL: SET RELATIVE
// if you want to play music globally and not in 3D space, make sure to only provide relative sources
this.rhythm1.setRelative(true);
this.rhythm3.setRelative(true);
this.rhythm5.setRelative(true);
this.rhythm2Source.setRelative(true);
this.rhythm4Source.setRelative(true);

// CREATE SONGS
final SongSettings settings = SongSettings.linear(1f, 2f, 2f);
final Song song1 = new Song(this.rhythm1, SongSettings.linear(1f, 0.5f, 1f), new SongMeta().setTitle("rhythm1"));
Expand Down Expand Up @@ -116,6 +124,9 @@ public void render() {
if (Gdx.input.isKeyJustPressed(Input.Keys.K)) {
this.jukeBox.softStopAndResume(Interpolation.linear, 2f);
}
if (Gdx.input.isKeyJustPressed(Input.Keys.U)) {
this.audio.getListener().setPosition(100f, 0f, 0f);
}

this.jukeBox.update();
}
Expand Down

0 comments on commit 180ddbc

Please sign in to comment.