petit wooosh quand on tire (pas fini hein...)

This commit is contained in:
heurtet 2021-05-13 20:13:55 +02:00
parent 93f89c3e64
commit 3107615f2e

View file

@ -7,6 +7,8 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.files.*;
import sagittarius.view.GameScreen;
@ -17,7 +19,7 @@ public class Bow extends Actor {
private boolean aimAssist = false;
private boolean pressed = false;
private float angle;
private Sound shotSound = Gdx.audio.newSound(Gdx.files.internal("core/assets/sounds/fleche_decochee.mp3"));
private Vector2 anchor = new Vector2();
private Vector2 aim = new Vector2();
@ -48,6 +50,7 @@ public class Bow extends Actor {
Arrow arrowShot = new Arrow(angle, power, GameScreen.playerCurrent, false);
GameScreen.setFocus(arrowShot); // do not use constructor 2 times
GameScreen.arrows.addActor(arrowShot);
shotSound.play();
} else {
pressed = false;
}