Implemented volume-bg and master volume setting.

- All sounds are now multiplied by a master volume setting.
- Changed all default volume levels.
- Scrolling in the main menu and game states changes the master volume and displays a volume bar on the right side of the screen.
- "volume-bg.png" image by @kouyang.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-01-20 14:52:02 -05:00
parent f9c0794693
commit 3b13cc794b
12 changed files with 150 additions and 10 deletions

View File

@@ -421,6 +421,7 @@ public class Game extends BasicGameState {
cursorCirclePulse.drawCentered(pausedMouseX, pausedMouseY);
}
Utils.drawVolume(g);
Utils.drawFPS();
Utils.drawCursor();
}
@@ -429,6 +430,7 @@ public class Game extends BasicGameState {
public void update(GameContainer container, StateBasedGame game, int delta)
throws SlickException {
Utils.updateCursor(delta);
Utils.updateVolumeDisplay(delta);
int mouseX = input.getMouseX(), mouseY = input.getMouseY();
skipButton.hoverUpdate(delta, mouseX, mouseY);
@@ -707,6 +709,11 @@ public class Game extends BasicGameState {
hitObjects[objectIndex].mousePressed(x, y);
}
@Override
public void mouseWheelMoved(int newValue) {
Utils.changeVolume((newValue < 0) ? -1 : 1);
}
@Override
public void enter(GameContainer container, StateBasedGame game)
throws SlickException {