Added initial sound effect support.

- Added SoundController module, which uses Java Sound since OpenAL has a slight delay on playing sounds.
- Uploaded all effect WAVs. (credits: WWWskin, AL's IA, Fantasy's Skin, Minimalist Miku)
- Added a missing entry in credits.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2014-07-01 01:14:03 -04:00
parent 60eaa42997
commit 0604a25822
54 changed files with 500 additions and 61 deletions

View File

@@ -21,6 +21,7 @@ package itdelatrisu.opsu.objects;
import itdelatrisu.opsu.GameScore;
import itdelatrisu.opsu.MusicController;
import itdelatrisu.opsu.OsuHitObject;
import itdelatrisu.opsu.SoundController;
import itdelatrisu.opsu.states.Game;
import itdelatrisu.opsu.states.Options;
@@ -163,16 +164,19 @@ public class Spinner {
int result;
float ratio = rotations / rotationsNeeded;
if (ratio >= 1.0f ||
Options.isModActive(Options.MOD_AUTO) || Options.isModActive(Options.MOD_SPUN_OUT))
Options.isModActive(Options.MOD_AUTO) ||
Options.isModActive(Options.MOD_SPUN_OUT)) {
result = GameScore.HIT_300;
else if (ratio >= 0.8f)
SoundController.playSound(SoundController.SOUND_SPINNEROSU);
} else if (ratio >= 0.8f)
result = GameScore.HIT_100;
else if (ratio >= 0.5f)
result = GameScore.HIT_50;
else
result = GameScore.HIT_MISS;
score.hitResult(hitObject.endTime, result, width / 2, height / 2, Color.transparent, true);
score.hitResult(hitObject.endTime, result, width / 2, height / 2,
Color.transparent, true, (byte) -1);
return result;
}
@@ -240,10 +244,13 @@ public class Spinner {
// added one whole rotation...
if (Math.floor(newRotations) > rotations) {
if (newRotations > rotationsNeeded) // extra rotations
if (newRotations > rotationsNeeded) { // extra rotations
score.changeScore(1000);
else
SoundController.playSound(SoundController.SOUND_SPINNERBONUS);
} else {
score.changeScore(100);
SoundController.playSound(SoundController.SOUND_SPINNERSPIN);
}
}
rotations = newRotations;