Merge branch 'master' of git.inpt.fr:tobgang/sagittarius

This commit is contained in:
Laureηt 2021-05-13 20:18:59 +02:00
commit 92e714411c

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;
}