summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-02-22 18:23:02 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-02-22 18:23:02 +0100
commit18db2f47e4808eda33f24e1a8571f62344524f71 (patch)
tree8a25ed7261dedb9ded9b7f77dc91e5365f50efba /core/src/ch/asynk/rustanddust/game
parent6ec6e479d1fb91c51c65fecee9045c07fa92300d (diff)
downloadRustAndDust-18db2f47e4808eda33f24e1a8571f62344524f71.zip
RustAndDust-18db2f47e4808eda33f24e1a8571f62344524f71.tar.gz
Sound type/enter: nicer, better
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Hud.java20
-rw-r--r--core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java10
2 files changed, 20 insertions, 10 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Hud.java b/core/src/ch/asynk/rustanddust/game/Hud.java
index e59cae2..56b76dd 100644
--- a/core/src/ch/asynk/rustanddust/game/Hud.java
+++ b/core/src/ch/asynk/rustanddust/game/Hud.java
@@ -67,7 +67,7 @@ public class Hud implements Disposable, Animation
actionButtons = new ActionButtons(game);
actionButtons.hide();
msg = new Msg(game.font, game.bgPatch, 20f);
- okCancel = new OkCancel(game.font, game.bgPatch, game.factory.getHudRegion(game.factory.ACT_DONE), game.factory.getHudRegion(game.factory.ACT_ABORT), game.typeSnd);
+ okCancel = new OkCancel(game.font, game.bgPatch, game.factory.getHudRegion(game.factory.ACT_DONE), game.factory.getHudRegion(game.factory.ACT_ABORT));
optionsBtn = new Bg(game.factory.getHudRegion(game.factory.ACT_OPTIONS));
optionsPanel = new OptionsPanel(game);
stats = new StatisticsPanel(game);
@@ -185,7 +185,7 @@ public class Hud implements Disposable, Animation
public boolean hit(float x, float y, boolean isInAnimation)
{
if (optionsBtn.hit(x, y)) {
- game.typeSnd.play();
+ game.playType();
toggleOptionsPanel();
return true;
}
@@ -202,10 +202,13 @@ public class Hud implements Disposable, Animation
if (isInAnimation)
return false;
- if (actionButtons.hit(x, y))
+ if (actionButtons.hit(x, y)) {
+ game.playType();
return true;
- else if (playerInfo.hit(x, y))
+ } else if (playerInfo.hit(x, y)) {
+ game.playType();
return true;
+ }
return false;
}
@@ -217,7 +220,10 @@ public class Hud implements Disposable, Animation
if (dialog == okCancel)
closeOkCancel();
- else if (dialog == stats)
+ else
+ game.playType();
+
+ if (dialog == stats)
ctrl.endGame();
if (dialogs.size() > 0)
@@ -229,6 +235,10 @@ public class Hud implements Disposable, Animation
private void closeOkCancel()
{
boolean ok = okCancel.ok;
+ if (ok)
+ game.playEnter();
+ else
+ game.playType();
switch(okCancelAction) {
case EXIT_BOARD:
diff --git a/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java b/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java
index ea175c9..ba0f395 100644
--- a/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java
+++ b/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java
@@ -139,7 +139,7 @@ public class OptionsPanel extends Patch
public boolean hit(float x, float y)
{
if (objectivesPanel.hit(x, y)) {
- game.typeSnd.play();
+ game.playType();
objectivesPanel.visible = false;
this.visible = true;
return false;
@@ -148,21 +148,21 @@ public class OptionsPanel extends Patch
if (!visible) return false;
if (fxVolume.hit(x, y) || fxVolumeValue.hit(x, y)) {
- game.typeSnd.play();
cycleFxVolume();
+ game.playType((fxVolumeIdx / 10.0f));
} else if (quit.hit(x, y)) {
- game.typeSnd.play();
+ game.playType();
game.ctrl.hud.askQuitBattle();
return false;
} else if (objectives.hit(x, y)) {
- game.typeSnd.play();
+ game.playType();
this.visible = false;
objectivesPanel.show(game.config.battle);
return false;
} else {
for (int i = 0; i < checkLabels.length; i++) {
if (checkLabels[i].hit(x, y)) {
- game.typeSnd.play();
+ game.playType();
checkValues[i] =! checkValues[i];
}
}