From 3107615f2e956700b58b8045e2c1e4e6d56eefd7 Mon Sep 17 00:00:00 2001 From: heurtet Date: Thu, 13 May 2021 20:13:55 +0200 Subject: [PATCH] petit wooosh quand on tire (pas fini hein...) --- core/src/sagittarius/model/Bow.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/sagittarius/model/Bow.java b/core/src/sagittarius/model/Bow.java index 61cda43..ae898db 100644 --- a/core/src/sagittarius/model/Bow.java +++ b/core/src/sagittarius/model/Bow.java @@ -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; }