Skip to content

Commit

Permalink
Fix walking sound effect volume
Browse files Browse the repository at this point in the history
  • Loading branch information
PomeloBranco committed May 22, 2023
1 parent c27224f commit a458b37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ public PlayerController(LevelContainer levelContainer, GameSetting setting) {
stateMachine = new DefaultStateMachine<>(this, PlayerState.IDLE);
attackHandler = new PlayerAttackHandler(player, player.getAttackHitbox(), dash_sound);
allocateReady = false;
isWalkGrassPlaying = false;
isDashPlaying = false;
this.setting = setting;
}

Expand Down Expand Up @@ -288,7 +290,7 @@ public void collectMoonlight() {
* @param lightingController lighting controller to update moonlight particles
*/
public void resolveMoonlight(LightingController lightingController) {
if (player.isCollecting || player.isAttacked()) return;
if (player.isCollecting) return;
boolean isOn = false;

// Check if player is within range of a lamp
Expand Down
6 changes: 3 additions & 3 deletions core/src/infinityx/lunarhaze/controllers/PlayerState.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ public void update(PlayerController entity) {
if (direction == Direction.DOWN) {
// special case
if (frame == 0 || frame == 4) {
entity.walk_sound.play();
entity.walk_sound.play(entity.getSetting().getSoundVolume());
}
} else {
if (frame == 2 || frame == 5) {
entity.walk_sound.play();
entity.walk_sound.play(entity.getSetting().getSoundVolume());
}
}
} else {
if (frame == 0 || frame == 2) {
entity.walk_sound.play();
entity.walk_sound.play(entity.getSetting().getSoundVolume());
}
}
}
Expand Down

0 comments on commit a458b37

Please sign in to comment.