]> git.cameronkatri.com Git - gmtk-gamejam.git/blobdiff - Assets/Scripts/Controllers/Ball.cs
Airhorn at game end, better dribble, ball hit sound
[gmtk-gamejam.git] / Assets / Scripts / Controllers / Ball.cs
index ae0656f3a6022e0e13a9446485c56129d529ca87..01d9bf4f33950c27e3c1e9534a426db1b75c3a03 100644 (file)
@@ -9,12 +9,15 @@ namespace Controllers
     internal GameController controller;
 
     [SerializeField] private float shotForce;
+    [SerializeField] private AudioSource ballHitSound;
+    [SerializeField] private AudioClip ballHitClip;
 
     public Rigidbody2D Rigidbody => _rigidbody != null ? _rigidbody : _rigidbody = GetComponent<Rigidbody2D>();
     private Rigidbody2D _rigidbody;
     
     private void OnCollisionEnter2D(Collision2D other)
     {
+      ballHitSound.PlayOneShot(ballHitClip);
       controller.BallDropped();
     }