Added configurable game key bindings.

- Game keys (default Z/X) can be changed to any letter or digit in the options screen.

Other changes:
- Mouse/keyboard input in the "Game Paused Menu" state is now the same as in the game state (i.e. all game keys available).
- Moved 'isInputKeyPressed()' into "Utils" class ("Game" state didn't even call it).
- Trimmed 'failsound.wav'.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2014-07-17 23:58:37 -04:00
parent b0c0b44ef1
commit edf40e11fd
7 changed files with 150 additions and 39 deletions

View File

@@ -532,7 +532,7 @@ public class Slider {
ticksHit++;
// check if cursor pressed and within end circle
else if (game.isInputKeyPressed()) {
else if (Utils.isGameKeyPressed()) {
double distance = Math.hypot(hitObject.sliderX[lastIndex] - mouseX, hitObject.sliderY[lastIndex] - mouseY);
int followCircleRadius = GameImage.SLIDER_FOLLOWCIRCLE.getImage().getWidth() / 2;
if (distance < followCircleRadius)
@@ -572,7 +572,7 @@ public class Slider {
float[] c = bezier.pointAt(getT(trackPosition, false));
double distance = Math.hypot(c[0] - mouseX, c[1] - mouseY);
int followCircleRadius = GameImage.SLIDER_FOLLOWCIRCLE.getImage().getWidth() / 2;
if ((game.isInputKeyPressed() && distance < followCircleRadius) || isAutoMod) {
if ((Utils.isGameKeyPressed() && distance < followCircleRadius) || isAutoMod) {
// mouse pressed and within follow circle
followCircleActive = true;
score.changeHealth(delta * GameScore.HP_DRAIN_MULTIPLIER);

View File

@@ -47,11 +47,6 @@ public class Spinner {
*/
private OsuHitObject hitObject;
/**
* The associated Game object.
*/
private Game game;
/**
* The associated GameScore object.
*/
@@ -95,7 +90,6 @@ public class Spinner {
*/
public Spinner(OsuHitObject hitObject, Game game, GameScore score) {
this.hitObject = hitObject;
this.game = game;
this.score = score;
// calculate rotations needed
@@ -202,7 +196,7 @@ public class Spinner {
}
// not spinning: nothing to do
if (!game.isInputKeyPressed()) {
if (!Utils.isGameKeyPressed()) {
lastAngle = -1f;
return false;
}