fix(arrow): reduced TTL + removed pitch

This commit is contained in:
Laureηt 2021-05-27 11:44:28 +02:00
parent e34894ab47
commit b0d3f0b930
3 changed files with 5 additions and 6 deletions

Binary file not shown.

Binary file not shown.

View file

@ -25,7 +25,7 @@ public class Arrow extends EntityQuad {
private Vector2 acceleration;
private Vector2 force;
private float TTL = 20;
private float TTL = 7;
private boolean landed;
private Planet crash;
@ -56,9 +56,9 @@ public class Arrow extends EntityQuad {
if (!preview) {
arrowLandedSound =
Gdx.audio.newSound(Gdx.files.internal("sounds/effects/arrow_landed.mp3"));
Gdx.audio.newSound(Gdx.files.internal("sounds/effects/arrow_landed_trim.mp3"));
arrowHitSound =
Gdx.audio.newSound(Gdx.files.internal("sounds/effects/player_death.wav"));
Gdx.audio.newSound(Gdx.files.internal("sounds/effects/player_death_trim.mp3"));
texture = new ArrayList<>();
String path = "arrow" + MathUtils.random(2);
@ -187,8 +187,7 @@ public class Arrow extends EntityQuad {
// Make a sound when an arrow lands
if (!SagittariusGame.disableSounds) {
long shotid = arrowLandedSound.play(SagittariusGame.soundsVolume);
arrowLandedSound.setPitch(shotid, 1.5f);
arrowLandedSound.play(SagittariusGame.soundsVolume);
}
this.crash = planet;
@ -216,7 +215,7 @@ public class Arrow extends EntityQuad {
private void verifyHitting() {
for (Actor actor : GameScreen.players.getChildren()) {
Player player = (Player) actor;
if (player == GameScreen.playerCurrent && TTL > 19.5)
if (player == GameScreen.playerCurrent && TTL > 6.5)
continue;
if (Intersector.overlapConvexPolygons(player.hitbox, this.hitbox)) {