Merge branch 'master' of git.inpt.fr:tobgang/sagittarius
This commit is contained in:
commit
92e714411c
|
@ -7,6 +7,8 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
||||||
import com.badlogic.gdx.math.MathUtils;
|
import com.badlogic.gdx.math.MathUtils;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||||
|
import com.badlogic.gdx.audio.Sound;
|
||||||
|
import com.badlogic.gdx.files.*;
|
||||||
|
|
||||||
import sagittarius.view.GameScreen;
|
import sagittarius.view.GameScreen;
|
||||||
|
|
||||||
|
@ -17,7 +19,7 @@ public class Bow extends Actor {
|
||||||
private boolean aimAssist = false;
|
private boolean aimAssist = false;
|
||||||
private boolean pressed = false;
|
private boolean pressed = false;
|
||||||
private float angle;
|
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 anchor = new Vector2();
|
||||||
private Vector2 aim = 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);
|
Arrow arrowShot = new Arrow(angle, power, GameScreen.playerCurrent, false);
|
||||||
GameScreen.setFocus(arrowShot); // do not use constructor 2 times
|
GameScreen.setFocus(arrowShot); // do not use constructor 2 times
|
||||||
GameScreen.arrows.addActor(arrowShot);
|
GameScreen.arrows.addActor(arrowShot);
|
||||||
|
shotSound.play();
|
||||||
} else {
|
} else {
|
||||||
pressed = false;
|
pressed = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue