Minor improvements
This commit is contained in:
@@ -18,7 +18,7 @@ public class AcousticHandler {
|
||||
|
||||
private boolean fading = false; // Indicates if a fade is in progress
|
||||
private NanoTimer fadeTimer = new NanoTimer(); // Timer to track fade progress
|
||||
private static final float FADE_DURATION = 3.0f; // Duration for outfade
|
||||
private static final float FADE_DURATION = 2.0f; // Duration for outfade
|
||||
private static final float CROSSFADE_DURATION = 1.5f; // Duration for infade
|
||||
private GameMusic playing = null; // Currently playing track
|
||||
private GameMusic scheduled = null; // Scheduled track to play next
|
||||
@@ -161,6 +161,8 @@ public void playState(MdgaState state) {
|
||||
|
||||
birds.pause();
|
||||
|
||||
float pause = 0.0f;
|
||||
|
||||
switch (state) {
|
||||
case MAIN:
|
||||
playGame = false;
|
||||
@@ -176,6 +178,7 @@ public void playState(MdgaState state) {
|
||||
playGame = true;
|
||||
assert (!gameTracks.isEmpty()) : "no more game music available";
|
||||
asset = gameTracks.remove(0);
|
||||
pause = 2.0f;
|
||||
break;
|
||||
case CEREMONY:
|
||||
playGame = false;
|
||||
@@ -187,7 +190,7 @@ public void playState(MdgaState state) {
|
||||
|
||||
assert (null != asset) : "music sceduling went wrong";
|
||||
|
||||
scheduled = new GameMusic(app, asset, getMusicVolumeTotal(), asset.getSubVolume(), asset.getLoop(), 0.0f);
|
||||
scheduled = new GameMusic(app, asset, getMusicVolumeTotal(), asset.getSubVolume(), asset.getLoop(), pause);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -258,12 +261,6 @@ private void updateVolumeAndTrack() {
|
||||
} else if (playing != null) {
|
||||
// Update volume for the currently playing track
|
||||
playing.update(getMusicVolumeTotal());
|
||||
} else if (scheduled != null) {
|
||||
// If no track is playing and one is scheduled, start it immediately at full volume
|
||||
playing = scheduled;
|
||||
scheduled = null;
|
||||
playing.play();
|
||||
playing.update(getMusicVolumeTotal()); // Set volume to full
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,7 +460,7 @@ public void setSoundVolume(float soundVolume) {
|
||||
*/
|
||||
float getMusicVolumeTotal() {
|
||||
|
||||
return getMusicVolume() * getMainVolume();
|
||||
return getMusicVolume() * getMainVolume() / 2;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,12 +10,12 @@ enum MusicAsset {
|
||||
MAIN_MENU("Spaceship.wav", true, 1.0f),
|
||||
LOBBY("DeadPlanet.wav", true, 1.0f),
|
||||
CEREMONY("80s,Disco,Life.wav", true, 1.0f),
|
||||
GAME_1("NeonRoadTrip.wav", 1.0f),
|
||||
GAME_2("NoPressureTrance.wav", 1.0f),
|
||||
GAME_3("TheSynthRave.wav", 1.0f),
|
||||
GAME_4("LaserParty.wav", 1.0f),
|
||||
GAME_5("RetroNoir.wav", 1.0f),
|
||||
GAME_6("SpaceInvaders.wav", 1.0f),
|
||||
GAME_1("NeonRoadTrip.wav", 0.5f),
|
||||
GAME_2("NoPressureTrance.wav", 0.5f),
|
||||
GAME_3("TheSynthRave.wav", 0.5f),
|
||||
GAME_4("LaserParty.wav", 0.5f),
|
||||
GAME_5("RetroNoir.wav", 0.5f),
|
||||
GAME_6("SpaceInvaders.wav", 0.5f),
|
||||
BIRDS("nature-ambience.ogg", true, 1.0f);
|
||||
|
||||
private final String path;
|
||||
|
||||
@@ -231,7 +231,7 @@ public String getName() {
|
||||
"FluffiKopf",
|
||||
"DonutDöner",
|
||||
"VollpfostenX",
|
||||
"Schraubenschlüssel",
|
||||
"Waschlappen",
|
||||
"Witzepumper",
|
||||
"ToastTraum",
|
||||
"FroschFighter",
|
||||
@@ -288,22 +288,22 @@ public String getName() {
|
||||
"VulkanKeks",
|
||||
"WasserToast",
|
||||
"MenschSalat",
|
||||
"KampfKohlenhydrate",
|
||||
"KampfKohl",
|
||||
"SockenZirkus",
|
||||
"SchwimmBärchen",
|
||||
"TanzenderDachgepäckträger",
|
||||
"TanzenderPudel",
|
||||
"PizzamarktMensch",
|
||||
"ZahnarztZocker",
|
||||
"RollerCoasterTester",
|
||||
"WaschmaschinenPilot",
|
||||
"RollerRudi",
|
||||
"PupsPilot",
|
||||
"WitzigeZwiebel",
|
||||
"Pillenschlucker",
|
||||
"ZwiebelReiter",
|
||||
"HüpfenderKaktus",
|
||||
"KochenderAsteroid",
|
||||
"AsteroidenAlf",
|
||||
"ChaosKarotte",
|
||||
"WolkenFurz",
|
||||
"SchnitzelPartikel",
|
||||
"Krümelmonster",
|
||||
"WackelBiene",
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user