aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Assets/Scripts
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-06-13 00:11:07 -0400
committerCameron Katri <me@cameronkatri.com>2021-06-13 00:11:07 -0400
commit25192f07018ad142818a87c2aacac1bf0ecdf551 (patch)
tree72482c571f81a4183d3236cf03ef4b0bfeedf92a /Assets/Scripts
parent20e5bf4339ffe52b6b09c7b72413c1e2295e282a (diff)
downloadgmtk-gamejam-25192f07018ad142818a87c2aacac1bf0ecdf551.tar.gz
gmtk-gamejam-25192f07018ad142818a87c2aacac1bf0ecdf551.tar.zst
gmtk-gamejam-25192f07018ad142818a87c2aacac1bf0ecdf551.zip
Improve checking of shot
Diffstat (limited to 'Assets/Scripts')
-rw-r--r--Assets/Scripts/Controllers/Hoop.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Assets/Scripts/Controllers/Hoop.cs b/Assets/Scripts/Controllers/Hoop.cs
index 7e924e7..488c38b 100644
--- a/Assets/Scripts/Controllers/Hoop.cs
+++ b/Assets/Scripts/Controllers/Hoop.cs
@@ -22,7 +22,8 @@ namespace Controllers
{
if (other.GetComponent<Ball>() == null) return;
- if (Rim.IsTouching(other) && Net.IsTouching(other))
+ // We don't want people shooting up the hoop so check the velocity of the ball to make sure it is going down.
+ if (Rim.IsTouching(other) && Net.IsTouching(other) && (other.GetComponent<Rigidbody2D>().velocity.y < 0))
{
HoopAnimator.Rebind();
shotSound.Play();