Make music pitch and speed go down on fail (like in osu!)

This commit is contained in:
MatteoS
2015-11-16 14:30:49 +01:00
parent 06c423a4dd
commit 13e0bdb81e
3 changed files with 59 additions and 4 deletions

View File

@@ -237,6 +237,15 @@ public class MusicController {
player.fade(duration, 0f, true);
}
/**
* Fades out the pitch (and speed) of the track.
* @param duration the pitch fade time (in ms)
*/
public static void pitchFadeOut(int duration) {
if (isPlaying())
player.pitchFade(duration, 0f);
}
/**
* Returns the position in the current track, in milliseconds.
* If no track is loaded, 0 will be returned.
@@ -316,7 +325,7 @@ public class MusicController {
* @param pitch the new pitch
*/
public static void setPitch(float pitch) {
SoundStore.get().setMusicPitch(pitch);
player.setPitch(pitch);
}
/**
@@ -464,4 +473,4 @@ public class MusicController {
ErrorHandler.error("Failed to destroy OpenAL.", e, true);
}
}
}
}