diff options
author | Cameron Katri <me@cameronkatri.com> | 2021-06-13 00:11:07 -0400 |
---|---|---|
committer | Cameron Katri <me@cameronkatri.com> | 2021-06-13 00:11:07 -0400 |
commit | 25192f07018ad142818a87c2aacac1bf0ecdf551 (patch) | |
tree | 72482c571f81a4183d3236cf03ef4b0bfeedf92a /Assets/Scripts | |
parent | 20e5bf4339ffe52b6b09c7b72413c1e2295e282a (diff) | |
download | gmtk-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.cs | 3 |
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(); |