fix(bow): removed pitch

This commit is contained in:
Laureηt 2021-05-27 11:45:03 +02:00
parent b0d3f0b930
commit 1b31744397

View file

@ -19,7 +19,7 @@ public class Bow extends Actor {
private boolean pressed = false; private boolean pressed = false;
private float angle; private float angle;
private Sound shotSound = private Sound shotSound =
Gdx.audio.newSound(Gdx.files.internal("sounds/effects/arrow_shot.mp3")); Gdx.audio.newSound(Gdx.files.internal("sounds/effects/arrow_shot_trim.mp3"));
private Vector2 anchor = new Vector2(); private Vector2 anchor = new Vector2();
private Vector2 aim = new Vector2(); private Vector2 aim = new Vector2();
@ -54,8 +54,7 @@ public class Bow extends Actor {
// Make a sound when an arrow is shot // Make a sound when an arrow is shot
if (!SagittariusGame.disableSounds) { if (!SagittariusGame.disableSounds) {
long shotid = shotSound.play(SagittariusGame.soundsVolume); shotSound.play(SagittariusGame.soundsVolume);
shotSound.setPitch(shotid, 1.5f);
} }
} else { } else {
pressed = false; pressed = false;
@ -71,7 +70,7 @@ public class Bow extends Actor {
shapes.line(this.anchor, GameScreen.worldCursor); shapes.line(this.anchor, GameScreen.worldCursor);
if (aimAssist) { if (aimAssist) {
Trajectory traj = Trajectory traj =
Arrow.computeTrajectory(angle, power, GameScreen.playerCurrent, 500, 0.03f); Arrow.computeTrajectory(angle, power, GameScreen.playerCurrent, 250, 0.03f);
shapes.polyline(traj.path, 0, traj.actualSize); shapes.polyline(traj.path, 0, traj.actualSize);
} }
} }